1

I am using ffmpeg to convert a series of bitmaps into an AVI file, using this syntax

ffmpeg.exe -framerate 60 -start_number 1 -i BMP%05d.BMP -dst_range 1 -color_range 2 -c:v libxvid -vtag xvid -q:v 1 -y -vf format=yuv420p output.AVI

which works fine.

But now I want to "ping pong" the output. ie create an AVI twice as long, but the second half is the same frames in reverse. So the movie plays forward, then in reverse.

I don't see any options/switches for this in the documentation. Is it possible?

Thanks for any tips.

Some1Else
  • 715
  • 11
  • 26
  • There is an answer for that that deals with videos, so you could use the video that you already generated: https://stackoverflow.com/a/42257863/2738151 – Hernán Alarcón Feb 18 '21 at 03:07

1 Answers1

2

you can make your video using your original command

ffmpeg.exe -framerate 60 -start_number 1 -i BMP%05d.BMP -dst_range 1 -color_range 2 -c:v libxvid -vtag xvid -q:v 1 -y -vf format=yuv420p output.AVI

then reverse is using

ffmpeg.exe -i output.AVI -vf reverse reverseOutput.AVI

then concat the two together

ffmpeg.exe -i output.AVI -i reverseOutput.AVI -filter_complex "[0:v:0][0:a:0][1:v:0][1:a:0]concat=n=2:v=1:a=1[outv][outa]" -map "[outv]" -map "[outa]" finalOutput.AVI

if the last command looks confusing you can just add the two original files to a text file and use

#this is vidList.txt
file 'path/for/output.AVI'
file 'path/for/reverseOutput.AVI'

then the command

ffmpeg.exe -f concat -safe 0 -i vidList.txt -c copy output.AVI
theCreator
  • 166
  • 4