On 28/05/2011, at 02.51, Alex Converse wrote: > On Mon, May 23, 2011 at 12:29 AM, Diego Biurrun <[email protected]> wrote: >> On Mon, May 02, 2011 at 08:52:30PM +0200, Gil Pedersen wrote: >>> I was wondering why my mp4 output based on a MPEG-TS source had poor >>> lip sync. Investigation revealed that libav does not write track >>> offsets using the 'edts' atom, as suggested by the spec. >>> >>> I have rewritten the mov_write_edts_tag() function to support writing >>> track offsets, handle long timecodes (>32bit), and fixed it so that >>> the initial composition time is properly calculated. >> >> Alex? Ping? >> > > First looks OK. [Hold off on committing until we resolve the second.] > > I'm having trouble understanding what the second is trying to do, care > to provide an example?
The current code assumes that the first sample has the earliest composition time. When using b-frames, a codec is not required to enforce this, and thus I make a quick search for the sample with the earliest composition time. ISO/IEC 14496-12 section 8.6.1.1 has an open GOP example that illustrates this. As far as I can tell this composition time is what needs to go into "media_time" for proper sync. Btw. it should also be noted that libav currently displays a warning when encountering tracks delayed with an edit list, and incorrectly handles tracks with both a delay and a media_time > 0. Regards, Gil _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
