While you can go with the links approach, suggested by Gyan in the comments. You could also generate a list of files that you want to use for encoding, and then use -f concat
. I have tried it with the following:
find . -name '*.jpeg' -exec echo "file '"{}"'" >> list.text \;
ffmpeg -f concat -r 25 -safe 0 -i list.text -c:v libtheora -q:v 8 out.ogv
Let's take it apart.
First we generate the list of all the files matching '*.jpeg' name starting with the current directory .
, we do not want to output that list as is, because ffmpeg
for whatever reason cannot default to lines being files, and expects us to say it each and every line. So rather than my_image_001.jpeg
we want file 'my_image_001.jpeg'
. So we do a trick with the -exec
of find
piping the echo
command into a file. list.text
in this example.
Now we get to ffmpeg
. You tell it that you wish to concatenate all of the files, by providing -f concat
as the format of the file it is about to read. Note that you will need to specify the frame rate, since images do not have this at all. The -safe 0
is needed so that ffmpeg
does not crash and burn with Unsafe file name
error message. I believe that is because we are using paths relative to the current directory. It makes little sense, but you just need to do this. After this, the line is the same as if you were just re-encoding another video.