Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support live streams in MPEG DASH #10787

Open
misuzu opened this issue Sep 28, 2016 · 9 comments
Open

Support live streams in MPEG DASH #10787

misuzu opened this issue Sep 28, 2016 · 9 comments

Comments

@misuzu
Copy link

@misuzu misuzu commented Sep 28, 2016

Please follow the guide below

  • You will be asked some questions and requested to provide some information, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your issue (like that [x])
  • Use Preview tab to see how your issue will actually look like

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2016.09.27. If it's not read this FAQ entry and update. Issues with outdated version will be rejected.

  • I've verified and I assure that I'm running youtube-dl 2016.09.27

Before submitting an issue make sure you have:

  • At least skimmed through README and most notably FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other

The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your issue


If the purpose of this issue is a bug report, site support request or you are not completely sure provide the full verbose output as follows:

Add -v flag to your command line you run youtube-dl with, copy the whole output and insert it here. It should look similar to one below (replace it with your log inserted between triple ```):

% youtube-dl http://tvcom-live1.service.cdn.cra.cz/tvcom/fotbal-cfl62/manifest.mpd --verbose
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['http://tvcom-live1.service.cdn.cra.cz/tvcom/fotbal-cfl62/manifest.mpd', '--verbose']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2016.09.27
[debug] Python version 3.5.1+ - Linux-4.6.0-1-amd64-x86_64-with-debian-stretch-sid
[debug] exe versions: ffmpeg 3.1.3-1, ffprobe 3.1.3-1, rtmpdump 2.4
[debug] Proxy map: {}
[generic] manifest: Requesting header
[redirect] Following redirect to http://se04.se.tvcom-live1.service.cdn.cra.cz/tvcom/fotbal-cfl62/manifest.mpd
[generic] manifest: Requesting header
WARNING: Falling back on generic information extractor.
[generic] manifest: Downloading webpage
[generic] manifest: Extracting information
ERROR: No video formats found; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
Traceback (most recent call last):
  File "/home/misuzu/Documents/Virtualenvs/rub90-v2-streaming/lib/python3.5/site-packages/youtube_dl/YoutubeDL.py", line 694, in extract_info
    ie_result = ie.extract(url)
  File "/home/misuzu/Documents/Virtualenvs/rub90-v2-streaming/lib/python3.5/site-packages/youtube_dl/extractor/common.py", line 355, in extract
    return self._real_extract(url)
  File "/home/misuzu/Documents/Virtualenvs/rub90-v2-streaming/lib/python3.5/site-packages/youtube_dl/extractor/generic.py", line 1663, in _real_extract
    self._sort_formats(info_dict['formats'])
  File "/home/misuzu/Documents/Virtualenvs/rub90-v2-streaming/lib/python3.5/site-packages/youtube_dl/extractor/common.py", line 922, in _sort_formats
    raise ExtractorError('No video formats found')
youtube_dl.utils.ExtractorError: No video formats found; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

If the purpose of this issue is a site support request please provide all kinds of example URLs support for which should be included (replace following example URLs by yours):


Description of your issue, suggested solution and other information

Explanation of your issue in arbitrary form goes here. Please make sure the description is worded well enough to be understood. Provide as much context and examples as possible.
If work on your issue requires account credentials please provide them or explain how one can obtain them.

Seems like youtube-dl does not support m4s container for MPEG DASH streams.

Sample manifest.mpd from http://tvcom-live1.service.cdn.cra.cz/tvcom/fotbal-cfl62/manifest.mpd:

?xml version="1.0" encoding="UTF-8"?>
<MPD xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xmlns="urn:mpeg:dash:schema:mpd:2011"
     xmlns:xlink="http://www.w3.org/1999/xlink"
     xsi:schemaLocation="urn:mpeg:DASH:schema:MPD:2011 http://standards.iso.org/ittf/PubliclyAvailableStandards/MPEG-DASH_schema_files/DASH-MPD.xsd"
     profiles="urn:mpeg:dash:profile:isoff-live:2011"
     type="dynamic"
     minimumUpdatePeriod="PT3.083S" 
     publishTime="2016-09-28T09:24:35Z" 
     availabilityStartTime="2016-09-28T09:07:27Z" 
     timeShiftBufferDepth="PT49.92S"
     suggestedPresentationDelay="PT15.0S" 
     minBufferTime="PT6.0S">
<ProgramInformation>
    <Title>fotbal-cfl62</Title>
</ProgramInformation>
<Period id="0" start="PT0.0S">
    <AdaptationSet id="0" mimeType="video/mp4" width="720" height="404" par="16:9" frameRate="25" segmentAlignment="true" startWithSAP="1" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
        <SegmentTemplate timescale="90000" media="chunk_u64qw79a6_ctvideo_cfm4s_rid$RepresentationID$_cs$Time$_mpd.m4s" initialization="chunk_u64qw79a6_ctvideo_cfm4s_rid$RepresentationID$_cinit_mpd.m4s">
            <SegmentTimeline>
                <S t="87343200" d="864000"/>
                <S d="1036800"/>
                <S d="864000"/>
                <S d="864000"/>
                <S d="864000"/>
            </SegmentTimeline>
        </SegmentTemplate>
        <Representation id="p0a0r0" codecs="avc1.42c01e" sar="1:1" bandwidth="1002000" />
    </AdaptationSet>
    <AdaptationSet id="1" mimeType="audio/mp4" lang="eng" segmentAlignment="true" startWithSAP="1" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
        <Role schemeIdUri="urn:mpeg:dash:role:2011" value="main"/>
        <SegmentTemplate timescale="44100" media="chunk_u64qw79a6_ctaudio_cfm4s_rid$RepresentationID$_cs$Time$_mpd.m4s" initialization="chunk_u64qw79a6_ctaudio_cfm4s_rid$RepresentationID$_cinit_mpd.m4s">
            <SegmentTimeline>
                <S t="42799183" d="422912"/>
                <S d="507904"/>
                <S d="423936"/>
                <S d="422912"/>
                <S d="422912"/>
            </SegmentTimeline>
        </SegmentTemplate>
        <Representation id="p0a1r0" codecs="mp4a.40.2" audioSamplingRate="44100" bandwidth="64000">
            <AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
        </Representation>
    </AdaptationSet>
</Period>
</MPD>
@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Sep 28, 2016

     type="dynamic"

m4s are supported. The real cause is that live DASH streams are not supported yet. Would you like to share where you got this mpd link?

UPDATE: Sorry I didn't see there are already some examples in the original post.

@yan12125 yan12125 mentioned this issue Sep 28, 2016
4 of 4 tasks complete
@yan12125 yan12125 changed the title m4s container in MPEG DASH streams is not supported Support live streams in MPEG DASH Sep 28, 2016
@yan12125 yan12125 added the request label Sep 28, 2016
@remitamine
Copy link
Collaborator

@remitamine remitamine commented Sep 28, 2016

as a work around, you can use the m3u8 url:
http://tvcom-live1.service.cdn.cra.cz/tvcom/fotbal-cfl62/playlist.m3u8

@dstftw dstftw mentioned this issue Oct 7, 2016
1 of 5 tasks complete
@dstftw dstftw mentioned this issue Dec 2, 2016
4 of 8 tasks complete
@dstftw dstftw mentioned this issue Dec 11, 2016
4 of 8 tasks complete
@guihkx
Copy link

@guihkx guihkx commented May 4, 2017

+1 This would be very nice!

@guihkx
Copy link

@guihkx guihkx commented Oct 26, 2017

Any plans to implement this soon?

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Oct 26, 2017

Supporting this requires lots of changes. I don't think it can be done in a short time. See #9109 for the first step.

Third party solutions like mp4client of gpac can be used as of now.

@guihkx
Copy link

@guihkx guihkx commented Oct 26, 2017

Thanks for the suggestion!

@WolfganP
Copy link

@WolfganP WolfganP commented Oct 26, 2017

Long time w/o trying it, but I think https://github.com/streamlink/streamlink also support YT Live streams. Check -o examples for recording the stream.

@guihkx
Copy link

@guihkx guihkx commented Oct 26, 2017

Apparently DASH isn't supported on streamlink as well. I'm able to watch Youtube livestream atm using mpv + youtube-dl, however it's capped @30FPS. I've tried using MP4Client + youtube-dl but it doesn't seem to work (though I'm not sure if I'm using this correctly):

$ MP4Client $(youtube-dl -g 'https://www.youtube.com/watch?v=ekpfeh7IuRA')                                                                                                            3.88   16:28:58 
Using config file in /home/gui/.gpac directory
System info: 7927 MB RAM - 4 cores
Modules Found : 35 
Loading GPAC Terminal
[Thread MediaManager] Couldn't set priority(2) for thread ID 0xc9dbe700
[Thread MediaManager] Couldn't set priority(2) for thread ID 0xc9dbe700
Terminal Loaded in 104 ms
Opening URL https://manifest.googlevideo.com/api/manifest/hls_playlist/id/ekpfeh7IuRA.1/itag/96/source/yt_live_broadcast/requiressl/yes/ratebypass/yes/live/1/cmbypass/yes/goi/160/sgoap/gir%3Dyes%3Bitag%3D140/sgovp/gir%3Dyes%3Bitag%3D137/hls_chunk_host/r3---sn-b8u-nvqe.googlevideo.com/ei/gSnyWZbmNs-qwQSA1IzgBg/gcr/br/playlist_type/DVR/mm/32/mn/sn-b8u-nvqe/ms/lv/mv/m/pl/22/dover/6/mt/1509042450/ip/179.179.144.242/ipbits/0/expire/1509064161/sparams/ip,ipbits,expire,id,itag,source,requiressl,ratebypass,live,cmbypass,goi,sgoap,sgovp,hls_chunk_host,ei,gcr,playlist_type,mm,mn,ms,mv,pl/signature/42C62F384A5B5A36F7FF8F2BC8108ED038161B5E.880D272559DC2D05BA22812D1A25367BE09C0C00/key/dg_yt0/playlist/index.m3u8
[M3U8] Unknown line in M3U8 file #EXT-X-DATERANGE:CLASS="CUEPOINT-AD",DURATION=28.679000,ID="1509041205005385-AD-START",START-DATE="2017-10-26T18:06:45.005+00:00",X-YTCP-EVENT="START",X-YTCP-OFFSET=1.321000,X-YTCP-TYPE="AD"
[M3U8] Unknown line in M3U8 file #EXT-X-DATERANGE:CLASS="CUEPOINT-AD",DURATION=25.736000,ID="1509041285000385-AD-START",START-DATE="2017-10-26T18:08:05.000+00:00",X-YTCP-EVENT="START",X-YTCP-OFFSET=4.264000,X-YTCP-TYPE="AD"
[M3U8] Unknown line in M3U8 file #EXT-X-DATERANGE:CLASS="CUEPOINT-AD",DURATION=25.773000,ID="1509041505004385-AD-START",START-DATE="2017-10-26T18:11:45.004+00:00",X-YTCP-EVENT="START",X-YTCP-OFFSET=4.227000,X-YTCP-TYPE="AD"
[M3U8] Unknown line in M3U8 file #EXT-X-DATERANGE:CLASS="CUEPOINT-AD",DURATION=29.022000,ID="1509041790005385-AD-START",START-DATE="2017-10-26T18:16:30.005+00:00",X-YTCP-EVENT="START",X-YTCP-OFFSET=0.978000,X-YTCP-TYPE="AD"
[M3U8] Unknown line in M3U8 file #EXT-X-CUEPOINT:DURATION=30.000000,EVENT=START,TIME_OFFSET=1.321000,TYPE=AD
[M3U8] Unknown line in M3U8 file #EXT-X-CUEPOINT:DURATION=30.000000,EVENT=START,TIME_OFFSET=4.264000,TYPE=AD
[M3U8] Unknown line in M3U8 file #EXT-X-CUEPOINT:DURATION=30.000000,EVENT=START,TIME_OFFSET=4.227000,TYPE=AD
[M3U8] Unknown line in M3U8 file #EXT-X-CUEPOINT:DURATION=30.000000,EVENT=START,TIME_OFFSET=0.978000,TYPE=AD
[DASH] Error - cannot connect service: MPD creation problem Bad Parameter
[MPD_IN] Error - cannot initialize DASH Client for https://manifest.googlevideo.com/api/manifest/hls_playlist/id/ekpfeh7IuRA.1/itag/96/source/yt_live_broadcast/requiressl/yes/ratebypass/yes/live/1/cmbypass/yes/goi/160/sgoap/gir%3Dyes%3Bitag%3D140/sgovp/gir%3Dyes%3Bitag%3D137/hls_chunk_host/r3---sn-b8u-nvqe.googlevideo.com/ei/gSnyWZbmNs-qwQSA1IzgBg/gcr/br/playlist_type/DVR/mm/32/mn/sn-b8u-nvqe/ms/lv/mv/m/pl/22/dover/6/mt/1509042450/ip/179.179.144.242/ipbits/0/expire/1509064161/sparams/ip,ipbits,expire,id,itag,source,requiressl,ratebypass,live,cmbypass,goi,sgoap,sgovp,hls_chunk_host,ei,gcr,playlist_type,mm,mn,ms,mv,pl/signature/42C62F384A5B5A36F7FF8F2BC8108ED038161B5E.880D272559DC2D05BA22812D1A25367BE09C0C00/key/dg_yt0/playlist/index.m3u8: Bad Parameter
 Cannot open https://manifest.googlevideo.com/api/manifest/hls_playlist/id/ekpfeh7IuRA.1/itag/96/source/yt_live_broadcast/requiressl/yes/ratebypass/yes/live/1/cmbypass/yes/goi/160/sgoap/gir%3Dyes%3Bitag%3D140/sgovp/gir%3Dyes%3Bitag%3D137/hls_chunk_host/r3---sn-b8u-nvqe.googlevideo.com/ei/gSnyWZbmNs-qwQSA1IzgBg/gcr/br/playlist_type/DVR/mm/32/mn/sn-b8u-nvqe/ms/lv/mv/m/pl/22/dover/6/mt/1509042450/ip/179.179.144.242/ipbits/0/expire/1509064161/sparams/ip,ipbits,expire,id,itag,source,requiressl,ratebypass,live,cmbypass,goi,sgoap,sgovp,hls_chunk_host,ei,gcr,playlist_type,mm,mn,ms,mv,pl/signature/42C62F384A5B5A36F7FF8F2BC8108ED038161B5E.880D272559DC2D05BA22812D1A25367BE09C0C00/key/dg_yt0/playlist/index.m3u8: Bad Parameter
@qsniyg
Copy link

@qsniyg qsniyg commented Dec 1, 2017

Audio and Video need to be downloaded together, most likely by somehow using 2 fragment contexts within DashSegementsFD (FragmentsFD would likely have to be changed as well for this to work), but first, DashSegmentsFD needs to be fed both at the same time.

Other than that, it's possible to hack around the other issues (not exactly pretty, but it works).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants
You can’t perform that action at this time.