[FFmpeg-user] NVDEC/NVENC resources underutilization

Garri Djavadyan garryd at comnet.uz
Wed Feb 28 22:33:59 EET 2018


On 2018-02-28 23:54, James Girotti wrote:
> What I believe is happening is that ffmpeg
> is single-threading (as it must to reliable transcode), but the thread
> migrates between CPU cores. On my system this leads to much lower CPU 
> clock
> speeds, because the up_threshold is never met long enough on a single 
> core.
> And thus transcoding speed is significantly impacted.

James, thank you for the information. I see multiple threads, but the 
main thread's CPU core usage is 95%. Now it is clear for me, the 
bottleneck in my case is CPU core frequency. I used "top" to monitor 
cores's usage and never saw an overutilized core, because ffmpeg's main 
thread migrated between CPU cores quick enough.


> What I have done to remediate this is to use "taskset" to ensure ffmpeg
> runs on a single CPU core. I don't have any specific numbers to back 
> this
> up, but I have been satisfied enough with the results to continue using 
> it.
> I tried setting two or more CPU cores, but generally only set one CPU 
> core.

I followed your suggestion and got ~5% performance increase in synthetic 
test:

$ taskset -c 0 ffmpeg -c:v mpeg4_cuvid -i input.avi -map 0:v:0 -c:v 
h264_nvenc -b:v 1024k -f null -


But in the production environment (using a command from my first 
message), I actually didn't notice any performance gains.

Thanks!


Garri


More information about the ffmpeg-user mailing list