What settings can I use to maximize FFMpeg performance

codecffmpegperformancesettings

I'm trying to do some screencasting, but since my computer is much too old and slow the video being produced is laggy and the application I'm trying to record becomes unresponsive due to the CPU consumption. Since I can't upgrade at the moment, I'm looking to optimize what I have.
I switched from GNOME to OpenBox, and I've killed unnecessary processes, etc. Still no good. I've also optimized the application I'm recording, so the only thing left would be the recorder itself, which is FFMpeg.

What are some options and flags that can be used to get the best performance out of FFMpeg? Are there any specific codecs that are easier to process than others? I'll be recording about 10-15 mins at a time, so something that doesn't produce HUGE files sizes would also be appreciated. Any ideas?

Best Answer

If you have old computer any codec will make problems for real time encoding (not just for CPU but for disk as well). I suggest to find resolution which is low enough to reduce file size. I you want to have custom resolutions and framerate (mpeg1/mpeg2 can't be used). Resolution and framerate choose wisely.

Here is my suggestions for switches in ffmpeg:

-vcodec libx264 
-r 15
-preset ultrafast
-s 800x600

here I put 800x600 (this is maybe too low) and framerate is 15 fps. For better performance set framerate from 15 to 10 FPS. In my experience x264 is fast codec and allows custom resolutins and framerates.

Here is setup for MPEG2 (which is faster but is limited by resolutions & framerate)

-r 25 
-s 720x480 
-preset ultrafast 
-vcodec mpeg2video
Related Question