5

Looking at the docs, it is not apparent to me whether ffmpeg would allow me to convert an image sequence to a video in reverse order, for example using this sequence:

frame-1000.jpg
frame-999.jpg
frame-998.jpg
...
frame-1.jpg

Is it possible to give a "step direction" for the frame indices?

0__
  • 66,707
  • 21
  • 171
  • 266

2 Answers2

12

Due to happenstance of your naming scheme, you're in luck.

FFmpeg's image sequence demuxer has a start number option and I've confirmed that it accepts negative values.

So,

ffmpeg -start_number -1000 -i frame%d.jpg reversed.mp4

Here the '-' has to be interpreted as part of the number series, so it's frame%d and not frame-%d.

Gyan
  • 85,394
  • 9
  • 169
  • 201
10

There is a reverse video filter, so something like

ffmpeg -i frame-%d.jpg -vf reverse reversed.mp4

would work also.

DJ Quardaboff
  • 103
  • 1
  • 8