How to Reverse a Video using FFmpeg

It’s very easy to reverse a video using FFmpeg because FFmpeg has a built-in reverse filter that can do this job for both audio and video! Let’s learn how in this tutorial and some gotcha’s that you should avoid.

Reverse a Video using FFmpeg

Here it is! A simple one-liner that takes your video and reverses it.

ffmpeg -i originalVideo.mp4 -vf reverse reversedVideo.mp4

And if you want to reverse the audio and video, all you gotta do is use this command.

ffmpeg.exe -i originalVideo.mp4 -vf reverse -af areverse reversedVideo.mp4

It’s as simple as that.

I used it on the Parkjoy sequence downloaded from xiph. Note, that the original video is in y4m format and I first transcoded it to H.264/AVC using crf=1 and then added timestamps for this fun experiment.

If you want to learn how to add timestamps to your video using the drawtext filter, then read this tutorial on

Here is the original sequence

And here is the reversed sequence – fun right?

Caution for Large Files

The problem with the reverse filter is that it loads the sequence into memory and if you try this on large sequences, you could very easily run out of memory.

The solution for this is to split your video into small pieces or segments, reverse each of them, and join them in the reverse order (yea, remember that!).

Related:  FFmpeg - Convert to Apple ProRes 422 / 4444 Simplified

If you don’t know how to cut a video into small pieces, check out our tutorial on trimming or cutting videos.

krishna rao vijayanagar
Krishna Rao Vijayanagar

I’m Dr. Krishna Rao Vijayanagar, founder of OTTVerse. I have a Ph.D. in Video Compression from the Illinois Institute of Technology, and I have worked on Video Compression (AVC, HEVC, MultiView Plus Depth), ABR streaming, and Video Analytics (QoE, Content & Audience, and Ad) for several years.

I hope to use my experience and love for video streaming to bring you information and insights into the OTT universe.

1 Comment

  1. Great! Sir, when I’m trying to concat the reversed and original video it is slowing down the video automatically. How can I do that using re-record? Both of the files being to same codec and extensions.

Leave a Reply

Your email address will not be published.