[FFmpeg-devel] mutlithreading in ffmpeg?

Thomas Worth dev at rarevision.com
Thu Mar 31 00:15:48 CEST 2011

>> Notice that on frame 2 (timestamp 1001), the return value from the
>> decode function is 319, which is different from the next P frame,
>> which is 318. Now of course we get 318 twice at PTS 2002 because
>> ffmpeg-mt is returning the same frame twice, even though two different
>> timestamps are specified.
> I'm afraid you have a talent for writing explanations that confuse
> me more than they help :-)
> I'd say what happens is just that ffmpeg(-mt) in that case decides
> to completely drop the frame instead of "making something up" via
> error concealment. That is probably a bug in so far as it's not supposed
> to do that, but if your code fails with this it is too brittle.

Sorry about that, you'll probably need to step through the code to see
exactly what I'm talking about. Oh and by the way, you'll need to use
an MP4 file encoded with H.264 if you decide to have a go. You can
download a sample here, which has each frame numbered so you can see
where threaded seek/decoding skips each frame after the keyframe:


There's a link to download the video:

Specs of test video: 1280x720, 23.976fps, H.264 in MP4, GOP length: 12

> As said, ffmpeg-mt IMO is obsolete, have you tested with ffmpeg latest git?
> Sorry I don't think I'll have time to test today at least.

Right, I tried the latest git and the problem remains. Thanks for your help.

More information about the ffmpeg-devel mailing list