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 751242 - qtmux: Should be adding EDL on streams with PTS/DTS shift
qtmux: Should be adding EDL on streams with PTS/DTS shift
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-06-19 23:29 UTC by Nicolas Dufresne (ndufresne)
Modified: 2015-06-22 23:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
qtmux: Set edit list to compensate DTS shift (2.93 KB, patch)
2015-06-19 23:30 UTC, Nicolas Dufresne (ndufresne)
committed Details | Review
qtmux: Use PTS to figure-out presence of gaps (1.25 KB, patch)
2015-06-19 23:30 UTC, Nicolas Dufresne (ndufresne)
committed Details | Review
qtmux: Test gaps at start of stream (5.40 KB, patch)
2015-06-19 23:30 UTC, Nicolas Dufresne (ndufresne)
committed Details | Review

Description Nicolas Dufresne (ndufresne) 2015-06-19 23:29:29 UTC
In order to properly fix the running time, streams with PTS/DST shift should actually be using an EDL.
Comment 1 Nicolas Dufresne (ndufresne) 2015-06-19 23:30:31 UTC
Created attachment 305727 [details] [review]
qtmux: Set edit list to compensate DTS shift

We shift DTS forward to avoid negative timestamps which cannot be
represented with version 0 of the CTTS table. To stick with that
version (backward compatibility), the spec recommend using an
edit list entry to move back the presentation time to where it
should be.
Comment 2 Nicolas Dufresne (ndufresne) 2015-06-19 23:30:35 UTC
Created attachment 305728 [details] [review]
qtmux: Use PTS to figure-out presence of gaps

We need to look at the presentation timestamp in order to conclude if
there is a gap at the start of a stream.
Comment 3 Nicolas Dufresne (ndufresne) 2015-06-19 23:30:38 UTC
Created attachment 305729 [details] [review]
qtmux: Test gaps at start of stream
Comment 4 Thiago Sousa Santos 2015-06-22 21:38:17 UTC
Review of attachment 305727 [details] [review]:

::: gst/isomp4/gstqtmux.c
@@ +2476,3 @@
+      }
+
+      if (has_gap || has_shift) {

Why do you need to check for has_gap here? Shouldn't it be only has_shift?

@@ +2481,3 @@
+
+        atom_trak_set_elst_entry (qtpad->trak, 1, duration, shift,
+            (guint32) (1 * 65536.0));

I'd rather have a single empty entry at the beginning, having 2 empty ones looks odd. It should work but I never saw files doing it.

Or is this needed due to that ambiguity of the empty entries at the beginning?
Comment 5 Thiago Sousa Santos 2015-06-22 21:39:47 UTC
Review of attachment 305728 [details] [review]:

Looks good together with the other fixes.
Comment 6 Nicolas Dufresne (ndufresne) 2015-06-22 22:01:18 UTC
Review of attachment 305727 [details] [review]:

::: gst/isomp4/gstqtmux.c
@@ +2476,3 @@
+      }
+
+      if (has_gap || has_shift) {

To not change the behaviour. In the past, we'd send two entry in presence of a gap. The empty entry, and the edit. Now we have tree cases.

- The case we only have a gap
- The case we have a gap, and a shift
- the case we only have a shift

The 'empty' entry is sent when there is a gap. The second entry is sent if media start need to be adjusted (shift) or if we had a gap (to keep the old behaviour) I'm not sure why we need this empty entry, since in theory we could just add the gap to the shift and that would be it. But I thought that this was done with care in the past, and that there is most likely a good reason.

@@ +2481,3 @@
+
+        atom_trak_set_elst_entry (qtpad->trak, 1, duration, shift,
+            (guint32) (1 * 65536.0));

Only one is empty. The second entry is not, but it will adjust the media start so time can be mapped properly.
Comment 7 Thiago Sousa Santos 2015-06-22 22:52:49 UTC
Got it, I misread the second elst entry. Looks fine, then.
Comment 8 Nicolas Dufresne (ndufresne) 2015-06-22 23:04:35 UTC
Attachment 305727 [details] pushed as feda525 - qtmux: Set edit list to compensate DTS shift
Attachment 305728 [details] pushed as 7b8615d - qtmux: Use PTS to figure-out presence of gaps
Attachment 305729 [details] pushed as 89104e3 - qtmux: Test gaps at start of stream