ffmpeg - convert image sequence to video with reve

2020-02-11 09:45发布

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?

标签: ffmpeg
2条回答
我想做一个坏孩纸
2楼-- · 2020-02-11 09:47

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.

查看更多
太酷不给撩
3楼-- · 2020-02-11 09:48

There is a reverse video filter, so something like

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

would work also.

查看更多
登录 后发表回答