[FFmpeg-devel] [PATCH] Re: movenc.c: Allow MPEG2.mov playable under QuickTime Player

Baptiste Coudurier baptiste.coudurier
Sat Feb 12 23:54:38 CET 2011

On 2/12/11 2:37 PM, Takashi Mochizuki wrote:
>>> Thanks, could you please split the patch and just have this one hunk.
>>> It can be applied right now.
>> OK. Here it is.
> Hi, is there any issue still now prior to commit?

No, patch ok.

>> Since we parse the mpeg2 frame and retrieve the picture type,
>> you can set pts == dts for b frames, for P and I you can compute the pts
>>from either the temp_ref or by counting the number of b frames after,
>> although I think the temp_ref is the correct way.
> I think it is not good way. If I use temporal_reference value to calculate frame pts,
> it also requires each frame duration is constant value.
> mp4/mov container can handle VFR - thus each sample can have different duration.
> To make delayed frame's pts value such like P frame or OpenGop's I frame, 
> I have to evaluate it later - add up each B-frame's duration, then delayed frame can 
> be fixed. (that is the way my previous patch does)

You cannot non constant statics because of threads, and your patch is
wrong. Consider I P B B, I has pts, P has no pts, nopts_entry will be 1,
cts will be 1 which is wrong.

Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
FFmpeg maintainer                                  http://www.ffmpeg.org

More information about the ffmpeg-devel mailing list