[FFmpeg-user] Strange CPU usage when running multiple ffmpeg instances

Tal Maoz magogo200 at gmail.com
Mon Aug 25 12:47:21 CEST 2014


Hello all,

I am a long time ffmpeg user and recently I've noticed a strange behavior
when running multiple ffmpeg instances.
I'm streaming video from a server into ffmpeg (in this case using wget for
testing) via stdin, and extracting png
frames into a pipe at 1 a rate of 1fps using the image2pipe output format.
For testing, the pipe's output then goes to /dev/null.

When running just one instance of ffmpeg, it uses about 20-25% CPU. I then
continue to run a few more simultaneous
instances doing the exact same thing. When I have 4 instances, I see that
each instance is now using 30-35% CPU.
When I get to 7 instances, each one is using 40-45% CPU. Finally, when I
get to 9 instances, each instance uses 55-60% CPU!
As you will see below, my ffmpeg is compiled with vaapi support, but I've
already tried running with "-hwaccel none"
and with "-threads 1" and I still get the same results.

One would expect the CPU usage per instance to remain the same, right? am I
missing anything here?

Just to make things clear, there's no network bandwidth issue here what so
ever, I have more than enough bandwidth to
download the same live stream multiple times.

My machine is a Dell Precision M6800 laptop with a quad-core Core i7-4930MX
at 3.00GHz with hyper-threading so it
looks like 8 cores. I have 32GB of RAM and running an Ubuntu 12.04 OS with
a standard 3.13.0-34-generic kernel.
I have an AMD FirePro M6100 Mobility Pro with 2GB GDDR5 dedicated RAM.

The tests are running on a custom compiled ffmpeg 2.3.1 with the following
configure command:
../ffmpeg-2.3.1/configure --enable-gpl --enable-nonfree
--enable-demuxer=concat --enable-libfreetype --enable-fontconfig
--enable-bzlib --enable-gnutls --enable-libfaac --enable-librtmp
--enable-libx264 --enable-decoder=png --enable-encoder=png
--enable-hwaccel=h264_vaapi --prefix=/home/magogo/ffmpeg/dist

Any ideas why this behavior should happen and if there is any way to fix
this?

Thanks,

Magogo


More information about the ffmpeg-user mailing list