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.76k stars 10.08k forks source link

is_outdated_version doesn't understand git versions of ffmpeg #28501

Open 0x9fff00 opened 3 years ago

0x9fff00 commented 3 years ago

Checklist

Verbose log

$ python -m youtube_dl -v -f hls-cmaf-full-surround-Svenska https://www.svtplay.se/video/30343650/melodifestivalen-2021/melodifestivalen-2021-deltavling-1-deltavling-1-1
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', '-f', 'hls-cmaf-full-surround-Svenska', 'https://www.svtplay.se/video/30343650/melodifestivalen-2021/melodifestivalen-2021-deltavling-1-deltavling-1-1']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2021.03.14
[debug] Git HEAD: 7e79ba7dd
[debug] Python version 3.9.2 (CPython) - Linux-5.11.7-arch1-1-x86_64-with-glibc2.33
[debug] exe versions: ffmpeg N-101655-g9f8c81efc5, ffprobe N-101655-g9f8c81efc5, rtmpdump 2.4
[debug] Proxy map: {}
[debug] Using fake IP 78.68.37.201 (SE) as X-Forwarded-For.
[SVTPlay] 30343650: Downloading webpage
[SVTPlay] jXYJ2dy: Downloading JSON metadata
[SVTPlay] jXYJ2dy: Downloading m3u8 information
[SVTPlay] jXYJ2dy: Downloading m3u8 information
[SVTPlay] jXYJ2dy: Downloading m3u8 information
[SVTPlay] jXYJ2dy: Downloading m3u8 information
[SVTPlay] jXYJ2dy: Downloading MPD manifest
[SVTPlay] jXYJ2dy: Downloading m3u8 information
[SVTPlay] jXYJ2dy: Downloading m3u8 information
[SVTPlay] jXYJ2dy: Downloading m3u8 information
[SVTPlay] jXYJ2dy: Downloading m3u8 information
[SVTPlay] jXYJ2dy: Downloading m3u8 information
[SVTPlay] jXYJ2dy: Downloading m3u8 information
[SVTPlay] jXYJ2dy: Downloading m3u8 information
[SVTPlay] jXYJ2dy: Downloading m3u8 information
[SVTPlay] jXYJ2dy: Downloading m3u8 information
[SVTPlay] jXYJ2dy: Downloading m3u8 information
[debug] Invoking downloader on 'https://svt-vod-6g.akamaized.net/d0/world/20210304/13904e14-e644-414b-9b7c-ca267c585e55/cmaf-audio-surround-0/cmaf-audio-surround-0.m3u8'
[hlsnative] Downloading m3u8 manifest
WARNING: hlsnative has detected features it does not support, extraction will be delegated to ffmpeg
[download] Destination: Deltävling 1-jXYJ2dy.mp4
[debug] ffmpeg command line: ffmpeg -y -loglevel verbose -headers 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3692.0 Safari/537.36
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip, deflate
Accept-Language: en-us,en;q=0.5
X-Forwarded-For: 78.68.37.201
' -i https://svt-vod-6g.akamaized.net/d0/world/20210304/13904e14-e644-414b-9b7c-ca267c585e55/cmaf-audio-surround-0/cmaf-audio-surround-0.m3u8 -c copy -f mp4 -bsf:a aac_adtstoasc 'file:Deltävling 1-jXYJ2dy.mp4.part'
ffmpeg version N-101655-g9f8c81efc5 Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 10.2.0 (GCC)
  configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librav1e --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-nvdec --enable-nvenc --enable-shared --enable-version3
  libavutil      56. 71.100 / 56. 71.100
  libavcodec     58.135.100 / 58.135.100
  libavformat    58. 77.100 / 58. 77.100
  libavdevice    58. 14.100 / 58. 14.100
  libavfilter     7.111.100 /  7.111.100
  libswscale      5. 10.100 /  5. 10.100
  libswresample   3. 10.100 /  3. 10.100
  libpostproc    55. 10.100 / 55. 10.100
