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 778237 - dash, mpdparser: problem with German DVB-T2 DASH preview streams
dash, mpdparser: problem with German DVB-T2 DASH preview streams
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
1.11.1
Other All
: Normal normal
: 1.11.91
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-02-06 11:32 UTC by Juergen Sachs
Modified: 2017-04-11 08:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
sample manifest from akamai-progressive.irt.de (5.60 KB, application/xml)
2017-02-06 11:32 UTC, Juergen Sachs
  Details
proposed path to fix this issue (2.28 KB, patch)
2017-02-06 11:41 UTC, Juergen Sachs
none Details | Review
new proposal for recommented changes to fix this problem (2.84 KB, patch)
2017-03-03 10:27 UTC, Juergen Sachs
committed Details | Review

Description Juergen Sachs 2017-02-06 11:32:12 UTC
Created attachment 345026 [details]
sample manifest from akamai-progressive.irt.de

When playing one of the German DVB-T2 preview DASH streames stream I get an error
>> gstmpdparser.c:1645:gst_mpdparser_parse_mult_seg_base_type_ext: segment has neither duration nor timeline 
The manifest contains SegmentTemplate nodes both in the AdaptationSet and in the Representation nodes. The SegmentTemplate in AdaptationSet does not contain a duration attribute and therefore the parser bails out (without examining the sub-nodes).

Partiell manifest:
---
<AdaptationSet segmentAlignment="true" bitstreamSwitching="true" maxWidth="1280" maxHeight="720" maxFrameRate="50" par="16:9" lang="und">
  <Role schemeIdUri="urn:mpeg:dash:role:2011" value="main"/>
  <SegmentTemplate initialization="V-1280x720p50_ libx264_high_yuv420p_gop100_bit3584k_term5-2-5-14-1_set1_init.mp4"/>
  <Representation id="164950" mimeType="video/mp4" codecs="avc1.640020" width="1280" height="720" frameRate="50" sar="1:1" startWithSAP="1" bandwidth="3484245">
    <SegmentTemplate timescale="12800" media="V-1280x720p50_6bar_2ch_libx264_high_yuv420p_gop100_bit3584k_max3584k_buf7M_term1-2-4-14-1_dash_track1_$Number$.m4s" startNumber="1" duration="25600"/>
---
The complete manifest is attached and comes from 
http://akamai-progressive.irt.de/irt_avstandard_2014/M4S/1280x720p50/V-1280x720p50_libx264_high_yuv420p_gop100_bit3584k_term5-2-5-14-1/seg2_frag2_hbbtv15_live_multi/V-1280x720p50_libx264_high_yuv420p_gop100_bit3584k_term5-2-5-14-1.mpd
Comment 1 Juergen Sachs 2017-02-06 11:41:35 UTC
Created attachment 345027 [details] [review]
proposed path to fix this issue

The attached patch works for the claimed problem, but it should be reviewed by other gstreamer experts.
Comment 2 Sebastian Dröge (slomo) 2017-03-02 18:18:23 UTC
Review of attachment 345027 [details] [review]:

::: ext/dash/gstmpdparser.c
@@ +1645,3 @@
+   *   no sub-SegmentTemplates: check timeline and duration
+   *   all Representations have SegmentTemplates: don't check
+   */

Please explain in a bit more detail what you're doing here and why, and why it is valid to omit the check

@@ +1646,3 @@
+   *   all Representations have SegmentTemplates: don't check
+   */
+  do_sanity_check = 0x02; // no sub SegmentTemplates: do sanity check

Instead of using magic bitflags, please use descriptive booleans (and don't use // comments)
Comment 3 Juergen Sachs 2017-03-03 10:27:43 UTC
Created attachment 347123 [details] [review]
new proposal for recommented changes to fix this problem

patch now based on commit ffbe6906565108f99fccdd65276c6134b43c7cdf @ master
Comment 4 Thiago Sousa Santos 2017-03-12 18:39:42 UTC
Review of attachment 347123 [details] [review]:

::: ext/dash/gstmpdparser.c
@@ +1668,3 @@
+        }
+        if (have_segmenttemplate)
+          do_sanity_check &= ~SANITY_CHECK_REASON_NO_SUBTEMPLATES;

Shouldn't this be done only if *all* Representations had a segment template? We could have one that had a segment template and others without (using the default values from the parent).
Comment 5 Juergen Sachs 2017-03-13 08:32:08 UTC
Yes, you're right, we have three different cases
1. *all* Representations have a SegmentTemplate: 
  -> don't do the check (do_sanity_check==0)
    SANITY_CHECK_REASON_NO_SUBTEMPLATES is cleared in the loop
    SANITY_CHECK_REASON_TOPLEVEL_TEMPLATE never set
2. *not any* Representation has a SegmentTemplate 
   (=all Representations don't have a SegmentTemplate)
  -> do the check (do_sanity_check==SANITY_CHECK_REASON_NO_SUBTEMPLATES | \
                                    SANITY_CHECK_REASON_TOPLEVEL_TEMPLATE)
    SANITY_CHECK_REASON_NO_SUBTEMPLATES ist never cleared
    SANITY_CHECK_REASON_TOPLEVEL_TEMPLATE is set 
3. *some, but not all" Representations have SegmentTemplate
  -> do the sanity check (do_sanity_check==SANITY_CHECK_REASON_TOPLEVEL_TEMPLATE)
    SANITY_CHECK_REASON_NO_SUBTEMPLATES is cleared in the loop
    SANITY_CHECK_REASON_TOPLEVEL_TEMPLATE is set on the 1st Representation 
           not having a SegmentTemplate
Please help me - I do not understand, where the problem is? Can you give a sample where the algorithm fails?
Comment 6 Thiago Sousa Santos 2017-04-10 22:35:11 UTC
Sorry, you're right. Seems like this covers it all.
Comment 7 Sebastian Dröge (slomo) 2017-04-11 08:19:52 UTC
commit 270f97611c9ebeb1c3a9869894c2bff5de7dafdb
Author: Jürgen Sachs <juergen.sachs@metz-ce.de>
Date:   Fri Mar 3 09:08:06 2017 +0100

    dashdemux/mpdparser: Fix wrong false sanity check for manifests with nested SegmentTemplate nodes
    
    https://bugzilla.gnome.org/show_bug.cgi?id=778237