Reputation: 781
1.we need to record screenshots into video with 2-3 fps. Quality - the minimum possible to make text on the screen readable, 256 colors. It is important to reduce the output video file size as much as possible.
2.we've made a lot of tests, and currently the most suitable way is to make screenshots every 300-500msec, save them in PNG, then run ffmpeg to encode to H.267 with these params:
ffmpeg -f image2 -i "C:\png5min\image%04d.png" -y -an -vcodec libx264 -preset veryfast -crf 30 "C:\output.mp4"
3.is it the best way to get minimum output size with 2-3fps screencast?
4.the output file plays very quickly, codec by default concerns that images represent 25fps. But they are 2fps actually. Ok, but if we try to decrease the output frame rate, output file size increases for about twice!! (from 3mb to 6mb for a 3m:26s video). And if we set the output frame rate as 2 - video does not play frames at all or plays just 2 frames for 3mins...:
-r 2 -f image2 -i "C:\png5min\image%04d.png" -y -an -vcodec libx264 -preset veryfast -crf 30 -r 2 "C:\image5min_2fps_crf30_test__R2-2.mp4"
so, how can we just add some latency after each frame without increasing the output file size???
Upvotes: 0
Views: 3646
Reputation: 92938
Try with a low input rate and a higher output rate.
Direct capture:
ffmpeg -f dshow -framerate 2 -i video="screen-capture-recorder" -c:v libx264 -r 12 -crf 30 -preset fast c:\output3.mkv
Image conversion:
-framerate 2 -i "C:\png5min\image%04d.png" -y -c:v libx264 -preset medium -crf 30 -r 6 -x264opts ref=5:min-keyint=300:keyint=600:rc-lookahead=150 "C:\image5min_2fps_crf30_test__R2-2.mp4"
The ultrafast
preset is useful mainly for full framerate realtime captures. For an input rate of 2, you can downgrade, which will give you better compression. In the image conversion command, you can skip it altogether, so it will default to medium
, which will compress better.
Upvotes: 1