[Libav-user] FFmpeg parallel H264 Decoding

Nicolas George nicolas.george at normalesup.org
Sun Aug 5 20:00:43 CEST 2012


Le nonidi 19 thermidor, an CCXX, Christian Brümmer a écrit :
> As soon as i try to use avcodec_decode_video2 parallel at the same
> time i got many ffmpeg log errors and the videoframe is messed up

You can not use the same AVCodecContext simultaneously from several threads.
You could create several AVCodecContext and use them simultaneously, or you
can keep a single one: it will return you the frames sequentially, but
behind the scenes it will decode in parallel.

I do not think the first solution can work if the frames come from the same
stream: zerolatency means that no frame depends on a later frame, either at
encoding or at decoding, but they still depend on previous frames.
Otherwise, it is an I-frame only codec, and the bitrate is much higher.

In fact, my intuition says that zerolatency will more or less kill all hope
of parallel frame decoding. Fortunately, you can still go for slice-based
threading.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20120805/5e448c32/attachment.asc>


More information about the Libav-user mailing list