[Libav-user] FFMPEG decoding H264 and Multithreading

Alex Cohn alexcohn at netvision.net.il
Sat Feb 9 20:07:54 CET 2013


On Fri, Feb 8, 2013 at 7:49 PM, Jérôme SALAYET <jerome.salayet at hymatom.fr>wrote:

> Hello, I'm using FFMPEG to decode video streaming from an IP Camera. all
> seems good but I try to decrease the CPU usage of my application when I
> decompress several differents streams.
> In fact, I have a dual core processor, and if I decode one stream, my CPU
> usage is very low (so good). If I decompress two streams, it's ok too. But
> if I had a third decompression, my CPU increase from 2-5% to 25-30%.
>
> So, I try to activate Mutlithreading in FFMPEG (compiling with
> --enable-w32threads) with Mingw.****
>
> Perhaps, trying Multithreading isn"t the good solution to decrease the CPU
> usage, I'm not very sure of this point.
>

Other  authors gave you important advice, but to address your specific
question: multithreading is definitely nice for multi-stream decoding,
especially when you have multi-core CPU. But this should not be
multithreaded decoding: the best overall performance can be achieved when
separate threads are attached to each input stream, and each thread uses a
"single-threaded" decoder instance.

BR,
Alex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20130209/276ad359/attachment.html>


More information about the Libav-user mailing list