How can I use the ffmpeg command to reverse video?

I am trying to use FFmpeg library in Android to reverse video. I can dump images from videos, but how can I reverse all images and make a new video?

I am using a library from here in my gradle. Library is compile 'com.github.hiteshsondhi88.libffmpeg:FFmpegAndroid:0.2.5'. I can use some of the commands but not all. I'm using this command to dump images from video:

-i /storage/emulated/0/ffvid/frameCount.mp4 -an -qscale 1 /storage/emulated/0/ffimg/revi%06d.jpg

I can't use the commands $ffmpeg , $sox and $cat

I have unsuccessfully tried following these suggestions:

  • How can I reverse a video clip | Unix & Linux
  • Reverse video clip with ffmpeg | blogspot

What else can I try?


It looks like it runs ffmpeg and so instead of this:

ffmpeg -i inputfile.mp4 -vf reverse reversed.mp4

and this:

ffmpeg -i inputfile.mp4 -vf reverse -af areverse reversed.mp4

Run this instead:

-i inputfile.mp4 -vf reverse reversed.mp4

and this:

-i inputfile.mp4 -vf reverse -af areverse reversed.mp4

https://video.stackexchange.com/a/17739

Thanks LordNeckbeard!

It looks like this only works for ffmpeg commands and so commands like cat won't work.

I didn't look at it too close but it looks like if you try to run cat you would really be running ffmpeg cat which does not exist.

You see, if you run -i input.mkv -an -qscale 1 %06d.jpg from a terminal, this does nothing but if you run ffmpeg -i input.mkv -an -qscale 1 %06d.jpg it does. This indicates that this application runs ffmpeg and allows you to add the option -i input.mkv -an -qscale 1 %06d.jpg to the ffmpeg command.