Close

Flatten the frame rate of a screencap

A project log for Silly software wishlist

Motivation to do some software projects by writing them down.

lion-mclionheadlion mclionhead 01/21/2022 at 05:090 Comments

Phones finally gained built in screen capturing, but they capture a variable frame rate.  There are various ways to deal with it in the vijeo editor.  The vijeo editor could just handle variable frame rates.  This would be lossless but a major rework.  Playing a file with variable frame rate would require more than adding 1 to the frame number, 23.97 times a second.  It would mean binary searching for a time stamp for every frame played back.  Most of the vijeo files lions deal with are constant frame rate.

For a certain phone app which redraws at 7 to 8fps, there's

ffmpeg -i screen-20220120-164225.mp4 -r 23.97 flat.mp4

The output framerate has to be high enough to get smooth interpolation of the input fps.  Most howto's collect their adsense here & leave off with the crummy quality this produces.  The lion kingdom wanted to change that.

ffmpeg -i screen-20220120-164225.mp4 -c:v h264 -qp 0 -r 23.97 flat.mp4

This sets the output to lossless, -qp 0.  Lions have normally stopped seeing any significant losses at -qp 25.

Discussions