简体   繁体   中英

Improve ffmpeg CPU usage by compromising quality

I am using FFMpeg for screen capturing. I am looking for a screen capturing tool that will run on 1000 of VMs (windows and mac).The VMs have limited CPU (1 core) and 2GB ram and No GPU.

Currently I invoke ffmpeg with

ffmpeg  -y -framerate 8 -f dshow -f gdigrab -i "desktop"  -c:v libx264  -crf 0 -preset ultrafast -threads 0 temp.mkv

I am using gdigrab to capture screen? Is there any better options that might reduce cpu usage? or changing the encoder or format?

I am aiming for 4-5% reduction in CPU usage.

Thanks in advance

Using -profile baseline and enabling -tune zerolatency to turn of some extra features should help a bit. Otherwise, you will need to use a different codec than h.264.

What is your source's resolution ? If it's big (like 1080p or 720p), have you considered downscaling first to 480p / 404p ?

Otherwise, it's better to just change the codec. I'd suggest you first try "-c:v mpeg4". If it is still too slow, go for "-c:v mpeg2video".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM