I have been doing some experiments with
ffmpeg and the
Output is a video with only the "active" parts and I used some tricks with the FPS.
Output will play at 25fps for the player, but will be at 5fps in reallity (adjust number 5 in both
setpts and first
fps filters to adjust speed. If 25fps is good for you (my test video showed changes too fast for me), drop the last filter and use
-map [c] instead.
If you need to adjust threshold, look at here: (f.e.:
mpdecimate would drop the frames, but the lenght is kept. With
setpts you force it to calculate a fixed duration for each frame and the first
fps makes it match the "current" speed defined by
fps makes it "playable" (inserts duplicate frames to fill to the 25fps video), (5fps video on my VLC does not play very well, freezing every now and then)
ffmpeg -y -i input.mp4 -filter_complex "[0:v] mpdecimate [a] ; [a] setpts='N/(5*TB)' [b] ; [b] fps=5 [c] ; [c] fps=25 [d]" -map "[d]" -c:v libx264 ouput.mp4