How to reverse a Video

Reversing a video is a fun way to edit on videos. Perhaps you want to repeat a specific section in a long video. This article guides you to reverse a video using free softwares and a script.

Extract the video's frames using AVIDEMUX (A free software)

A video file is nothing but a bunch of pictures which show up on the screen at a defined speed to simulate motion. Each picture is referred as frame

Using AVIDEMUX we can extract these frames into a new directory by following the below steps :

Create a new directory in your computer to store the frames. Open the video in AVIDEMUX, select the section you want to reverse using the A and B markers (or dont select anything it will extract frames for the whole video).
Then select "File->Save as Image->Save selection as JPEG", key in pic.jpg as the file name and Save



This will extract the frames as pic-0001.jpg,pic-0002.jpg and so on.



Run script create frames in reverse order

Copy the below script and paste it into a notepad and save it as reverse.bat in the same folder where the frames were extracted.

@echo off
if not exist "reverse" mkdir reverse
del /Q "reverse\*"
SETLOCAL EnableDelayedExpansion
set /A var=10000
for /f "tokens=*" %%s in ('dir /b *.jpg ^| sort') do (
echo f | xcopy /f /y %%s reverse/!var!.jpg
set /A var-=1
)

del "reverse\10000.jpg"
pause


Create the video using the frames

Run the script from the folder and you will it created a new directory called reverse, which has files named 10000.jpg , 9999.jpg and so on.


Go back to AVIDEMUX click Open and select the first frame i.e., pic-0001.jpg, it will load all the subsequent frames into the editor.
Click on "File->Append" and now navigate to the reverse folder and select the lowest number file( 10000.jpg is the highest, if we have 50 frames then the lowest would be 9951.jpg)

Play the video once and verify it looks good, you can copy and paste (Ctrl-C and Ctrl-V) multiple times with the "A" marker at 0 to copy the frames over and over.

Click save and your video is ready !

You can add any audio you want by selecting an audio file under Audio ->Select Track.