Reputation: 41
I frequently deal with .mp4 footage files which are game recordings from my computer. Because I'm dealing with a laggy game I end up with footage that has both duplicate frames and a variable frame rate. I want to cut out lagspikes from my video, lagspikes that can have the form of variable frame rates and/or duplicate frames. The end goal is to have video with a constant frame rate and no more lagspikes. I'm well aware that this will destroy or at least damage the audio, but keeping the audio intact is not necessary for my application.
I have come across the mpdecimate filter for FFmpeg. As far as I have seen this is able to remove duplicate frames, however it does this in a way that does not make the output file a shorter video, but it introduces more variable frame rate.
Is it possible to reach my goal with FFmpeg? And if so, how?
Thanks in advance for help!
Upvotes: 1
Views: 1362
Reputation: 41
ffmpeg -i input.mp4 -vf mpdecimate,setpts=N/FRAME_RATE/TB out.mp4
as Gyan showed in a comment on my original question, this is the solution. Works like a charm, thanks a lot! (FRAME_RATE can be replaced with a number if you wish to have a set framerate)
Upvotes: 3