My goal is to create a video from a bunch of jpg files. I have chosen FFMPEG (Windows 64) to solve this task

The task

I have more than 4k jpg files in a directory, all following the naming convention pic_000000X.jpg (where x is a number) i.e. pic_0000001.jpg,pic_0000002.jpg,.,pic_0001337.jpg and so on which I want to create a timelaps video from.


When I run ffmpeg -i pic_%7d.jpg -s:v 1280x720 -c:v libx264 output.mp4 I get the output.mp4 file but it is small and contains only few pictures/frames - nine to be precise (running the reverse command ffmpeg -i output.mp4 test%d.jpg I get test1.jpg to test9.jpg)


It seems to work until pic_0000009.jpg and then the pattern does not recognize pic_00000010.jpg onwards.

What am I missing or am I doing wrong to only include nine pictures? Thanks for time and effort for giving me some hints.


P.S. I tried the blob style file pattern but it does not work under windows

P.P.S. If you know of another tool that lets me achieve the task let me know as well

  • Try replace with pic%7d.jpg with pic_%7d.jpg (note the _). – DavidPostill Jan 23 '16 at 21:47
  • Thanks for your reply. My mistake - it is a typo in the description. Will change it. – Me_no_stupit Jan 23 '16 at 21:48
  • Also 00000010 is 8 digits. 0000001 is 7 digits. You need to add an extra 0 to the first 9 files? Check all file have the same number of digits and use that number in the expression. – DavidPostill Jan 23 '16 at 21:48
  • You could also try 'pic_%*.jpg'(note the 's) – DavidPostill Jan 23 '16 at 21:51
  • I found my error - it were the digits. My python script did not take into consideration the # of digits when creating the files. Thanks for your help to resolve this. I appreciate it! – Me_no_stupit Jan 23 '16 at 22:52

I messed up the file format for my input files, ending up with files that had 7digits and more. Now that all files correspond to the same file name pattern everything works as expected. Cheers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.