[Libav-user] Threading a h264 video decoder - timing is odd.

Nicolas George george at nsup.org
Fri Jun 3 16:18:41 CEST 2016

Le sextidi 16 prairial, an CCXXIV, Jesper Taxbøl a écrit :
> I am working on a threaded video reader to spread the decode workload on
> some more cores and gain some speed. My source is included below:
> The thing is that I dont see a time improvement when starting two processes
> instead of one. On a 80mb mp4 file it takes 6 seconds to decode the video,
> while doing two in parallel takes 12 seconds. I can see that two cores's
> are used 100 percent. Im on a fast SSD disk so I dont think im IO limited.
> What could be the case. Is it the same decoder taht is doing all the work?
> Do I perhaps need to instantiate a context or something?

The decoders for the most common codecs, including the ones you are probably
using in your MP4 files, are already threaded in FFmpeg. Unless you have a
lot of cores, a single instance of the decode probably already uses them all
completely. Running several instance in parallel will only add
context-switching overhead.

Please remember that top-posting is not accepted on this list; if you do not
know what it means look it up.


  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20160603/9ef8ecde/attachment.sig>

More information about the Libav-user mailing list