Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to restrict ffmpeg to use only 50% of my CPU?

Tags:

ffmpeg

i m using ffmpeg for streaming my desktop over UDP but my problem is ffmpeg's process always takes 100% cpu for the entire time it is running leaving no room other application , my question is how can i restrict ffmpeg's process to take up only 50-60% of cpu ?

My cpu has single core 2 gb ram

like image 439
zukes Avatar asked Jun 19 '12 18:06

zukes


People also ask

How do I limit my CPU usage FFMpeg?

You can't limit FFMpeg to a percentage of CPU use, but you can set the -threads parameter on your FFMpeg call, if you have 4 cores try set it to -threads 2 that should limit you to around 50% CPU. Another solution might be to lower the priority on your FFMpeg process, to something lower than your applications.

Is there a way to limit CPU usage?

Open the Advanced settings for Power Options in Windows 10. You'll need to look at these settings for each plan to maximize the impact. Look for Processor power management, then change the minimum processor state to: 70 percent for minimum and maximum processor state. Click “Apply” then “OK” to save the settings.

How much RAM does FFMpeg use?

Here are the older laptop's specs: 250gb HDD. Windows Vista Home Premium. 2gb RAM.


1 Answers

FFMpeg has an option -threads. You can define there, if it's going to be auto (default) or you can limit the number of used threads (CPU cores). Recommended that you set your number based on the amount of available threads minus 1, or 2. So if you have 8 threads, setting to -threads 6 would be great. But if you have only one core and 2 gb of RAM, I'm not sure if this is the case! FFMpeg requires a lot of resources.

like image 124
Ilia Avatar answered Oct 09 '22 00:10

Ilia