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

Corrupt video after stopping (CTRL+C) a VLive Livestream download #24457

Closed
6 tasks done
Infinitay opened this issue Mar 24, 2020 · 9 comments
Closed
6 tasks done

Corrupt video after stopping (CTRL+C) a VLive Livestream download #24457

Infinitay opened this issue Mar 24, 2020 · 9 comments
Labels

Comments

@Infinitay
Copy link

Checklist

  • I'm reporting a broken site support issue
  • I've verified that I'm running youtube-dl version 2020.03.24
  • I've checked that all provided URLs are alive and playable in a browser
  • I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • I've searched the bugtracker for similar bug reports including closed ones
  • I've read bugs section in FAQ

Verbose log

<redacted-path>\extracted>youtube-dl --no-part --hls-prefer-native -f best -v https://www.vlive.tv/video/181708
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--no-part', '--hls-prefer-native', '-f', 'best', '-v', 'https://www.vlive.tv/video/181708']
[debug] Encodings: locale cp1252, fs mbcs, out cp437, pref cp1252
[debug] youtube-dl version 2020.03.24
[debug] Python version 3.4.4 (CPython) - Windows-10-10.0.18362
[debug] exe versions: ffmpeg 4.2.2, ffprobe 4.2.2
[debug] Proxy map: {}
[vlive] 181708: Downloading webpage
[vlive] 181708: Downloading live webpage
[vlive] 181708: Downloading m3u8 information
[vlive] 181708: Downloading m3u8 information
[vlive] 181708: Downloading m3u8 information
[vlive] 181708: Downloading m3u8 information
[vlive] 181708: Downloading m3u8 information
[vlive] 181708: Downloading m3u8 information
[vlive] 181708: Downloading m3u8 information
[debug] Invoking downloader on 'https://vlive-hls.akamaized.net/lip2_kr2/anmss0196/7go2udspag7frfc54rtkvlutih1wcjm4kt714z9w/4000.stream/chunklist.m3u8?__agda__=1585081714_67311b63003cad246dde5cf8965e5507'
[download] Destination: [V LIVE] 시하의 브이앱 2020-03-24 07_28-181708.mp4
[debug] ffmpeg command line: ffmpeg -y -loglevel verbose -headers "Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3628.3 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
" -i "https://vlive-hls.akamaized.net/lip2_kr2/anmss0196/7go2udspag7frfc54rtkvlutih1wcjm4kt714z9w/4000.stream/chunklist.m3u8?__agda__=1585081714_67311b63003cad246dde5cf8965e5507" -c copy -f mp4 "file:[V LIVE] 시하의 브이앱 2020-03-24 07_28-181708.mp4"
ffmpeg version 4.2.2 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 9.2.1 (GCC) 20200122
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
[tcp @ 0000028c1b6dd940] Starting connection attempt to 104.96.221.160 port 443
[tcp @ 0000028c1b6dd940] Successfully connected to 104.96.221.160 port 443
[hls @ 0000028c1b6da480] Skip ('#EXT-X-VERSION:3')
[hls @ 0000028c1b6da480] Skip ('#EXT-X-ALLOW-CACHE:NO')
[hls @ 0000028c1b6da480] Skip ('#EXT-X-DISCONTINUITY-SEQUENCE:0')
[hls @ 0000028c1b6da480] Skip ('#EXT-X-DATERANGE:ID="nmss-daterange",START-DATE="2020-03-24T11:02:39.172Z"')
[hls @ 0000028c1b6da480] Skip ('#EXT-X-PROGRAM-DATE-TIME:2020-03-24T11:28:31.172Z')
[hls @ 0000028c1b6da480] HLS request for url 'https://vlive-hls.akamaized.net/lip2_kr2/anmss0196/7go2udspag7frfc54rtkvlutih1wcjm4kt714z9w/4000.stream/4000.stream_2906024874_1585049311172_1552_0_776.ts', offset 0, playlist 0
[hls @ 0000028c1b6da480] Opening 'https://vlive-hls.akamaized.net/lip2_kr2/anmss0196/7go2udspag7frfc54rtkvlutih1wcjm4kt714z9w/4000.stream/4000.stream_2906024874_1585049311172_1552_0_776.ts' for reading
[tcp @ 0000028c1bb15c00] Starting connection attempt to 104.96.221.160 port 443
[tcp @ 0000028c1bb15c00] Successfully connected to 104.96.221.160 port 443
[hls @ 0000028c1b6da480] HLS request for url 'https://vlive-hls.akamaized.net/lip2_kr2/anmss0196/7go2udspag7frfc54rtkvlutih1wcjm4kt714z9w/4000.stream/4000.stream_3174107421_1585049313172_1554_0_777.ts', offset 0, playlist 0
[hls @ 0000028c1b6da480] Opening 'https://vlive-hls.akamaized.net/lip2_kr2/anmss0196/7go2udspag7frfc54rtkvlutih1wcjm4kt714z9w/4000.stream/4000.stream_3174107421_1585049313172_1554_0_777.ts' for reading
[tcp @ 0000028c1bd3fe80] Starting connection attempt to 104.96.221.160 port 443
[tcp @ 0000028c1bd3fe80] Successfully connected to 104.96.221.160 port 443
[h264 @ 0000028c1c0d5bc0] Reinit context to 1088x1920, pix_fmt: yuv420p
Input #0, hls, from 'https://vlive-hls.akamaized.net/lip2_kr2/anmss0196/7go2udspag7frfc54rtkvlutih1wcjm4kt714z9w/4000.stream/chunklist.m3u8?__agda__=1585081714_67311b63003cad246dde5cf8965e5507':
  Duration: N/A, start: 1552.000000, bitrate: N/A
  Program 0
    Metadata:
      variant_bitrate : 0
    Stream #0:0: Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, mono, fltp
    Metadata:
      variant_bitrate : 0
    Stream #0:1: Video: h264 (High), 1 reference frame ([27][0][0][0] / 0x001B), yuv420p(tv, bt709, left), 1080x1920 (1088x1920) [SAR 1:1 DAR 9:16], 30 fps, 30 tbr, 90k tbn, 60 tbc
    Metadata:
      variant_bitrate : 0
    Stream #0:2: Data: timed_id3 (ID3  / 0x20334449)
    Metadata:
      variant_bitrate : 0
