Concat a video with itself, but in reverse, using ffmpeg

后端 未结 1 1012
眼角桃花
眼角桃花 2020-12-28 18:39

I was able to reverse with:

ffmpeg -i input.mp4 -vf reverse output_reversed.mp4

And I can concat with:

ffmpeg -i input.mp4          


        
相关标签:
1条回答
  • 2020-12-28 19:03

    Technically, you can do it using

    ffmpeg -i input.mp4 -filter_complex "[0:v]reverse,fifo[r];[0:v][0:a][r] [0:a]concat=n=2:v=1:a=1 [v] [a]" -map "[v]" -map "[a]" output.mp4
    

    But the reverse filter will use a lot of memory for large videos. I've added a fifo filter to avoid frame drops. But test and see. (I haven't reversed the audio)

    If your clip has no audio, the above command will throw an error – instead, use:

    ffmpeg -i input.mp4 -filter_complex "[0:v]reverse,fifo[r];[0:v][r] concat=n=2:v=1 [v]" -map "[v]" output.mp4
    
    0 讨论(0)
提交回复
热议问题