[Libav-user] FFmpeg parallel H264 Decoding
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 198 bytes
Desc: Digital signature
More information about the Libav-user