Video Production Stack Exchange is a question and answer site for engineers, producers, editors, and enthusiasts spanning the fields of video, and media creation. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a bunch of images, that follow this pattern.


They're in the correct order, but FFMPEG ignores anything after the first file, because it can't find a 0002.png. How can I get it to join these files?

I tried

ffmpeg -i %04d.png out.avi
share|improve this question
How about temporarily renaming them, making the AVI and then renaming them back to the (3x-2).png scheme? Bulk Rename Utility @ is a free, umm, bulk renamer. – Mulvya Mar 4 '13 at 15:25
up vote 5 down vote accepted

with ffmpeg 0.11.1 it's as easy as:

ffmpeg -f image2 -i %*.png out.avi

From the man page, in an example under "Video and Audio file format conversion":

When importing an image sequence, -i also supports expanding shell-like wildcard patterns (globbing) internally. To lower the chance of interfering with your actual file names and the shell's glob expansion, you are required to activate glob meta characters by prefixing them with a single % character, like in foo-%*.jpeg, foo-%?%?%?.jpeg or foo-00%[234%]%*.jpeg.

share|improve this answer
This hasn't been working for me using ffmpeg or avconv in Ubuntu 13.04 – hellocatfood Sep 12 '13 at 19:24
This appears to not be an option any more. – Timmmm Jan 27 '15 at 12:59
It seems they deprecated this syntax at some point. The updated documentation was committed 8-Aug-2012 but I can't tell what version that equates to across the multiple branches. See… – rymo Jan 27 '15 at 18:01
The glob_sequence pattern type is deprecated, but the glob pattern type is not. The answer by Mulvya and Peter Cordes works. – Sybren Sep 7 '15 at 22:03

From If you have large number of pictures to rename, you can use the following command to ease the burden. The command, using the bourne shell syntax, symbolically links all files in the current directory that match *jpg to the ‘/tmp’ directory in the sequence of ‘img001.jpg’, ‘img002.jpg’ and so on.

x=1; for i in *jpg; do counter=$(printf %03d $x); ln -s "$i" /tmp/img"$counter".jpg; x=$(($x+1)); done

share|improve this answer
I used this to combine multiple sequences seqA-[0001-n].png, seqB-[0001-n].png, etc. Much easier than messing around with image2 globbing and the concat filter. – z0r Mar 3 '14 at 3:45

Besides the workaround in my comment, you should be able to use this syntax from the ffmpeg documentation:

ffmpeg -f image2 -pattern_type glob -i '*.png' out.avi

The quotes are important, you need ffmpeg to see the *, not have the shell expand it.

share|improve this answer
Doesn't work for me, but it's probably because I have an older build. I'm accepting this one because it's most likely to help future users. – FakeRainBrigand Mar 5 '13 at 20:14
According to the ffmpeg documentation you should use '*.png' instead of %04d.png with the glob pattern type. – Friend Of George Mar 5 '13 at 22:06
That would then select all the pngs present in the folder, besides 00xx.png, whereas the OP wants to queue only the %04d pngs without worrying about numbering continuity. – Mulvya Mar 6 '13 at 7:09
I'm pretty sure that you need to put *.png in single-quotes (so '*.png') to avoid it being expanded by Unix-style shells (so, OSX and linux etc). – evilsoup Apr 5 '13 at 9:03
Sadly the ffmpeg developers make file globbing support an option! The standard windows builds don't include it. – Timmmm Jan 27 '15 at 13:01

I would actually suggest the same thing Mulvya suggested. Whenever I've needed to do stuff like this when dealing with 3D animation renderings, I've renamed the files to make them sequential. It's just easier to work with that way in a lot of different software unless you need to preserve the file names for some reason. Total Commander is also a great tool for multi-renaming.

share|improve this answer
I ended up doing something similar (a Python renaming script). – FakeRainBrigand Mar 5 '13 at 20:16

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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