Output #0, mp4, to 'file:[V LIVE] 시하의 브이앱 2020-03-24 07_28-181708.mp4':
  Metadata:
    encoder         : Lavf58.29.100
    Stream #0:0: Video: h264 (High), 1 reference frame (avc1 / 0x31637661), yuv420p(tv, bt709, left), 1080x1920 (0x0) [SAR 1:1 DAR 9:16], q=2-31, 30 fps, 30 tbr, 90k tbn, 90k tbc
    Metadata:
      variant_bitrate : 0
    Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp
    Metadata:
      variant_bitrate : 0
Stream mapping:
  Stream #0:1 -> #0:0 (copy)
  Stream #0:0 -> #0:1 (copy)
Press [q] to stop, [?] for help
Automatically inserted bitstream filter 'aac_adtstoasc'; args=''
[hls @ 0000028c1b6da480] HLS request for url 'https://vlive-hls.akamaized.net/lip2_kr2/anmss0196/7go2udspag7frfc54rtkvlutih1wcjm4kt714z9w/4000.stream/4000.stream_640271497_1585049315172_1556_0_778.ts', offset 0, playlist 0
[https @ 0000028c1bb14000] Opening 'https://vlive-hls.akamaized.net/lip2_kr2/anmss0196/7go2udspag7frfc54rtkvlutih1wcjm4kt714z9w/4000.stream/4000.stream_640271497_1585049315172_1556_0_778.ts' for reading
[tcp @ 0000028c1c12ff80] Starting connection attempt to 104.96.221.160 port 443/s speed= 3.7x
[tcp @ 0000028c1c12ff80] Successfully connected to 104.96.221.160 port 443
[hls @ 0000028c1b6da480] Skip ('#EXT-X-VERSION:3')
[hls @ 0000028c1b6da480] Skip ('#EXT-X-ALLOW-CACHE:NO')
[hls @ 0000028c1b6da480] Skip ('#EXT-X-DISCONTINUITY-SEQUENCE:0')
[hls @ 0000028c1b6da480] Skip ('#EXT-X-DATERANGE:ID="nmss-daterange",START-DATE="2020-03-24T11:02:39.172Z"')
[hls @ 0000028c1b6da480] Skip ('#EXT-X-PROGRAM-DATE-TIME:2020-03-24T11:28:33.172Z')
[hls @ 0000028c1b6da480] HLS request for url 'https://vlive-hls.akamaized.net/lip2_kr2/anmss0196/7go2udspag7frfc54rtkvlutih1wcjm4kt714z9w/4000.stream/4000.stream_1413112289_1585049317172_1558_0_779.ts', offset 0, playlist 0
[https @ 0000028c1bd4c800] Opening 'https://vlive-hls.akamaized.net/lip2_kr2/anmss0196/7go2udspag7frfc54rtkvlutih1wcjm4kt714z9w/4000.stream/4000.stream_1413112289_1585049317172_1558_0_779.ts' for reading
[https @ 0000028c1c129600] Opening 'https://vlive-hls.akamaized.net/lip2_kr2/anmss0196/7go2udspag7frfc54rtkvlutih1wcjm4kt714z9w/4000.stream/chunklist.m3u8?__agda__=1585081714_67311b63003cad246dde5cf8965e5507' for reading
[hls @ 0000028c1b6da480] Skip ('#EXT-X-VERSION:3')
[hls @ 0000028c1b6da480] Skip ('#EXT-X-ALLOW-CACHE:NO')
[hls @ 0000028c1b6da480] Skip ('#EXT-X-DISCONTINUITY-SEQUENCE:0')
[hls @ 0000028c1b6da480] Skip ('#EXT-X-DATERANGE:ID="nmss-daterange",START-DATE="2020-03-24T11:02:39.172Z"')
[hls @ 0000028c1b6da480] Skip ('#EXT-X-PROGRAM-DATE-TIME:2020-03-24T11:28:35.172Z')
[hls @ 0000028c1b6da480] HLS request for url 'https://vlive-hls.akamaized.net/lip2_kr2/anmss0196/7go2udspag7frfc54rtkvlutih1wcjm4kt714z9w/4000.stream/4000.stream_2200149600_1585049319172_1560_0_780.ts', offset 0, playlist 0
[https @ 0000028c1bd4c800] Opening 'https://vlive-hls.akamaized.net/lip2_kr2/anmss0196/7go2udspag7frfc54rtkvlutih1wcjm4kt714z9w/4000.stream/4000.stream_2200149600_1585049319172_1560_0_780.ts' for reading
[https @ 0000028c1c129600] Opening 'https://vlive-hls.akamaized.net/lip2_kr2/anmss0196/7go2udspag7frfc54rtkvlutih1wcjm4kt714z9w/4000.stream/chunklist.m3u8?__agda__=1585081714_67311b63003cad246dde5cf8965e5507' for reading
[hls @ 0000028c1b6da480] Skip ('#EXT-X-VERSION:3')
[hls @ 0000028c1b6da480] Skip ('#EXT-X-ALLOW-CACHE:NO')
[hls @ 0000028c1b6da480] Skip ('#EXT-X-DISCONTINUITY-SEQUENCE:0')
[hls @ 0000028c1b6da480] Skip ('#EXT-X-DATERANGE:ID="nmss-daterange",START-DATE="2020-03-24T11:02:39.172Z"')
[hls @ 0000028c1b6da480] Skip ('#EXT-X-PROGRAM-DATE-TIME:2020-03-24T11:28:37.172Z')
[hls @ 0000028c1b6da480] HLS request for url 'https://vlive-hls.akamaized.net/lip2_kr2/anmss0196/7go2udspag7frfc54rtkvlutih1wcjm4kt714z9w/4000.stream/4000.stream_496385533_1585049321172_1562_0_781.ts', offset 0, playlist 0
[https @ 0000028c1bd4c800] Opening 'https://vlive-hls.akamaized.net/lip2_kr2/anmss0196/7go2udspag7frfc54rtkvlutih1wcjm4kt714z9w/4000.stream/4000.stream_496385533_1585049321172_1562_0_781.ts' for reading
frame=  299 fps= 50 q=-1.0 size=    4864kB time=00:00:10.01 bitrate=3979.3kbits/s speed=1.67x
//// HERE I ISSUED THE CTRL+C INTERRUPT SIGNAL \\\\

Description

First and foremost, this is my first time attempting to use youtube-dl, but I have tried looking on S.O. and Google results for my issue, as well as other reported bugs and potential PRs. I did come across #21342, however after posting my experience, I realize that the issue was created in specific for YouTube, but my issue is with a download from VLive.

Upon attempting to download an on-going livestream on VLive, I issued the CTRL+C command to stop the current download so that I may view what was currently downloaded by youtube-dl. However, when I attempted to playback the download, my video players all state that the video is corrupt, both DAUM's PotPlayer and the default Windows 10 video player Movies & TV.

For what it's worth, here is what PotPlayer says under it's more info option after it told me "Can't play the media file. Unable to get video/audio data.":

PotPlayer Log
File Source (Async.)::Output

==========================
Unable to get video/audio data.
==========================


Media Type 0:
--------------------------
Unknown

[AM_MEDIA_TYPE]
  majortype: MEDIATYPE_Stream {E436EB83-524F-11CE-9F53-0020AF0BA770}
  subtype: Unknown GUID Name {08E22ADA-B715-45ED-9D20-7B87750301D4}
  formattype: TIME_FORMAT_NONE {00000000-0000-0000-0000-000000000000}
  bFixedSizeSamples: 1
  bTemporalCompression: 0
  lSampleSize: 1
  cbFormat: 0


