Skip to content

Instantly share code, notes, and snippets.

@danielmahal
Created March 6, 2017 21:43
Show Gist options
  • Save danielmahal/e072a9058f5d18d1a14bc05cfd482910 to your computer and use it in GitHub Desktop.
Save danielmahal/e072a9058f5d18d1a14bc05cfd482910 to your computer and use it in GitHub Desktop.
Remove duplicate frames from video with ffmpeg and mpdecimate
ffmpeg -i input.mov -vf mpdecimate,setpts=N/FRAME_RATE/TB output.mov
@simonhavelock
Copy link

Here is a trick question for you: what if I have a video in a mov format and want to extract PNG files BUT maintain the original corresponding framenumber within the sequence? So, if we have a video with 10 frames and frames 2-8 are duplicates of each other it spits out 1.png 2.png 9.png and 10.png? Thank you for this, it's very helpful!

@simonhavelock
Copy link

ffmpeg -i fulltest.mov -vsync 0 -frame_pts true -vf mpdecimate out%04d.png

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment