Skip to content

Instantly share code, notes, and snippets.

@sdgandhi
Last active May 29, 2020 16:15
Show Gist options
  • Save sdgandhi/f47b03a61ce77ac45f38a53b492b3fed to your computer and use it in GitHub Desktop.
Save sdgandhi/f47b03a61ce77ac45f38a53b492b3fed to your computer and use it in GitHub Desktop.

Concat a video with a reversed version of itself (for looping)

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

# with audio
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment