ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
132.26k stars 10.03k forks source link

[YouTube] Some archived live streams have no audio #23855

Open ghost opened 4 years ago

ghost commented 4 years ago

Checklist

Verbose log

$ youtube-dl -v -f 140 https://www.youtube.com/watch?v=zauGZfKosJQ
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', '-f', '140', 'https://www.youtube.com/watch?v=zauGZfKosJQ']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2020.01.24
[debug] Python version 3.6.8 (CPython) - Linux-4.15.0-1041-aws-x86_64-with-Ubuntu-18.04-bionic
[debug] exe versions: ffmpeg 3.4.6, ffprobe 3.4.6
[debug] Proxy map: {}
[youtube] zauGZfKosJQ: Downloading webpage
[youtube] zauGZfKosJQ: Downloading video info webpage
[youtube] zauGZfKosJQ: Downloading m3u8 information
[youtube] zauGZfKosJQ: Downloading MPD manifest
[debug] Invoking downloader on 'https://manifest.googlevideo.com/api/manifest/dash/expire/1580106423/ei/Vi4uXtzIPNaBhwbYo6OoDQ/ip/x.x.x.x/id/zauGZfKosJQ.1~21530064/source/yt_live_broadcast/requiressl/yes/as/fmp4_audio_clear%2Cwebm_audio_clear%2Cwebm2_audio_clear%2Cfmp4_sd_hd_clear%2Cwebm2_sd_hd_clear/force_finished/1/vprv/1/fexp/23842630/itag/0/playlist_type/DVR/sparams/expire%2Cei%2Cip%2Cid%2Csource%2Crequiressl%2Cas%2Cforce_finished%2Cvprv%2Citag%2Cplaylist_type/sig/ALgxI2wwRgIhANtgNXYLPeXomR-_m7uyOtDVh05AS_GsWUP353iMFNiMAiEA29nF3IWDsUTan96k8VIXop3VeUVTG4RYL1G8XiNM63w%3D'
[dashsegments] Total fragments: 2087
[download] Destination: These guys remixed my videos... wow (LIVE STREAM)-zauGZfKosJQ.m4a
[download] 100% of 162.84MiB in 13:34
[ffmpeg] Correcting container in "These guys remixed my videos... wow (LIVE STREAM)-zauGZfKosJQ.m4a"
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:These guys remixed my videos... wow (LIVE STREAM)-zauGZfKosJQ.m4a' -c copy -f mp4 'file:These guys remixed my videos... wow (LIVE STREAM)-zauGZfKosJQ.temp.m4a'

Description

Sometimes an archived live stream which plays just fine in a browser (both audio and video) has no audio when downloaded via youtube-dl. Either there is an error and the file is zero or near-empty, or it acts like it downloads the entire thing but then when you try to play it back, it is 99% silence except for occasionally a few seconds somewhere randomly in the file... seems to change with each video. I do not have any more examples currently besides this one, as the other ones that have had problems have since been removed by the author, usually due to the audio eventually starting to appear empty in a browser as well. I am trying to archive this one too on behalf of the author before it disappears as well.

In this case, the final audio file shows up as being only 80k in size and 5 seconds long, even though youtube-dl says it took 13 minutes and downloaded 162MB.

$ ffprobe These\ guys\ remixed\ my\ videos...\ wow\ \(LIVE\ STREAM\)-zauGZfKosJQ.m4a 2>&1 | grep Duration
  Duration: 00:00:05.01, start: 0.000000, bitrate: 128 kb/s

Potentially related: #15641 which was closed without resolution.

ghost commented 4 years ago

I re-ran the above command with the added options --no-post-overwrites -k --keep-fragments --fixup never, and now it keeps the entire 170MB file, but ffprobe still shows a tiny duration:

$ ls -l These\ guys\ remixed\ my\ videos...\ wow\ \(LIVE\ STREAM\)-zauGZfKosJQ.m4a
-rw-rw-r-- 1 bp bp 170750241 Jan 27 00:53 'These guys remixed my videos... wow (LIVE STREAM)-zauGZfKosJQ.m4a'
$ ffprobe These\ guys\ remixed\ my\ videos...\ wow\ \(LIVE\ STREAM\)-zauGZfKosJQ.m4a 2>&1 | grep Duration
  Duration: 00:00:04.99, start: 0.000000, bitrate: 273638 kb/s
aurelg commented 4 years ago

I see a problem that might be related (youtube-dl 2020.03.24, archlinux, up-to-date) when downloading from https://www.france.tv/france-5/c-dans-l-air/ , e.g. this link.

When I try to download the audio only (-x flag) with the following command: youtube-dl -x https://www.france.tv/france-5/c-dans-l-air/1354929-alors-on-sort-quand-et-comment.html, the resulting audio file is a few minutes long, whereas it should be 65 minutes.

Interestingly, if I specify both -x and --format=worst to retrieve the video as well, then convert to audio only, with youtube-dl --format=worst -x https://www.france.tv/france-5/c-dans-l-air/1354929-alors-on-sort-quand-et-comment.html, the resulting audio file has the correct length.

Weird. :thinking: