[FFmpeg-trac] #5811(avformat:closed): live_start_index option doesn't work.

FFmpeg trac at avcodec.org
Mon Jan 4 09:48:16 EET 2021


#5811: live_start_index option doesn't work.
-------------------------------------+-------------------------------------
             Reporter:  smalukav     |                    Owner:
                 Type:  defect       |                   Status:  closed
             Priority:  normal       |                Component:  avformat
              Version:  git-master   |               Resolution:
                                     |  needs_more_info
             Keywords:  hls          |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------

Comment (by nixklai):

 Replying to [comment:11 stevenliu]:
 > Replying to [comment:9 nixklai]:
 > > Coming from the youtube-dl project, I still cannot figure out how to
 fix this issue.
 > >
 > > youtube-dl already placed `-live_start_index` before `-i` options but
 it stills starts at the point of execution for live streams. Values of
 option `-live_start_index` such as `0`, `-36000` and `-180000` are tried
 but to no avail.
 > >
 > > The following is the youtube-dl debug log (including ffmpeg output).
 > >
 > > {{{
 > > D:\>youtube-dl --external-downloader-args "-live_start_index -180000"
 -v https://www.youtube.com/watch?v=orNc3NwAmHY --hls-use-mpegts --output
 "%(title)s-%(id)s.ts"
 > > [debug] System config: []
 > > [debug] User config: []
 > > [debug] Custom config: []
 > > [debug] Command-line args: ['--external-downloader-args',
 '-live_start_index -180000', '-v',
 'https://www.youtube.com/watch?v=orNc3NwAmHY', '--hls-use-mpegts', '--
 output', '%(title)s-%(id)s.ts']
 >
 > How can i get the m3u8 link? i cannot get m3u8 list link as your way.
 >
 > {{{
 > (base) bogon:ufbuild liuqi$ youtube-dl --external-downloader-args
 "-live_start_index -180000" -v https://www.youtube.com/watch?v=orNc3NwAmHY
 --hls-use-mpegts --output "%(title)s-%(id)s.ts"
 > [debug] System config: []
 > [debug] User config: []
 > [debug] Custom config: []
 > [debug] Command-line args: ['--external-downloader-args',
 '-live_start_index -180000', '-v',
 'https://www.youtube.com/watch?v=orNc3NwAmHY', '--hls-use-mpegts', '--
 output', '%(title)s-%(id)s.ts']
 > [debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
 > [debug] youtube-dl version 2020.12.09
 > [debug] Python version 3.7.4 (CPython) - Darwin-19.6.0-x86_64-i386-64bit
 > [debug] exe versions: ffmpeg N-100475-gf1357274e9, ffprobe
 N-100475-gf1357274e9, rtmpdump 2.4
 > [debug] Proxy map: {}
 > [youtube] orNc3NwAmHY: Downloading webpage
 > [debug] Default format spec: bestvideo+bestaudio/best
 > [debug] Invoking downloader on 'https://r4---sn-
 i3b7kns6.googlevideo.com/videoplayback?expire=1609335041&ei=oSzsX8eAFLj-
 gAP2xrXQBQ&ip=156.236.120.141&id=o-ADkMEtrZuGdAyF1wHDGafJ37TyDH5KOVKZMT5A6QxvFa&itag=136&aitags=133%2C134%2C135%2C136%2C160%2C242%2C243%2C244%2C247%2C278&source=youtube&requiressl=yes&mh=1B&mm=31%2C26&mn
 =sn-i3b7kns6%2Csn-
 npoe7nes&ms=au%2Conr&mv=m&mvi=4&pl=24&initcwndbps=511250&vprv=1&mime=video%2Fmp4&ns
 =F4MXogtd9LysRC-
 IsoxGFO8F&gir=yes&clen=903201271&dur=8916.099&lmt=1609295101449811&mt=1609313085&fvip=4&keepalive=yes&c=WEB&txp=5432434&n=dUyNbuEOd40-MZl8&sparams=expire%2Cei%2Cip%2Cid%2Caitags%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cns%2Cgir%2Cclen%2Cdur%2Clmt&sig
 =AOq0QJ8wRQIhAMY1H9bJN-
 b7MSFW76rqXjuXQb5kLz4Y5P8Es5XJEV4BAiBfgR34isOo7wVwhjB_CNZ7D3s3l8D-
 LjzbxFrh3Hs2HQ%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig
 =AG3C_xAwRQIhAInUG2MHzn5_tqcS2ngSyC8P4Op1W9Xp4Dav-JDMsT1CAiB0vE4amBCets-
 B7KknuQvxIPKkr4Wiva37_uEXZ30pXQ%3D%3D&ratebypass=yes'
 > [download] Resuming download at byte 233512091
 > [download] Destination: 孕婦的生產心聲!_ 瑪瑪信箱《第89集》
 -orNc3NwAmHY.ts.f136
 > [download]  26.6% of 861.36MiB at 641.81KiB/s ETA 16:49^C
 > }}}
 >

 Since the URL is dynamically generated by YouTube and scrapped by youtube-
 dl, you may need a constant live stream. I believe the YouTube channel
 [https://www.youtube.com/channel/UCI-Ho-GaKYbtMzXJWmWAsrg Cat Trumpet]
 always has several live streams available, and you may use them with
 youtube-dl to get the URL like mine (https://***a-random-
 server***.googlevideo.com/videoplayback?...).

 You can also try using a live stream demo URL from [https://cph-p2p-
 msl.akamaized.net/hls/live/2000341/test/master.m3u8 Akamai]. The issue
 persists in this live stream as well. Please check
 [https://gist.github.com/nixklai/e9f6ed2d1a85409b85f86f9fc2b41067 this
 log] for more information.

 Both youtube-dl and Akamai live streams start download at the time of
 execution, but not the start of the stream.

--
Ticket URL: <https://trac.ffmpeg.org/ticket/5811#comment:13>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list