I have a series of screenshots from a demo that I want to put in a video. I am using ffmpeg for this purpose. The command is ffmpeg -f image2 -i screenshot_%5d.png -vcodec mpeg4 demo.avi
. However, the video length is shorter than what I want, and it moves very fast. How do I specify how many images per second I want? I tried the -r
argument but that did not work.
If your CPU usage is still low after FFmpeg has managed to seek to the defined point in the video, it's likely due to one or more of the filters you're using. Some filters may not be able to use all the available CPU threads, and some filters aren't even multi-threaded.
Speeding up/slowing down video This can be done via two methods: using the setpts video filter (which requires re-encoding) or by erasing the timestamps by exporting the video to a raw bitstream format and muxing to a container while creating new timestamps.
You can change video speed by adjusting the “presentation time stamp” (PTS). In your case:
ffmpeg -f image2 -i screenshot_%5d.png -vcodec mpeg4 -vf "setpts=5*PTS" demo.avi
You'll get video, which plays 5 times slower, than normal video.
If you want to make it 5 times faster:
ffmpeg -f image2 -i screenshot_%5d.png -vcodec mpeg4 -vf "setpts=(1/5)*PTS" demo.avi
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With