[FFmpeg-user] read in pictures in reverse order

Moritz Barsnick barsnick at gmx.net
Mon Nov 2 12:06:12 CET 2015


Hi Michael,

On Sun, Nov 01, 2015 at 23:25:53 +0100, Michael Koch wrote:
> When making a video from many pictures, is it possible to read in the 
> pictures in reverse order, beginning with the last picture?
> If this is not possible, how can I rename the pictures automatically to 
> bring them in reverse order?

In general, there's a reverse filter:
https://ffmpeg.org/ffmpeg-filters.html#reverse_002c-areverse
But that may be tricky for your "many" pictures, as the discaimer
points out.

You can use the concat demuxer for lists of files:
https://ffmpeg.org/ffmpeg-formats.html#concat-1

$  ffmpeg -r 25 -f concat -i /tmp/concat.in.txt [...]

You can create the file list /tmp/concat.in.txt manually, or with
something like this (Unix):

$ ls -r $PWD/20151102-09-* | perl -pe 's|^(.*)|file $1|' > /tmp/concat.in.txt

Note the "-r" option to (GNU) ls for reversing the default order. (I
used perl for prepending "file ", as I was apparently too stupid for
sed.)

HTH,
Moritz


More information about the ffmpeg-user mailing list