[tcp @ 0x55730d377f00] Starting connection attempt to 79.136.61.25 port 443
[tcp @ 0x55730d377f00] Successfully connected to 79.136.61.25 port 443
[hls @ 0x55730d3739c0] Skip ('#EXT-X-VERSION:6')
[hls @ 0x55730d3739c0] Skip ('## Generated with https://github.com/google/shaka-packager version v2.4.2-c60e988-release')
[hls @ 0x55730d3739c0] HLS request for url 'https://svt-vod-6g.akamaized.net/d0/world/20210304/13904e14-e644-414b-9b7c-ca267c585e55/cmaf-audio-surround-0/cmaf-audio-surround-0-init.mp4', offset 0, playlist 0
[hls @ 0x55730d3739c0] Opening 'https://svt-vod-6g.akamaized.net/d0/world/20210304/13904e14-e644-414b-9b7c-ca267c585e55/cmaf-audio-surround-0/cmaf-audio-surround-0-init.mp4' for reading
[tcp @ 0x55730d95dc00] Starting connection attempt to 79.136.61.27 port 443
[tcp @ 0x55730d95dc00] Successfully connected to 79.136.61.27 port 443
[AVIOContext @ 0x55730d9cf100] Statistics: 765 bytes read, 0 seeks
[hls @ 0x55730d3739c0] HLS request for url 'https://svt-vod-6g.akamaized.net/d0/world/20210304/13904e14-e644-414b-9b7c-ca267c585e55/cmaf-audio-surround-0/cmaf-audio-surround-0-1.mp4', offset 0, playlist 0
[hls @ 0x55730d3739c0] Opening 'https://svt-vod-6g.akamaized.net/d0/world/20210304/13904e14-e644-414b-9b7c-ca267c585e55/cmaf-audio-surround-0/cmaf-audio-surround-0-1.mp4' for reading
[tcp @ 0x55730d95d300] Starting connection attempt to 79.136.61.99 port 443
[tcp @ 0x55730d95d300] Successfully connected to 79.136.61.99 port 443
[hls @ 0x55730d3739c0] HLS request for url 'https://svt-vod-6g.akamaized.net/d0/world/20210304/13904e14-e644-414b-9b7c-ca267c585e55/cmaf-audio-surround-0/cmaf-audio-surround-0-2.mp4', offset 0, playlist 0
[hls @ 0x55730d3739c0] Opening 'https://svt-vod-6g.akamaized.net/d0/world/20210304/13904e14-e644-414b-9b7c-ca267c585e55/cmaf-audio-surround-0/cmaf-audio-surround-0-2.mp4' for reading
[tcp @ 0x55730d9ae000] Starting connection attempt to 79.136.61.25 port 443
[tcp @ 0x55730d9ae000] Successfully connected to 79.136.61.25 port 443
Input #0, hls, from 'https://svt-vod-6g.akamaized.net/d0/world/20210304/13904e14-e644-414b-9b7c-ca267c585e55/cmaf-audio-surround-0/cmaf-audio-surround-0.m3u8':
  Duration: 01:28:10.52, start: -0.005333, bitrate: 0 kb/s
  Program 0 
    Metadata:
      variant_bitrate : 0
  Stream #0:0: Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz, 5.1(side), fltp, 448 kb/s (default)
    Metadata:
      variant_bitrate : 0
      major_brand     : isom
      minor_version   : 0
      compatible_brands: iso8mp41dashcmfc
      creation_time   : 2021-03-04T00:23:03.000000Z
    Side data:
      audio service type: main
[aac_adtstoasc @ 0x55730d9b8d80] Codec 'ac3' (86019) is not supported by the bitstream filter 'aac_adtstoasc'. Supported codecs are: aac (86018) 
Error initializing bitstream filter: aac_adtstoasc
Error initializing output stream 0:0 -- 
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
    Last message repeated 1 times
[AVIOContext @ 0x55730d9e8480] Statistics: 0 seeks, 0 writeouts
[AVIOContext @ 0x55730d9ce940] Statistics: 33732 bytes read, 0 seeks
[AVIOContext @ 0x55730d9c7fc0] Statistics: 0 bytes read, 0 seeks
[AVIOContext @ 0x55730d414b00] Statistics: 62508 bytes read, 0 seeks

