GNOME Bugzilla – Bug 751361
qtmux generates bad output timestamps
Last modified: 2015-06-24 02:41:53 UTC
Created attachment 305895 [details] qtmux timestamp input log One of the recent changes to qtmux timestamp handling / CTTS offset bits break splitmuxsink. For the second and further files, the timestamps produced by qtdemux now look like this: /GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = chain ******* (fakesink0:sink) (133017 bytes, dts: 0:00:00.000000000, pts: 0:00:00.041666666, duration: 0:00:02.419166666, offset: -1, offset_end: -1, flags: 00000040 discont ) 0x7f6798003630 New clock: GstSystemClock /GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = chain ******* (fakesink0:sink) (19969 bytes, dts: 0:00:02.419166666, pts: 0:00:02.502500000, duration: 0:00:00.041666667, offset: -1, offset_end: -1, flags: 00002000 delta-unit ) 0x7f67980031f0 /GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = chain ******* (fakesink0:sink) (7283 bytes, dts: 0:00:02.460833333, pts: 0:00:02.460833333, duration: 0:00:00.041666667, offset: -1, offset_end: -1, flags: 00002000 delta-unit ) 0x7f6798003630 /GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = chain ******* (fakesink0:sink) (12678 bytes, dts: 0:00:02.502500000, pts: 0:00:02.627500000, duration: 0:00:00.041666666, offset: -1, offset_end: -1, flags: 00002000 delta-unit ) 0x7f67980031f0 /GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = chain ******* (fakesink0:sink) (17459 bytes, dts: 0:00:02.544166666, pts: 0:00:02.544166666, duration: 0:00:00.041666667, offset: -1, offset_end: -1, flags: 00002000 delta-unit ) 0x7f67980030e0 /GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = chain ******* (fakesink0:sink) (5308 bytes, dts: 0:00:02.585833333, pts: 0:00:02.585833333, duration: 0:00:00.041666667, offset: -1, offset_end: -1, flags: 00002000 delta-unit ) 0x7f67980031f0 See the attachment for the input timestamp info qtmux was given, but basically the timeline starts at 0:00:02.419166666 and goes from there.
No, the timeline cannot start at anything else then 0 in qtdemux. The duration of the first buffer is wrong. We are working on this (qtmux buf, + some more bugs).
Feel free to dup if there's another bug tracking the same problem.
Bugs are getting confused, so I'll use yours.
Created attachment 305969 [details] [review] qtmux: store last_dts of the first buffer Buffers need not to start at running-time 0 so the last_dts needs to be the value of the first buffer's dts as it is used to compute the duration of the buffers. If it was left at 0 the first buffer would have a larger duration when it shouldn't
Created attachment 305970 [details] [review] qtdemux: improve some debug messages Those messages are about the stream, use the pad as the debug object to make it clear from the logs
Created attachment 305971 [details] [review] qtdemux: accumulate previous edts entries into segment.base Allows playing edts editted files with proper synchronization of streams. This patch fixes the regression introduced by bf95f93c0189aa04f18e264b86b6527e431c5d53 that was added to fix segment seeks handling. Having the accumulated_base separated from the main segment.base allows handling both segment seeks and edts editted files.
Created attachment 305972 [details] [review] qtmux: Correctly calculate the elst media start The media start has nothing to do with the shift we have applied but with the value of the first PTS. This is defined as: Dt(0) = 0 Ct(0) = Dt(0) + CTTS(0) So the media start is always the first CTTS.
Created attachment 305973 [details] [review] qtmux: Correctly test each segments In presence of gaps, qtdemux will emit multiple segments. The second segment start should match the CTTS.
Attachment 305969 [details] pushed as 1ec9a86 - qtmux: store last_dts of the first buffer Attachment 305970 [details] pushed as aef61c2 - qtdemux: improve some debug messages Attachment 305971 [details] pushed as eceb2cc - qtdemux: accumulate previous edts entries into segment.base Attachment 305972 [details] pushed as 2359ee2 - qtmux: Correctly calculate the elst media start Attachment 305973 [details] pushed as db63796 - qtmux: Correctly test each segments
Now the fun part will be to track all other bugs that this patchset is fixing. I think it's worth mentioning that now the file we generated when recording from live source has lib sync in vlc ;-P