==========================
Unable to get video/audio data.
==========================


Media Type 1:
--------------------------
Unknown

[AM_MEDIA_TYPE]
  majortype: MEDIATYPE_Stream {E436EB83-524F-11CE-9F53-0020AF0BA770}
  subtype: TIME_FORMAT_NONE {00000000-0000-0000-0000-000000000000}
  formattype: TIME_FORMAT_NONE {00000000-0000-0000-0000-000000000000}
  bFixedSizeSamples: 1
  bTemporalCompression: 0
  lSampleSize: 1
  cbFormat: 0

As for Windows' Movies & TV:

Windows Log
Can't play

This file isn't playable. That might be because the file type is unsupported, the file extension is incorrect, or the file is corrupt.

0xc00d36c4

Here is the output of ffprobe for the video file, though for what it's worth, it seems as if the error output is the same for all the corrupted videos.

<redacted-path>\extracted>ffprobe "[V LIVE] 시하의 브이앱 2020-03-24 07_28-181708.mp4"
ffprobe version 4.2.2 Copyright (c) 2007-2019 the FFmpeg developers
  built with gcc 9.2.1 (GCC) 20200122
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 000002494d3ecf00] moov atom not found
[V LIVE] 시하의 브이앱 2020-03-24 07_28-181708.mp4: Invalid data found when processing input
@dstftw
Copy link
Collaborator

dstftw commented Mar 24, 2020

Do not hit Ctrl+C multiple times.

@dstftw dstftw closed this as completed Mar 24, 2020
@dstftw dstftw added the invalid label Mar 24, 2020
@Infinitay
Copy link
Author

I saw other posts of hitting CTRL+C just one time, as you suggested; however, I only hit it once, hence this issue report.

@dstftw
Copy link
Collaborator

dstftw commented Mar 24, 2020

Then report it to ffmpeg.

@Infinitay
Copy link
Author

My apologies, I assumed it was an issue with youtube-dl directly. I will go ahead and report it to them.

Thank you.

@Infinitay
Copy link
Author

Infinitay commented Mar 24, 2020

For what it's worth, in case anyone also encounters my problem, using the --hls-use-mpegts argument solved my issue.
ie. youtube-dl --no-part --hls-use-mpegts -f best "https://www.vlive.tv/video/181725"

For some reason the neither using the native downloader --hls-prefer-native (which is what I initially used as you can see from my logs above) nor using ffmpegs downloader --hls-prefer-ffmpeg worked and corrupted the file.

@Infinitay
Copy link
Author

Finally created the issue over on ffmpeg: https://trac.ffmpeg.org/ticket/8580

I will try to remember to relay any additional information in hopes of helping anyone else with my issue.

Though a question that was raised while writing up the report for ffmpeg is: is this really a ffmpeg issue if --hls-prefer-native didn't work either? I suppose the reason it is a bug of ffmpeg is because of the post processing of --no-part, outputting the resulting file as a .mp4. Though, again, begs the question as to why --hls-use-mpegts doesn't result in this bug and can view the video perfectly fine.

@Infinitay
Copy link
Author

Infinitay commented Mar 24, 2020

Taken straight from the bug report on ffmpeg:

As per the ffmpeg log, ffmpeg was killed abruptly, which prevented ffmpeg from flushing out the moov box to the output file. When ffmpeg directly receives a single SIGINT, it will print at the end Exiting normally, received signal 2.. I suspect the SIGINT is received by yt-dl which does not relay it to ffmpeg but kills it, in which case, ffmpeg won't wait for the output trailer to be written. But this is a guess.

Followed by the closing of the report by mentioning

Does not look like an issue that can be fixed in FFmpeg.


Back to square one... I ask that this may be re-opened or at the least a second look at this issue. Sure, there is a work around, but a bug seems to exist nonetheless.

I suppose the reason why --hls-use-mpegts works is because of how the file is written in order to allow it to allowing to play the video while downloading as youtube-dl states. Which I guess both --hls-prefer-native and --hls-prefer-ffmpeg waits until data stream is complete (stream ends/video finishes downloading) before writing the data/transcoding the file to be able to be played...?

@seren
Copy link

seren commented Apr 28, 2020

This does seem to be an issue with signal handling within youtube-dl rather than an ffmpeg bug. As such this report should probably be reopened and the troubleshooting from Infinitay re-examined. Other users are encountering this issue as well it seems: #21342

@Infinitay
Copy link
Author

Looking forward to any updates as just as I said previously, YTDL directed me to ffmpeg claiming the issue is on their end, but ffmpeg redirected me saying there is an issue on how [YTDL] is handling signals

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

No branches or pull requests

3 participants