ERROR: ffmpeg exited with code 1
  File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/x/youtube_dl/__main__.py", line 19, in <module>
    youtube_dl.main()
  File "/x/youtube_dl/__init__.py", line 475, in main
    _real_main(argv)
  File "/x/youtube_dl/__init__.py", line 465, in _real_main
    retcode = ydl.download(all_urls)
  File "/x/youtube_dl/YoutubeDL.py", line 2059, in download
    res = self.extract_info(
  File "/x/youtube_dl/YoutubeDL.py", line 799, in extract_info
    return self.__extract_info(url, ie, download, extra_info, process)
  File "/x/youtube_dl/YoutubeDL.py", line 806, in wrapper
    return func(self, *args, **kwargs)
  File "/x/youtube_dl/YoutubeDL.py", line 838, in __extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "/x/youtube_dl/YoutubeDL.py", line 872, in process_ie_result
    return self.process_video_result(ie_result, download=download)
  File "/x/youtube_dl/YoutubeDL.py", line 1683, in process_video_result
    self.process_info(new_info)
  File "/x/youtube_dl/YoutubeDL.py", line 1967, in process_info
    success = dl(filename, info_dict)
  File "/x/youtube_dl/YoutubeDL.py", line 1906, in dl
    return fd.download(name, info)
  File "/x/youtube_dl/downloader/common.py", line 366, in download
    return self.real_download(filename, info_dict)
  File "/x/youtube_dl/downloader/hls.py", line 78, in real_download
    return fd.real_download(filename, info_dict)
  File "/x/youtube_dl/downloader/external.py", line 63, in real_download
    self.report_error('%s exited with code %d' % (
  File "/x/youtube_dl/downloader/common.py", line 165, in report_error
    self.ydl.report_error(*args, **kargs)
  File "/x/youtube_dl/YoutubeDL.py", line 628, in report_error
    self.trouble(error_message, tb)
  File "/x/youtube_dl/YoutubeDL.py", line 590, in trouble
    tb_data = traceback.format_list(traceback.extract_stack())
$ python
Python 3.9.2 (default, Feb 20 2021, 18:40:11) 
[GCC 10.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from youtube_dl.postprocessor.ffmpeg import FFmpegPostProcessor
>>> from youtube_dl.utils import is_outdated_version
>>> ffpp = FFmpegPostProcessor()
>>> ffpp._versions
{'avprobe': False, 'avconv': False, 'ffmpeg': 'N-101655-g9f8c81efc5', 'ffprobe': 'N-101655-g9f8c81efc5'}
>>> is_outdated_version(ffpp._versions['ffmpeg'], '3.2', False)
True
>>> is_outdated_version('4.4', '3.2', False)
False

Description

When downloading an m3u8 format, there is a check which adds a bitstream filter for ffmpeg versions lower than 3.2: https://github.com/ytdl-org/youtube-dl/blob/71f47617c8845900c1a3c2da79f9f7654199fedb/youtube_dl/downloader/external.py#L324-L325 This check doesn't work properly if ffmpeg has been installed from git, as the reported version follows a different format then. As seen in the second log above, is_outdated_version returns True despite ffmpeg being compiled from the latest git version (4.4). This leads to the error in the first log, where -bsf:a aac_adtstoasc is passed to ffmpeg even though it's not needed for 4.4, which fails because the audio stream is AC3 and not AAC. If ffmpeg 4.3 is installed, the filter isn't included and the download is successful. The filter shouldn't be used for this format in ffmpeg <3.2 anyway as it's not AAC, but the SVTPlay extractor doesn't extract the acodec and the filter is added by default if it's falsey.

This issue is related to #18813

dirkf commented 3 years ago

From the linked issue, what about adding --fixup never?

Also, please post the output of ffmpeg -version for the problem build. However it might be tricky to extend the version recognition if the build process from git hides the version number that is found in the RELEASE file.

0x9fff00 commented 3 years ago

From the linked issue, what about adding --fixup never?

I still get the same error with --fixup never:

$ python -m youtube_dl -v -f hls-cmaf-full-surround-Svenska --fixup never https://www.svtplay.se/video/30343650/melodifestivalen-2021/melodifestivalen-2021-deltavling-1-deltavling-1-1
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', '-f', 'hls-cmaf-full-surround-Svenska', '--fixup', 'never', 'https://www.svtplay.se/video/30343650/melodifestivalen-2021/melodifestivalen-2021-deltavling-1-deltavling-1-1']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2021.04.07
[debug] Git HEAD: 4fb25ff5a
[debug] Python version 3.9.2 (CPython) - Linux-5.11.11-arch1-1-x86_64-with-glibc2.33
[debug] exe versions: ffmpeg N-101901-gb593abda6c, ffprobe N-101901-gb593abda6c, rtmpdump 2.4
[debug] Proxy map: {}
[debug] Using fake IP 78.71.165.56 (SE) as X-Forwarded-For.
[SVTPlay] 30343650: Downloading webpage
[SVTPlay] jXYJ2dy: Downloading JSON metadata
[SVTPlay] jXYJ2dy: Downloading m3u8 information
[SVTPlay] jXYJ2dy: Downloading m3u8 information
[SVTPlay] jXYJ2dy: Downloading m3u8 information
[SVTPlay] jXYJ2dy: Downloading m3u8 information
[SVTPlay] jXYJ2dy: Downloading MPD manifest
[SVTPlay] jXYJ2dy: Downloading m3u8 information
[SVTPlay] jXYJ2dy: Downloading m3u8 information
[SVTPlay] jXYJ2dy: Downloading m3u8 information
[SVTPlay] jXYJ2dy: Downloading m3u8 information
[SVTPlay] jXYJ2dy: Downloading m3u8 information
[SVTPlay] jXYJ2dy: Downloading m3u8 information
[SVTPlay] jXYJ2dy: Downloading m3u8 information
[SVTPlay] jXYJ2dy: Downloading m3u8 information
[SVTPlay] jXYJ2dy: Downloading m3u8 information
[SVTPlay] jXYJ2dy: Downloading m3u8 information
[debug] Invoking downloader on 'https://svt-vod-6g.akamaized.net/d0/world/20210304/13904e14-e644-414b-9b7c-ca267c585e55/cmaf-audio-surround-0/cmaf-audio-surround-0.m3u8'
[hlsnative] Downloading m3u8 manifest
WARNING: hlsnative has detected features it does not support, extraction will be delegated to ffmpeg
[download] Destination: Deltävling 1-jXYJ2dy.mp4
[debug] ffmpeg command line: ffmpeg -y -loglevel verbose -headers 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.18 Safari/537.36
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip, deflate
Accept-Language: en-us,en;q=0.5
X-Forwarded-For: 78.71.165.56
' -i https://svt-vod-6g.akamaized.net/d0/world/20210304/13904e14-e644-414b-9b7c-ca267c585e55/cmaf-audio-surround-0/cmaf-audio-surround-0.m3u8 -c copy -f mp4 -bsf:a aac_adtstoasc 'file:Deltävling 1-jXYJ2dy.mp4.part'
ffmpeg version N-101901-gb593abda6c Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 10.2.0 (GCC)
  configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librav1e --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-nvdec --enable-nvenc --enable-shared --enable-version3
  libavutil      56. 72.100 / 56. 72.100
  libavcodec     58.135.100 / 58.135.100
  libavformat    58. 78.100 / 58. 78.100
  libavdevice    58. 14.100 / 58. 14.100
  libavfilter     7.111.100 /  7.111.100
  libswscale      5. 10.100 /  5. 10.100
  libswresample   3. 10.100 /  3. 10.100
  libpostproc    55. 10.100 / 55. 10.100
[tcp @ 0x55c34b203f00] Starting connection attempt to 79.136.61.99 port 443
[tcp @ 0x55c34b203f00] Successfully connected to 79.136.61.99 port 443
[hls @ 0x55c34b1ff9c0] Skip ('#EXT-X-VERSION:6')
[hls @ 0x55c34b1ff9c0] Skip ('## Generated with https://github.com/google/shaka-packager version v2.4.2-c60e988-release')
[hls @ 0x55c34b1ff9c0] HLS request for url 'https://svt-vod-6g.akamaized.net/d0/world/20210304/13904e14-e644-414b-9b7c-ca267c585e55/cmaf-audio-surround-0/cmaf-audio-surround-0-init.mp4', offset 0, playlist 0
[hls @ 0x55c34b1ff9c0] Opening 'https://svt-vod-6g.akamaized.net/d0/world/20210304/13904e14-e644-414b-9b7c-ca267c585e55/cmaf-audio-surround-0/cmaf-audio-surround-0-init.mp4' for reading
[tcp @ 0x55c34b7ea080] Starting connection attempt to 79.136.61.89 port 443
[tcp @ 0x55c34b7ea080] Successfully connected to 79.136.61.89 port 443
[AVIOContext @ 0x55c34b84ba00] Statistics: 765 bytes read, 0 seeks
[hls @ 0x55c34b1ff9c0] HLS request for url 'https://svt-vod-6g.akamaized.net/d0/world/20210304/13904e14-e644-414b-9b7c-ca267c585e55/cmaf-audio-surround-0/cmaf-audio-surround-0-1.mp4', offset 0, playlist 0
[hls @ 0x55c34b1ff9c0] Opening 'https://svt-vod-6g.akamaized.net/d0/world/20210304/13904e14-e644-414b-9b7c-ca267c585e55/cmaf-audio-surround-0/cmaf-audio-surround-0-1.mp4' for reading
[tcp @ 0x55c34b84bf00] Starting connection attempt to 79.136.61.99 port 443
[tcp @ 0x55c34b84bf00] Successfully connected to 79.136.61.99 port 443
[hls @ 0x55c34b1ff9c0] HLS request for url 'https://svt-vod-6g.akamaized.net/d0/world/20210304/13904e14-e644-414b-9b7c-ca267c585e55/cmaf-audio-surround-0/cmaf-audio-surround-0-2.mp4', offset 0, playlist 0
[hls @ 0x55c34b1ff9c0] Opening 'https://svt-vod-6g.akamaized.net/d0/world/20210304/13904e14-e644-414b-9b7c-ca267c585e55/cmaf-audio-surround-0/cmaf-audio-surround-0-2.mp4' for reading
[tcp @ 0x55c34b2a1240] Starting connection attempt to 79.136.61.89 port 443
[tcp @ 0x55c34b2a1240] Successfully connected to 79.136.61.89 port 443
Input #0, hls, from 'https://svt-vod-6g.akamaized.net/d0/world/20210304/13904e14-e644-414b-9b7c-ca267c585e55/cmaf-audio-surround-0/cmaf-audio-surround-0.m3u8':
  Duration: 01:28:10.52, start: -0.005333, bitrate: 0 kb/s
  Program 0 
    Metadata:
      variant_bitrate : 0
  Stream #0:0: Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz, 5.1(side), fltp, 448 kb/s (default)
    Metadata:
      variant_bitrate : 0
      major_brand     : isom
      minor_version   : 0
      compatible_brands: iso8mp41dashcmfc
      creation_time   : 2021-03-04T00:23:03.000000Z
    Side data:
      audio service type: main
[aac_adtstoasc @ 0x55c34b870780] Codec 'ac3' (86019) is not supported by the bitstream filter 'aac_adtstoasc'. Supported codecs are: aac (86018) 
Error initializing bitstream filter: aac_adtstoasc
Error initializing output stream 0:0 -- 
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
    Last message repeated 1 times
[AVIOContext @ 0x55c34b858b00] Statistics: 0 seeks, 0 writeouts
[AVIOContext @ 0x55c34b84c480] Statistics: 34217 bytes read, 0 seeks
[AVIOContext @ 0x55c34b846700] Statistics: 0 bytes read, 0 seeks
[AVIOContext @ 0x55c34b793000] Statistics: 62508 bytes read, 0 seeks

ERROR: ffmpeg exited with code 1
  File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/x/youtube_dl/__main__.py", line 19, in <module>
    youtube_dl.main()
  File "/x/youtube_dl/__init__.py", line 475, in main
    _real_main(argv)
  File "/x/youtube_dl/__init__.py", line 465, in _real_main
    retcode = ydl.download(all_urls)
  File "/x/youtube_dl/YoutubeDL.py", line 2059, in download
    res = self.extract_info(
  File "/x/youtube_dl/YoutubeDL.py", line 799, in extract_info
    return self.__extract_info(url, ie, download, extra_info, process)
  File "/x/youtube_dl/YoutubeDL.py", line 806, in wrapper
    return func(self, *args, **kwargs)
  File "/x/youtube_dl/YoutubeDL.py", line 838, in __extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "/x/youtube_dl/YoutubeDL.py", line 872, in process_ie_result
    return self.process_video_result(ie_result, download=download)
  File "/x/youtube_dl/YoutubeDL.py", line 1683, in process_video_result
    self.process_info(new_info)
  File "/x/youtube_dl/YoutubeDL.py", line 1967, in process_info
    success = dl(filename, info_dict)
  File "/x/youtube_dl/YoutubeDL.py", line 1906, in dl
    return fd.download(name, info)
  File "/x/youtube_dl/downloader/common.py", line 366, in download
    return self.real_download(filename, info_dict)
  File "/x/youtube_dl/downloader/hls.py", line 78, in real_download
    return fd.real_download(filename, info_dict)
  File "/x/youtube_dl/downloader/external.py", line 63, in real_download
    self.report_error('%s exited with code %d' % (
  File "/x/youtube_dl/downloader/common.py", line 165, in report_error
    self.ydl.report_error(*args, **kargs)
  File "/x/youtube_dl/YoutubeDL.py", line 628, in report_error
    self.trouble(error_message, tb)
  File "/x/youtube_dl/YoutubeDL.py", line 590, in trouble
    tb_data = traceback.format_list(traceback.extract_stack())

Also, please post the output of ffmpeg -version for the problem build. However it might be tricky to extend the version recognition if the build process from git hides the version number that is found in the RELEASE file.

Here's the output of ffmpeg -version:

$ ffmpeg -version
ffmpeg version N-101901-gb593abda6c Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 10.2.0 (GCC)
configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librav1e --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-nvdec --enable-nvenc --enable-shared --enable-version3
libavutil      56. 72.100 / 56. 72.100
libavcodec     58.135.100 / 58.135.100
libavformat    58. 78.100 / 58. 78.100
libavdevice    58. 14.100 / 58. 14.100
libavfilter     7.111.100 /  7.111.100
libswscale      5. 10.100 /  5. 10.100
libswresample   3. 10.100 /  3. 10.100
libpostproc    55. 10.100 / 55. 10.100

Maybe the lib* versions could be used instead?

remitamine commented 3 years ago

Maybe the lib* versions could be used instead?

this seems to be a possibility, the relevent check that needs to be added is is_outdated_version(libavformat_version, '57.55.100', False).

dirkf commented 3 years ago

(crossing with the comment above) Perhaps, although it would perhaps be easier if you could stick to a released ffmpeg. I suppose there's a reason for running that version, though. It's not obvious why the git build doesn't include the release version since it would make it much easier to identify what sort of ffmpeg was built.

You could make a wrapper for ffmpeg that reports the correct version and use the --ffmpeg-location option to run that instead of the ffmpeg binary. As you have a POSIX shell, an executable script like this should report 4.4-N-101901-gb593abda6c (as it arguably should do anyway), provided that -version is the first option, which it is when called by yt-dl:

#!/bin/sh
if [ "$1" = "-version" ]; then
    printf "ffmpeg version 4.4-%s" "$(ffmpeg -version | sed '1 s/ffmpeg version //')"
    shift
    [ -z "${1+set}" ] && exit 0
fi
exec ffmpeg "$@"

After that,