After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 751361 - qtmux generates bad output timestamps
qtmux generates bad output timestamps
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal blocker
: 1.5.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-06-23 07:50 UTC by Jan Schmidt
Modified: 2015-06-24 02:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
qtmux timestamp input log (3.55 KB, text/plain)
2015-06-23 07:50 UTC, Jan Schmidt
  Details
qtmux: store last_dts of the first buffer (1.22 KB, patch)
2015-06-24 02:34 UTC, Nicolas Dufresne (ndufresne)
committed Details | Review
qtdemux: improve some debug messages (7.12 KB, patch)
2015-06-24 02:34 UTC, Nicolas Dufresne (ndufresne)
committed Details | Review
qtdemux: accumulate previous edts entries into segment.base (2.74 KB, patch)
2015-06-24 02:34 UTC, Nicolas Dufresne (ndufresne)
committed Details | Review
qtmux: Correctly calculate the elst media start (3.00 KB, patch)
2015-06-24 02:34 UTC, Nicolas Dufresne (ndufresne)
committed Details | Review
qtmux: Correctly test each segments (4.23 KB, patch)
2015-06-24 02:34 UTC, Nicolas Dufresne (ndufresne)
committed Details | Review

Description Jan Schmidt 2015-06-23 07:50:33 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.
Comment 1 Nicolas Dufresne (ndufresne) 2015-06-23 14:19:08 UTC
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).
Comment 2 Jan Schmidt 2015-06-24 00:33:10 UTC
Feel free to dup if there's another bug tracking the same problem.
Comment 3 Nicolas Dufresne (ndufresne) 2015-06-24 02:32:59 UTC
Bugs are getting confused, so I'll use yours.
Comment 4 Nicolas Dufresne (ndufresne) 2015-06-24 02:34:39 UTC
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
Comment 5 Nicolas Dufresne (ndufresne) 2015-06-24 02:34:42 UTC
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
Comment 6 Nicolas Dufresne (ndufresne) 2015-06-24 02:34:46 UTC
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.
Comment 7 Nicolas Dufresne (ndufresne) 2015-06-24 02:34:50 UTC
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.
Comment 8 Nicolas Dufresne (ndufresne) 2015-06-24 02:34:54 UTC
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.
Comment 9 Nicolas Dufresne (ndufresne) 2015-06-24 02:39:07 UTC
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
Comment 10 Nicolas Dufresne (ndufresne) 2015-06-24 02:41:53 UTC
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