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
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.
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.
Here are the older laptop's specs: 250gb HDD. Windows Vista Home Premium. 2gb RAM.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With