dashdemux: Problems playing youtube streams
Submitted by cod..@..il.com
Created attachment 330919
Using source from 126.96.36.199.
Youtube uses mpeg-dash as one method to distribute its live streams, and I am trying to use gstreamer to play a stream directly from youtube servers. Attached is part of the MPD for one of these streams. I am assuming the MPD is valid. It is from the live stream here: https://www.youtube.com/watch?v=njCDZWTI-xg. Here is a link to an MPD for this file: https://manifest.googlevideo.com/api/manifest/dash/playlist_type/DVR/key/yt6/upn/OlXrWwK-70c/source/yt_live_broadcast/sparams/as,gcr,hfr,id,ip,ipbits,itag,playlist_type,requiressl,source,expire/gcr/us/signature/80C14B2024BE29F75C1DBF68CDBDEF411A632D5E.893DDA5444737864A0068A89270AB08F26ACF9D3/fexp/9407060,9416126,9416891,9422596,9428398,9431012,9433096,9433223,9433946,9435526,9435876,9437066,9437553,9437742,9439652,9440376/ip/188.8.131.52/requiressl/yes/itag/0/as/fmp4_audio_clear,webm_audio_clear,webm2_audio_clear,fmp4_sd_hd_clear,webm2_sd_hd_clear/expire/1467351997/id/njCDZWTI-xg.54/sver/3/ipbits/0/hfr/1
I was hoping to get your help with several issues relating to dashdemux when dealing with these streams:
- Youtube puts the
<Period>but outside of any
<AdaptdationSet>. I assume this means that this timeline should be valid for all future
<SegmentList>'s. The current parser doesn't seem to like this as after the SegmentList is parsed, I get the error "segment has neither duration nor timeline" printed from gst_mpdparser_parse_mult_seg_base_type_ext().
To get around this for the time being I put a huge hack in gst_mpdparser_parse_segment_timeline_node that will store any timelines that have been parsed (in these files - only one) and add them to any node that did not contain a timeline in the method gst_mpdparser_parse_mult_seg_base_type_ext(). This gets me past this problem for the time being, but then I ran into the next issue (which may be caused by doing this, I'm not sure).
- gst_mpd_client_get_period_index_at_time () iterates through the periods to try to find one that is valid for the current TOD. The 1 period in the file is checked and has a correct start time, but for some reason has a duration of -1. This causes the calculation to fail and return G_MAXUINT causing dashdemux to think there are no streams valid for the current time. I'm not sure if -1 is an error or means "plays forever" - but I worked around this issue by checking if the duration was -1, and if so calling it a valid period.
This seemed to get me to where the stream ought to be able to play using gst-play-1.0 but I never see any video or hear any audio. If I enable GST_DEBUG=6 I see that dashdemux downloaded a single fragment from the server but it never seems to send it on to the next filter. It will continually download the manifest with a small delay, re-parse it, and continue. The pipeline never exits the prerolling phase.
Thanks for any help you can provide. I am happy to help implement a real solution to these issues if you want to provide suggestions.
Attachment 330919, "MPD":