Speed-up/Slow-down a video
|Reported by:||burek||Owned by:|
|Blocking:||Reproduced by developer:||no|
|Analyzed by developer:||yes|
The problem: Video is recorded at 10 fps, but always plays at 30 fps (erroneously encoded somehow). How to correct such a video to play with the correct speed?
I'm not sure if there is an easy way to do this, but afaik there is no simple way to do this, because FFmpeg does not do any kind of buffering of frames it reads from the input, it just drops/duplicates the frames.
We had few people on irc channel, trying to fix their videos, using FFmpeg, that's why I'm posting this. We resolved this issue by writting raw video to a tmp file (to loose the timestamps) and then we read the tmp file with a slower frame rate, like this:
ffmpeg -i input.264 -f rawvideo -r 30 tmpfile
ffmpeg -s 1280x720 -r 10 -f rawvideo -i tmpfile output.mp4
The video in input.264 would play nice at 10 fps, but somehow timestamps are saved just like it's 30 fps video, so it was always played back too fast.
The suggestion is to create an enhancement to rearrange timestamps on the fly, to avoid the need for the tmp file, to be able to speed up/slow down a video stream (also if possible even without re-encoding it).