ffmpeg-kit icon indicating copy to clipboard operation
ffmpeg-kit copied to clipboard

Throttle CPU usage

Open bebjorn opened this issue 2 years ago • 4 comments

Is your feature request related to a problem? Please describe. I need to use ffmpeg while still doing other expensive things like video recording and analyzing. It sometimes works but on many devices and in many cases running ffmpeg commands causes the video recording to freeze.

Describe the solution you'd like I would like some way to limit the amount of CPU used by ffmpeg. Normally speed is good but in my case it is not really needed.

Describe alternatives you've considered I have tried to give a low thread priority to the thread calling the ffmpeg-kit execute command. I have also tried the FFMPEG argument "-threads 1" without effects.

Platform I am using Android.

Additional context

bebjorn avatar May 18 '22 14:05 bebjorn

There are only two alternatives to limit the cpu usage that I know of:

  1. -threads option on ffmpeg to specify number of cores that will be used by ffmpeg
  2. Running synchronous FFmpegKit API methods on a thread that has low priority

If the -threads 1 doesn't improve the situation then try the second one.

tanersener avatar May 18 '22 22:05 tanersener

Thank you for your suggestions. So the native call to FFMPEG should respect the thread priority used when running synchronous FFmpegKit API methods?

I have however tried both of those alternatives, separately and together, without success. I will continue to try different variations, and try to dig into what happens.

bebjorn avatar May 19 '22 12:05 bebjorn

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Jul 19 '22 02:07 github-actions[bot]

This is still an issue

maxlapides avatar Jul 19 '22 02:07 maxlapides

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Sep 18 '22 02:09 github-actions[bot]

This issue was closed because it has been stalled for 7 days with no activity.

github-actions[bot] avatar Sep 26 '22 02:09 github-actions[bot]