简体   繁体   English

通过降低质量来改善CPU使用率

[英]Improve ffmpeg CPU usage by compromising quality

I am using FFMpeg for screen capturing. 我正在使用FFMpeg进行屏幕捕获。 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. 我正在寻找一个可在1000个虚拟机(Windows和Mac)上运行的屏幕捕获工具。虚​​拟机具有有限的CPU(1核心)和2GB内存以及无GPU。

Currently I invoke ffmpeg with 目前我调用ffmpeg

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? 我用gdigrab来捕捉屏幕? Is there any better options that might reduce cpu usage? 有没有更好的选择可能会减少CPU使用? or changing the encoder or format? 或更改编码器或格式?

I am aiming for 4-5% reduction in CPU usage. 我的目标是减少4-5%的CPU使用率。

Thanks in advance 提前致谢

Using -profile baseline and enabling -tune zerolatency to turn of some extra features should help a bit. 使用-profile baseline和启用-tune zerolatency来转换一些额外的功能应该有所帮助。 Otherwise, you will need to use a different codec than h.264. 否则,您将需要使用与h.264不同的编解码器。

What is your source's resolution ? 你的消息来源的解决方案是什么? If it's big (like 1080p or 720p), have you considered downscaling first to 480p / 404p ? 如果它很大(如1080p或720p),你是否考虑过首先缩小到480p / 404p?

Otherwise, it's better to just change the codec. 否则,最好只更改编解码器。 I'd suggest you first try "-c:v mpeg4". 我建议你先试试“-c:v mpeg4”。 If it is still too slow, go for "-c:v mpeg2video". 如果仍然太慢,请转到“-c:v mpeg2video”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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