ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites

Home Page:http://ytdl-org.github.io/youtube-dl/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Youtube-dl can't merge VP9+Opus youtube videos

dkoao opened this issue · comments

commented

Checklist

  • I'm reporting a broken site support
  • I've verified that I'm running youtube-dl version 2021.01.24.1
  • 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 issues including closed ones

Verbose log

youtube-dl -v --abort-on-unavailable-fragment -f (bestvideo[vcodec=vp9])+(bestaudio[acodec=opus]) https://youtu.be/g6zva0stnOY --no-continue

[debug] System config: []                                                          
[debug] User config: []                                                            
[debug] Custom config: []                                                          
[debug] Command-line args: ['-v', '--abort-on-unavailable-fragment', '-f', '(bestvideo[vcodec=vp9])+(bestaudio[acodec=opus])', 'https://youtu.be/g6zva0stnOY', '--no-continue']   
                                                                       
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8  
                 
[debug] youtube-dl version 2021.01.24.1          
                                  
[debug] Python version 3.8.7 (CPython) - Linux-5.10.11-0-lts-x86_64-with           

[debug] exe versions: ffmpeg 4.3.1, ffprobe 4.3.1                                  

[debug] Proxy map: {}                                                              
[youtube] g6zva0stnOY: Downloading webpage                                         
[youtube] g6zva0stnOY: Downloading MPD manifest                                    
[debug] Invoking downloader on [REDACTED]

[dashsegments] Total fragments: 280                                                
[download] Destination: المحاضرة الثانية _ الثرموداينمك _ الجزء الثاني 2021-g6zva0stnOY.f302.webm                                                                     
[download] 100% of 417.83MiB in 24:16                                              
[debug] Invoking downloader on [REDACTED]
[dashsegments] Total fragments: 157
[download] Destination: المحاضرة الثانية _ الثرموداينمك _ الجزء الثاني 2021-g6zva0stnOY.f251.webm
[download] 100% of 22.60MiB in 00:36
[ffmpeg] Merging formats into "المحاضرة الثانية _ الثرموداينمك _ الجزء الثاني 2021-g6zva0stnOY.webm"
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:المحاضرة الثانية _ الثرموداينمك _ الجزء الثاني 2021-g6zva0stnOY.f302.webm' -i 'file:المحاضرة الثانية _ الثرموداينمك _ الجزء الثاني 2021-g6zva0stnOY.f251.webm' -c copy -map 0:v:0 -map 1:a:0 'file:المحاضرة الثانية _ الثرموداينمك _ الجزء الثاني 2021-g6zva0stnOY.temp.webm'
ERROR: Conversion failed!
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py", line 2102, in post_process
    files_to_delete, info = pp.run(info)
  File "/usr/lib/python3.8/site-packages/youtube_dl/postprocessor/ffmpeg.py", line 523, in run
    self.run_ffmpeg_multiple_files(info['__files_to_merge'], temp_filename, args)
  File "/usr/lib/python3.8/site-packages/youtube_dl/postprocessor/ffmpeg.py", line 235, in run_ffmpeg_multiple_files
    raise FFmpegPostProcessorError(msg)
youtube_dl.postprocessor.ffmpeg.FFmpegPostProcessorError: Conversion failed!

FFmpeg gives me the following error when I run the command mentioned in the above output manually:

[webm @ 0x7fe94ccf40c0] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 5620 >= 5600 av_interleaved_write_frame(): Invalid argument

I've tried to re-download it multiple times and the issue persists. Other videos can be merged fine, so it seems like this is a problem with this particular video.

Hi, I can confirm that there is no problem with this specific video, as I ran the command with no issues using Python 2.7.12, ffmpeg 2.8.17, and ffprobe 2.8.17. I'll try to reproduce the issue on a system with closer specifications to yours.

Quick update: I was able to reproduce the error on a different system with both Python 2.7.16 and 3.8.7, and ffmpeg, ffprobe 4.1.6-1. I'm going to try again with the same version of ffmpeg as I used before to see whether the ffmpeg version is the cause of this.

I was unable to reproduce the issue on a different system with ffmpeg 2.8.17, leading me to believe the issue lies somewhere with the version differences.

So this is is probably an issue in ffmpeg >= 3?

Potentially. I sort of put this off hoping others with different versions of ffmpeg could test this so we could track down which version was the earliest where this doesn't work.

Experienced this conversion failure error on youtube-dl 2021.03.03 (latest) with ffmpeg 2020-08-31 (last build from Zeranoe) and Python 3.4.4 on W10.

After downloading a VP9 video stream (303) + Opus audio stream (251) of this. Failed to combine the streams.

ERROR: Conversion failed!
Traceback (most recent call last):
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpvjygsik_\build\youtube_dl\YoutubeDL.py", line
2102, in post_process
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpvjygsik_\build\youtube_dl\postprocessor\ffmpeg
.py", line 523, in run
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpvjygsik_\build\youtube_dl\postprocessor\ffmpeg
.py", line 235, in run_ffmpeg_multiple_files
youtube_dl.postprocessor.ffmpeg.FFmpegPostProcessorError: Conversion failed!
commented

I am experiencing this on and off. It's at random with itags for video 302 and 303 plus audio 251.

Y:\youtube-dl>youtube-dl --cookies cookies.txt --download-archive "deltrons_hqv5vp9.log" -i --add-metadata --embed-thumbnail -o "deltron - Videos/%(title)s - %(id)s.%(ext)s" -f --merge-output-format --format (337/315/313/336/308/271/335/303/248/334/302/247/333/244/332/243/331/242/330/278/305/266/304/264/137/136/135/134/133/160)+(251/bestaudio) -x -k --write-description --write-info-json --cache-dir "Z:\cache" --sleep-interval 4 --max-sleep-interval 9 --verbose --fragment-retries 100 https://www.youtube.com/watch?v=MakTbhIZ5zo
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--cookies', 'cookies.txt', '--download-archive', 'deltrons_hqv5vp9.log', '-i', '--add-metadata', '--embed-thumbnail', '-o', 'deltron - Videos/%(title)s - %(id)s.%(ext)s', '-f', '--merge-output-format', '--format', '(337/315/313/336/308/271/335/303/248/334/302/247/333/244/332/243/331/242/330/278/305/266/304/264/137/136/135/134/133/160)+(251/bestaudio)', '-x', '-k', '--write-description', '--write-info-json', '--cache-dir', 'Z:\\cache', '--sleep-interval', '4', '--max-sleep-interval', '9', '--verbose', '--fragment-retries', '100', 'https://www.youtube.com/watch?v=MakTbhIZ5zo']
[debug] Encodings: locale cp1252, fs mbcs, out cp437, pref cp1252
[debug] youtube-dl version 2021.04.07
[debug] Python version 3.4.4 (CPython) - Windows-10-10.0.19041
[debug] exe versions: ffmpeg 2021-02-16-git-8331eb058d-full_build-www.gyan.dev, ffprobe 2021-02-16-git-8331eb058d-full_build-www.gyan.dev
[debug] Proxy map: {}
[youtube] MakTbhIZ5zo: Downloading webpage
[youtube] MakTbhIZ5zo: Downloading MPD manifest
[info] Writing video description to: deltron - Videos\LIGHTSKINJOHN - only - MakTbhIZ5zo.description
[info] Writing video description metadata as JSON to: deltron - Videos\LIGHTSKINJOHN - only - MakTbhIZ5zo.info.json
[youtube] MakTbhIZ5zo: Downloading thumbnail ...
[youtube] MakTbhIZ5zo: Writing thumbnail to: deltron - Videos\LIGHTSKINJOHN - only - MakTbhIZ5zo.jpg
[debug] Invoking downloader on 'https://manifest.googlevideo.com/api/manifest/dash/expire/1617835103/ei/_99tYIT4BozRigSNySg/ip/2601%3A246%3A100%3Aed%3A1c13%3A81e7%3Ae025%3A2467/id/31a9136e1219e73a/source/youtube/requiressl/yes/playback_host/r1---sn-vgqsrnll.googlevideo.com/mh/Sl/mm/31%2C26/mn/sn-vgqsrnll%2Csn-p5qs7nee/ms/au%2Conr/mv/m/mvi/1/pl/30/hfr/all/ctier/A/as/fmp4_audio_clear%2Cwebm_audio_clear%2Cwebm2_audio_clear%2Cfmp4_sd_hd_clear%2Cwebm2_sd_hd_clear/pfa/5/initcwndbps/1758750/hightc/yes/vprv/1/mt/1617812764/fvip/1/keepalive/yes/fexp/24001373%2C24007246/itag/0/sparams/expire%2Cei%2Cip%2Cid%2Csource%2Crequiressl%2Chfr%2Cctier%2Cas%2Cpfa%2Chightc%2Cvprv%2Citag/sig/AOq0QJ8wRgIhAM04WRMu-r3X4O6DsJ6V2J8EhEBc1EZnC6NQx08Rlb4bAiEAlC9nP_f64mY94XLkXAmKTzG1PNjF1T3Ue3veHGQBP2A%3D/lsparams/playback_host%2Cmh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps/lsig/AG3C_xAwRgIhALeDU48dVP5-Glon7lJJ_nnOU5T075_Mrz9dd3wHctGOAiEAkIeNJb2XKOvXwqcHiJ93i-xH8iFiXUsB1Zkn_4yMAdc%3D'
[download] deltron - Videos\LIGHTSKINJOHN - only - MakTbhIZ5zo.f302.webm has already been downloaded
[download] 100% of 12.23MiB
[debug] Invoking downloader on 'https://r1---sn-vgqsrnll.googlevideo.com/videoplayback?expire=1617835103&ei=_99tYIT4BozRigSNySg&ip=2601%3A246%3A100%3Aed%3A1c13%3A81e7%3Ae025%3A2467&id=o-ANILf1kO3YGr-iUpo36fRs7q3EyY3jax2qz5xBR-Dw99&itag=251&source=youtube&requiressl=yes&mh=Sl&mm=31%2C26&mn=sn-vgqsrnll%2Csn-p5qs7nee&ms=au%2Conr&mv=m&mvi=1&pl=30&ctier=A&pfa=5&initcwndbps=1758750&hightc=yes&vprv=1&mime=audio%2Fwebm&ns=qHuTDgJ0OORuqcfJmG-h-RAF&gir=yes&clen=1524583&otfp=1&dur=86.401&lmt=1564102915084376&mt=1617812764&fvip=1&keepalive=yes&fexp=24001373%2C24007246&c=WEB&n=PFIRoG_6UsFUxCyE&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cctier%2Cpfa%2Chightc%2Cvprv%2Cmime%2Cns%2Cgir%2Cclen%2Cotfp%2Cdur%2Clmt&sig=AOq0QJ8wRQIgD-hS0suqwMkewJsa009Wqe61C3uV8_Fq9PD1eTcO4FACIQDK4KsK8hiuEzp2Vzx6p5dWk0ZgrgJWDVq7b56rXWwlXg%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRAIgK3xBpUIFsgaWXDZMsSyhoCJCB6nAEIrU1PrDwsaD54oCIF1XmHk2bIJiD_zmMwsLBoBtjIgeUTainxWbxD6_Ce_b'
[download] deltron - Videos\LIGHTSKINJOHN - only - MakTbhIZ5zo.f251.webm has already been downloaded
[download] 100% of 1.45MiB
[ffmpeg] Merging formats into "deltron - Videos\LIGHTSKINJOHN - only - MakTbhIZ5zo.webm"
[debug] ffmpeg command line: ffmpeg -y -loglevel "repeat+info" -i "file:deltron - Videos\LIGHTSKINJOHN - only - MakTbhIZ5zo.f302.webm" -i "file:deltron - Videos\LIGHTSKINJOHN - only - MakTbhIZ5zo.f251.webm" -c copy -map "0:v:0" -map "1:a:0" "file:deltron - Videos\LIGHTSKINJOHN - only - MakTbhIZ5zo.temp.webm"
ERROR: Conversion failed!
Traceback (most recent call last):
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmp5qwpsrl8\build\youtube_dl\YoutubeDL.py", line 2106, in post_process
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmp5qwpsrl8\build\youtube_dl\postprocessor\ffmpeg.py", line 523, in run
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmp5qwpsrl8\build\youtube_dl\postprocessor\ffmpeg.py", line 235, in run_ffmpeg_multiple_files
youtube_dl.postprocessor.ffmpeg.FFmpegPostProcessorError: Conversion failed!

[debug] ffmpeg command line: ffprobe -show_streams "file:deltron - Videos\LIGHTSKINJOHN - only - MakTbhIZ5zo.webm"
ERROR: WARNING: unable to obtain file audio codec with ffprobe
Traceback (most recent call last):
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmp5qwpsrl8\build\youtube_dl\YoutubeDL.py", line 2106, in post_process
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmp5qwpsrl8\build\youtube_dl\postprocessor\ffmpeg.py", line 274, in run
youtube_dl.utils.PostProcessingError: WARNING: unable to obtain file audio codec with ffprobe

[ffmpeg] Adding metadata to 'deltron - Videos\LIGHTSKINJOHN - only - MakTbhIZ5zo.webm'
ERROR: [WinError 2] The system cannot find the file specified: 'deltron - Videos\\LIGHTSKINJOHN - only - MakTbhIZ5zo.webm'
Traceback (most recent call last):
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmp5qwpsrl8\build\youtube_dl\YoutubeDL.py", line 806, in wrapper
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmp5qwpsrl8\build\youtube_dl\YoutubeDL.py", line 838, in __extract_info
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmp5qwpsrl8\build\youtube_dl\YoutubeDL.py", line 872, in process_ie_result
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmp5qwpsrl8\build\youtube_dl\YoutubeDL.py", line 1683, in process_video_result
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmp5qwpsrl8\build\youtube_dl\YoutubeDL.py", line 2041, in process_info
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmp5qwpsrl8\build\youtube_dl\YoutubeDL.py", line 2106, in post_process
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmp5qwpsrl8\build\youtube_dl\postprocessor\ffmpeg.py", line 509, in run
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmp5qwpsrl8\build\youtube_dl\postprocessor\ffmpeg.py", line 210, in run_ffmpeg_multiple_files
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmp5qwpsrl8\build\youtube_dl\postprocessor\ffmpeg.py", line 210, in <genexpr>
FileNotFoundError: [WinError 2] The system cannot find the file specified: 'deltron - Videos\\LIGHTSKINJOHN - only - MakTbhIZ5zo.webm'


Y:\youtube-dl>

This is the latest version:

Y:\youtube-dl>youtube-dl --version
2021.04.07

From some testing, I can confirm this is a ffmpeg issue. 3.0.1 is the last version I've found where this doesnot happen

commented

What would be the best way to contact the ffmpeg team about it/describe the issue?

ffmpeg provided by Ubuntu's default repository have same problem. btw this should be reported to ffmpeg devs tho

ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.3.0-10ubuntu2)
  configuration: --prefix=/usr --extra-version=1ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  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
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Missing argument for option 'v'.
Error splitting the argument list: Invalid argument

Edit: transcoding have worked, while copy doesn't

commented

I joined ffmpeg's mailing list, but they don't want to investigate unless the ffmpeg command used is provided.

> ffmpeg version 4.2.4-1ubuntu0.1 Copyright

I don't see any indication for an issue that can be fixed in FFmpeg, if
you disagree please test current FFmpeg git head and provide the
failing ffmpeg (!) command line together with the complete, uncut
console output if you request support here.

This is frustrating. If any of the youtube-dl devs reads this, please contact ffmpeg since it looks like they're not going to fix this on their end.

Does anyone have the ffmpeg command that youtube-dl would use to merge 302 or 303 + 251?

@mechalincoln
This will appear if you run with -v flag.

ffmpeg -y -loglevel "repeat+info" -i "file:deltron - Videos\LIGHTSKINJOHN - only - MakTbhIZ5zo.f302.webm" -i "file:deltron - Videos\LIGHTSKINJOHN - only - MakTbhIZ5zo.f251.webm" -c copy -map "0:v:0" -map "1:a:0" "file:deltron - Videos\LIGHTSKINJOHN - only - MakTbhIZ5zo.temp.webm"
commented

Thank you for the prompt response @nao20010128nao . I will relay this to them.

This was the output:

Y:\youtube-dl>ffmpeg -y -loglevel "repeat+info" -i "file:deltron - Videos\LIGHTSKINJOHN - only - MakTbhIZ5zo.f302.webm" -i "file:deltron - Videos\LIGHTSKINJOHN - only - MakTbhIZ5zo.f251.webm" -c copy -map "0:v:0" -map "1:a:0" "file:deltron - Videos\LIGHTSKINJOHN - only - MakTbhIZ5zo.temp.webm"
ffmpeg version 2021-02-16-git-8331eb058d-full_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 10.2.0 (Rev6, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-libsnappy --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libglslang --enable-vulkan --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
  libavutil      56. 65.100 / 56. 65.100
  libavcodec     58.123.100 / 58.123.100
  libavformat    58. 67.100 / 58. 67.100
  libavdevice    58. 12.100 / 58. 12.100
  libavfilter     7.107.100 /  7.107.100
  libswscale      5.  8.100 /  5.  8.100
  libswresample   3.  8.100 /  3.  8.100
  libpostproc    55.  8.100 / 55.  8.100
Input #0, matroska,webm, from 'file:deltron - Videos\LIGHTSKINJOHN - only - MakTbhIZ5zo.f302.webm':
  Metadata:
    encoder         : google/video-file
    http://youtube.com/streaming/otf/durations/112015: Segment-Count: 17
                    : Segment-Durations-Ms: 5339,5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),901,
                    :
                    :
  Duration: N/A, start: 0.000000, bitrate: N/A
  Stream #0:0(eng): Video: vp9 (Profile 0), yuv420p(tv, bt709/unknown/unknown), 1280x720, SAR 1:1 DAR 16:9, 59.94 fps, 59.94 tbr, 1k tbn, 1k tbc (default)
Input #1, matroska,webm, from 'file:deltron - Videos\LIGHTSKINJOHN - only - MakTbhIZ5zo.f251.webm':
  Metadata:
    encoder         : google/video-file
  Duration: 00:01:26.40, start: -0.007000, bitrate: 141 kb/s
  Stream #1:0(eng): Audio: opus, 48000 Hz, stereo, fltp (default)
Output #0, webm, to 'file:deltron - Videos\LIGHTSKINJOHN - only - MakTbhIZ5zo.temp.webm':
  Metadata:
    http://youtube.com/streaming/otf/durations/112015: Segment-Count: 17
                    : Segment-Durations-Ms: 5339,5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),901,
                    :
                    :
    encoder         : Lavf58.67.100
  Stream #0:0(eng): Video: vp9 (Profile 0), yuv420p(tv, bt709/unknown/unknown), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 59.94 fps, 59.94 tbr, 1k tbn, 1k tbc (default)
  Stream #0:1(eng): Audio: opus, 48000 Hz, stereo, fltp (default)
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #1:0 -> #0:1 (copy)
Press [q] to stop, [?] for help
[webm @ 000002372e6c47c0] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 5355 >= 5339
av_interleaved_write_frame(): Invalid argument
frame=  323 fps=0.0 q=-1.0 Lsize=     906kB time=00:00:05.36 bitrate=1384.3kbits/s speed=61.2x
video:825kB audio:89kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Conversion failed!

Y:\youtube-dl>
commented

One of the developers replied with this:

I can reproduce the issue with the following command:
$ ffmpeg -i LIGHTSKINJOHN\ -\ only-MakTbhIZ5zo.f302.webm -c copy out.webm

The issue is not reproducible with "-ss 6", I don't know if the issue
is in the original
YT source, in the way it is downloaded or in FFmpeg.

@mechalincoln Can you give a link to the ffmpeg issue you opened?

commented

@mechalincoln Can you give a link to the ffmpeg issue you opened?

@pukkandan I started a thread in their mailing list, since their bug report requirements are stringent and a bit beyond my skill level:

https://ffmpeg.org/bugreports.html

I figured it was more expedient to report the issue and get that done than set up youtube-dl on a linux box, since I usually use it on Windows.

Here is an archive of their mailing list for April of this year:

http://ffmpeg.org/pipermail/ffmpeg-user/2021-April/date.html

The subject line I used is "[FFmpeg-user] Issue affecting ffmpeg and youtube-dl".

This was the message where the developer replied with the above:

http://ffmpeg.org/pipermail/ffmpeg-user/2021-April/052736.html

I wish they used something other than an antiquated mailing list, but this is OG open source so whatever works for them.

commented

Another developer added this:

Please try setts bitstream filter.

It is specifically designed for such videos.

Actually I tested setts bitstream filter with broken youtube files.

I have opened an issue: https://trac.ffmpeg.org/ticket/9187#ticket
Lets see what happens

Please try setts bitstream filter.

Doesn't work atleast without any parameters and I have no idea what params to use

$ ffmpeg -y -i "file:303.webm" -i "file:251.webm" -c copy -bsf:v setts "file:out.mkv"
ffmpeg version 2021-04-11-git-309e3cc15c-full_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 10.2.0 (Rev6, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libglslang --enable-vulkan --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
  libavutil      56. 72.100 / 56. 72.100
  libavcodec     58.136.101 / 58.136.101
  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
Input #0, matroska,webm, from 'file:303.webm':
  Metadata:
    encoder         : google/video-file
    http://youtube.com/streaming/otf/durations/112015: Segment-Count: 54
                    : Segment-Durations-Ms: 5339,5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),533
                    :
                    :
  Duration: N/A, start: 0.000000, bitrate: N/A
  Stream #0:0(eng): Video: vp9 (Profile 0), yuv420p(tv, bt709/unknown/unknown), 1920x1010, SAR 1:1 DAR 192:101, 59.94 fps, 59.94 tbr, 1k tbn, 1k tbc (default)
Input #1, matroska,webm, from 'file:251.webm':
  Metadata:
    encoder         : google/video-file
  Duration: 00:04:46.56, start: -0.007000, bitrate: 92 kb/s
  Stream #1:0(eng): Audio: opus, 48000 Hz, stereo, fltp (default)
Output #0, matroska, to 'file:out.mkv':
  Metadata:
    http://youtube.com/streaming/otf/durations/112015: Segment-Count: 54
                    : Segment-Durations-Ms: 5339,5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),533
                    :
                    :
    encoder         : Lavf58.78.100
  Stream #0:0(eng): Video: vp9 (Profile 0) (VP90 / 0x30395056), yuv420p(tv, bt709/unknown/unknown), 1920x1010 [SAR 1:1 DAR 192:101], q=2-31, 59.94 fps, 59.94 tbr, 1k tbn, 1k tbc (default)
  Stream #0:1(eng): Audio: opus ([255][255][255][255] / 0xFFFFFFFF), 48000 Hz, stereo, fltp (default)
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #1:0 -> #0:1 (copy)
Press [q] to stop, [?] for help
[matroska @ 000001e9e68b3440] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 5355 >= 5339
av_interleaved_write_frame(): Invalid argument
frame=  323 fps=0.0 q=-1.0 Lsize=     472kB time=00:00:05.36 bitrate= 721.1kbits/s speed= 759x
video:459kB audio:63kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Conversion failed!
commented

Thank you. I appreciate it, since I'm not getting far with their mailing list.

@pukkandan:

I have unearthed my archive of (many) ffmpeg-win32 builds and conducted some tests:
the last build (in my archive) with which muxing succeeds is
ffmpeg-n3.1-dev-526-N-78989-git-20160310-gcaeed04
while the first with which it fails is
ffmpeg-n3.1-dev-1443-N-79906-git-20160510-gc8c14d0

This is not much, but it narrows down the culprit change to within 917 commits, during a time-frame of two months (Mar 10th to May 10th 2016).

In the working builds, as is also obvious in the log inside your ffmpeg ticket, the matroska muxer identifies the discrepancy in DTS (decoding time stamp), but proceeds to perform an auto-correction (while issuing a warning doing so):

Non-monotonous DTS in output stream 0:0; previous: 5355, current: 5339; changing to 5355. This may result in incorrect timestamps in the output file.

(in yellow letters), which lets the muxing complete successfully. 👍

In the non-working builds, the matroska muxer identifies the DTS discrepancy, does not auto-correct DTS and, ultimately, fails

Application provided invalid, non monotonically increasing dts to muxer in stream 0: 5355 >= 5339
av_interleaved_write_frame(): Invalid argument

(in red letters), having only produced a partial mux, sized ca. 471 KiB (length ca. 5s). 😞

The FFmpeg devs closed the issue [ticket 9187] reported by @pukkandan, labeling it as a duplicate of

Cannot copy vp9 stream from webm to mp4 [ticket 9086]

OTOH, in original ticket 9086 they're hinting it's actually yt-dl's fault, i.e. somewhere inside its DASH downloader code that concatenates DASH segments to the resultant *.f303.webm file...

A case of the "Which came first: the chicken or the egg?" riddle, if you ask me... 😄

I have unearthed my archive of (many) ffmpeg-win32 builds and conducted some tests:

@Vangelis66 I recommend posting your findings on either of the issues

OK, I think I may have made some progress, the findings of which, sadly, won't apply to the vast majority of yt-dl users... 😢
FTR, I am on Windows Vista SP2 32-bit, it is currently extremely hard for me to find
1: recent 32-bit ffmpeg compiles, as all of the ffmpeg Windows-binary repos (linked to in the official ffmpeg site) now offer 64-bit compiles exclusively... 💢
2: recent 32-bit ffmpeg builds that have been compiled with appropriate compiler flags to target Vista (NT 6.0) as the minimum WinOS; FTR, the ffmpeg source still supports fully NT 6.0 (but some third party libs don't - others [e.g. libx265] need special compatibility flags to be set at build time) ... Many thanks to @AnimMouse for his Vista-compatible 32-bit ffmpeg builds - my "progress" in this issue wouldn't be possible without his builds 👍 .

Now, to the point:

@mechalincoln wrote:

Another developer added this:

Please try setts bitstream filter.
It is specifically designed for such videos.

@pukkandan wrote:

Please try setts bitstream filter.

Doesn't work, at least without any parameters
and I have no idea what params to use

The first thing is, that the "setts bitstream filter" is a very recent addition to FFmpeg code; I first conducted my experiments with a ffmpeg build version n4.3.2, and that filter was missing there! But, it is present in latest stable n4.4 release:

ffmpeg -hide_banner -bsfs =>

Bitstream filters:
aac_adtstoasc
av1_frame_merge
av1_frame_split
av1_metadata
chomp
dump_extra
dca_core
eac3_core
extract_extradata
filter_units
h264_metadata
h264_mp4toannexb
h264_redundant_pps
hapqa_extract
hevc_metadata
hevc_mp4toannexb
imxdump
mjpeg2jpeg
mjpegadump
mp3decomp
mpeg2_metadata
mpeg4_unpack_bframes
mov2textsub
noise
null
opus_metadata
pcm_rechunk
prores_metadata
remove_extra
setts
text2movsub
trace_headers
truehd_core
vp9_metadata
vp9_raw_reorder
vp9_superframe
vp9_superframe_split

Documentation for that new bsf is provided in

https://ffmpeg.org/ffmpeg-bitstream-filters.html#setts

The syntax for bsfs is documented in

https://ffmpeg.org/ffmpeg-bitstream-filters.html#Description

In previous logs of this thread, muxing fails because of discrepancies in the DTS of the input video file (formats -f=302|303) ; I first fetched the two elementary streams by issuing:

youtube-dl --console-title -c --no-part --fixup never -f 302 "W9mNLFseTT4" -o VP9_674p60.webm

youtube-dl --console-title -c --no-part --fixup never -f 251 "W9mNLFseTT4" -o opus96k.webm

... and after some brief experimentation, I achieved successful muxing to a WEBM container, with FFmpeg-n4.4, by issuing:

ffmpeg -i "VP9_674p60.webm" -i "opus96k.webm" -c copy -bsf:v setts=dts=0 "VP9+opus.webm" =>

ffmpeg version n4.4-ffmpeg-windows-build-helpers Copyright (c) 2000-2021 the FFm
peg developers
  built with gcc 10.2.0 (GCC)
(configuration redacted, for brevity)
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
Input #0, matroska,webm, from 'VP9_674p60.webm':
  Metadata:
    encoder         : google/video-file
    http://youtube.com/streaming/otf/durations/112015: Segment-Count: 54
                    : Segment-Durations-Ms: 5339,5338,5339(r=1),5338,5339(r=1),5
338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5
339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r
=1),5338,5339(r=1),5338,5339(r=1),533
                    :
                    :
  Duration: N/A, start: 0.000000, bitrate: N/A
  Stream #0:0(eng): Video: vp9 (Profile 0), yuv420p(tv, bt709/unknown/unknown),
1280x674, SAR 1:1 DAR 640:337, 59.94 fps, 59.94 tbr, 1k tbn, 1k tbc (default)
Input #1, matroska,webm, from 'opus96k.webm':
  Metadata:
    encoder         : google/video-file
  Duration: 00:04:46.56, start: -0.007000, bitrate: 92 kb/s
  Stream #1:0(eng): Audio: opus, 48000 Hz, stereo, fltp (default)
Output #0, webm, to 'VP9+opus.webm':
  Metadata:
    http://youtube.com/streaming/otf/durations/112015: Segment-Count: 54
                    : Segment-Durations-Ms: 5339,5338,5339(r=1),5338,5339(r=1),5
338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5
339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r
=1),5338,5339(r=1),5338,5339(r=1),533
                    :
                    :
    encoder         : Lavf58.76.100
  Stream #0:0(eng): Video: vp9 (Profile 0), yuv420p(tv, bt709/unknown/unknown),
1280x674 [SAR 1:1 DAR 640:337], q=2-31, 59.94 fps, 59.94 tbr, 1k tbn, 1k tbc (de
fault)
  Stream #0:1(eng): Audio: opus, 48000 Hz, stereo, fltp (default)
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #1:0 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame=    1 fps=0.0 q=-1.0 size=       1kB time=00:00:00.00 bitrate=8032.0kbits/
frame=17177 fps=0.0 q=-1.0 size=    6400kB time=00:03:01.30 bitrate= 289.2kbits/
[webm @ 08905680] Starting new cluster due to timestamp
frame=17177 fps=0.0 q=-1.0 Lsize=    9734kB time=00:04:46.54 bitrate= 278.3kbits
/s speed= 472x
video:6403kB audio:3122kB subtitle:0kB other streams:0kB global headers:0kB muxi
ng overhead: 2.192095%

MediaInfo Log of produced file:
VP9+opus.webm.txt

However, the only software player on my system that produces a trouble-free playback of the resultant webm file is the mpv-based SMPlayer:

smp

YMMV, of course, especially on systems (Win10) with VP9 hardware decoding...
So, we're getting there, but not currently THERE...

@pukkandan : I don't think the FFmpeg people would engage further in this...
@mechalincoln: Could you revisit the ffmpeg-user mailing list and kindly ask for more clarification towards "fine-tuning" the bsf:v setts syntax/arguments?
I have little experience in filter syntax, less so with this very new one, for which no working examples can be currently found on-line... 😢

Of course, migrating every yt-dl user to FFmpeg 4.4+ isn't very practical currently, plus the fact the issue at hand manifests itself at random youtube video IDs discourages, probably, the devs from writing code exclusive to ffmpeg 4.4+... Additionally, a lot more testing is needed on how the muxed file (with using the setts bsf) behaves on popular media players... ❓

Addition: The webm file produced by OLD ffmpeg (N-78989-gcaeed04 in my tests) plays absolutely fine in ALL players available in my machine (MPC-HC, MPC-BE, PotPlayer, VLC 3 and SMPlayer), thus I still consider using an ol'n'good ffmpeg build to be the definitive cure for this... 😉

commented

@Vangelis66 I have relayed that to them, in addition to the results of your testing to track down the error in past builds. I don't know that it'll matter due to the stipulation of using the current git head (which I surmise is the most recent version) but I figured it wouldn't hurt to try.

Thanks again.

commented

Update from one of the devs:

You can not reset all dts to 0, that does not make any sense.

commented

I'm not seeing much movement from the ffmpeg side. Is there anything anyone else wants to relay to them?

Any news on this? I just want my merge to webms to work

commented

I just want my merge to webms to work

but I'd prefer being able to use VP9 with HFR if I could.

Just use ffmpeg 3.0.1. This version does not have the issue. Unless you are downloading AV1 videos, it shouldn't cause any other issues either

commented

@Vangelis66 and @pukkandan, I just want to thank you for the investigation. I've been troubleshooting and I believe the root cause is that there was a regression in this specific function that aims to correct DTS non-linearity:

https://github.com/FFmpeg/FFmpeg/blob/fd5f4ac0813c27c34c387f00044905a859e29e37/fftools/ffmpeg.c#L757

Reading the code, it seems clear the intention is not to exit/abort when there is a DTS non-linearity, but rather correct it. Unfortunately, this correction logic broke after ffmpeg3, and is no longer working correctly.

I've passed this information to the ffmpeg developers, and I hope they are able to fix it, but as this is an open source project, to anyone with C knowledge, it would be amazing if anyone could investigate this specific function and see why this stopped properly correcting around ffmpeg-n3.1-dev-1443-N-79906-git-20160510-gc8c14d0.

Hopefully we can get to the bottom of this and finally fix it :)

Hello :)

We have narrowed down the problematic ffmpeg commit to FFmpeg/FFmpeg@2e6636a

This commit disabled the ability for ffmpeg to correct DTS errors when the encoding is VP9, and the mode is a simple copy.

We are testing some patches right now to see if we can restore DTS correction for VP9 without re-introducing 4313.

Patch submitted to ffmpeg-devel mailing list :D

Video playback is perfect on VLC.

image

commented

Thank you all for all the work you've put into the issue so far. <3

@danny-wu wrote:

We have narrowed down the problematic ffmpeg commit to
FFmpeg/FFmpeg@2e6636a

That is actually
ffmpeg-n3.1-dev-541-N-79004-git-20160311-g2e6636a
so just 15 commits away from the last win32 build
(I found to be the one) in which the remux works:
ffmpeg-n3.1-dev-526-N-78989-git-20160310-gcaeed04
So glad I was able to help pinpoint a regression window!

Patch submitted to ffmpeg-devel mailing list

Many thanks, indeed! 👍 This is the actual mailing list thread:

http://ffmpeg.org/pipermail/ffmpeg-devel/2021-May/280189.html

The one dev that replied as of now appears to be yet unconvinced... 😞

Knowing how evil Google are 😠 👎 , I wouldn't rule out them "fixing" their HFR encodes on purpose, just to spoil it for "downloaders"...

Knowing the ffmpeg devs, it'll probably take eons to review/approve/merge submitted patch; @danny-wu, are you willing to post your patch here, too, and, optimally, compile win32 FFmpeg builds for us Windows people (preferably ones that would launch on Vista, too, as that is the minimum ffmpeg supports currently) ?

I haven't been idle myself on this, despite not posting here... 😜
I have been going through FFmpeg's vast documentation in search of an interim "workaround", until this is addressed in FFmpeg code...

-fflags "+noparse +nofillin"

https://ffmpeg.org/ffmpeg-formats.html:

> fflags flags
>   Set format flags. Some are implemented for a limited number of formats.
>   Possible values for input files: 
> (snipped)
>  ‘noparse’
>      Disable AVParsers, this needs +nofillin too. 

supposedly will make FFmpeg disregard the non-monotonus DTS inside the VP9 video stream (rather than correct it, as with FFmpeg-3.0.1) and proceed with the mux; thus, the "issue" is then delegated to the player asked to play back the muxed streams...

However, that switch has to be specified before the "invalid" VP9 file, e.g.

ffmpeg44 -hide_banner -y -fflags "+noparse +nofillin" -i "VP9_674p60.webm" -i "opus96k.webm" -c copy "VP9+opus.webm"

works

Input #0, matroska,webm, from 'VP9_674p60.webm':
  Metadata:
    encoder         : google/video-file
    http://youtube.com/streaming/otf/durations/112015: Segment-Count: 54
                    : Segment-Durations-Ms: 5339,5338,5339(r=1),5338,5339(r=1),5
338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5
339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r
=1),5338,5339(r=1),5338,5339(r=1),533
                    :
                    :
  Duration: N/A, bitrate: N/A
  Stream #0:0(eng): Video: vp9 (Profile 0), yuv420p(tv, bt709/unknown/unknown),
1280x674, SAR 1:1 DAR 640:337, 59.94 fps, 59.94 tbr, 1k tbn, 1k tbc (default)
Input #1, matroska,webm, from 'opus96k.webm':
  Metadata:
    encoder         : google/video-file
  Duration: 00:04:46.56, start: -0.007000, bitrate: 92 kb/s
  Stream #1:0(eng): Audio: opus, 48000 Hz, stereo, fltp (default)
Output #0, webm, to 'VP9+opus.webm':
  Metadata:
    http://youtube.com/streaming/otf/durations/112015: Segment-Count: 54
                    : Segment-Durations-Ms: 5339,5338,5339(r=1),5338,5339(r=1),5
338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5
339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r
=1),5338,5339(r=1),5338,5339(r=1),533
                    :
                    :
    encoder         : Lavf58.76.100
  Stream #0:0(eng): Video: vp9 (Profile 0), yuv420p(tv, bt709/unknown/unknown),
1280x674 [SAR 1:1 DAR 640:337], q=2-31, 59.94 fps, 59.94 tbr, 1k tbn, 1k tbc (de
fault)
  Stream #0:1(eng): Audio: opus, 48000 Hz, stereo, fltp (default)
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #1:0 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame=    1 fps=0.0 q=-1.0 size=       1kB time=00:00:00.00 bitrate=8032.0kbits/
frame=17177 fps=0.0 q=-1.0 Lsize=    9735kB time=00:04:46.54 bitrate= 278.3kbits
/s speed= 645x
video:6403kB audio:3122kB subtitle:0kB other streams:0kB global headers:0kB muxi
ng overhead: 2.200533%

but

ffmpeg44 -hide_banner -y -i "VP9_674p60.webm" -i "opus96k.webm" -c copy -fflags "+noparse +nofillin" "VP9+opus.webm"

fails 😭 (ffmpeg44 a renamed ffmpeg.exe v4.4) ...

Where I am currently stuck is that when I supply the switch to yt-dl via, e.g.
--postprocessor-args "-fflags +noparse -fflags +nofillin",
this gets added in the ffmpeg command after the input files and mux fails... 😞

[ffmpeg] Merging formats into "VP9_674p60+opus96k.webm"
[debug] ffmpeg command line: ffmpeg -y -loglevel "repeat+info" -i "file:VP9_674p
60+opus96k.f302.webm" -i "file:VP9_674p60+opus96k.f251.webm" -c copy -map "0:v:0
" -map "1:a:0" -fflags "+noparse" -fflags "+nofillin" "file:VP9_674p60+opus96k.t
emp.webm"
ERROR: Conversion failed!
Traceback (most recent call last):
  File "youtube_dl\YoutubeDL.py", line 2115, in post_process
  File "youtube_dl\postprocessor\ffmpeg.py", line 523, in run
  File "youtube_dl\postprocessor\ffmpeg.py", line 235, in run_ffmpeg_multiple_fi
les
youtube_dl.postprocessor.ffmpeg.FFmpegPostProcessorError: Conversion failed!

Hi @Vangelis66, I will continue working on the patch with the goals of incorporating it into ffmpeg.

optimally, compile win32 FFmpeg builds for us Windows people (preferably ones that would launch on Vista, too, as that is the minimum ffmpeg supports currently) ?

Unfortunately I do not develop on Windows, and have no clue how to compile for Windows. Sorry! But someone else is of course welcome to compile (although I cannot endorse the security of any binaries, and do not encourage running untrusted binaries).

this gets added in the ffmpeg command after the input files and mux fails...

I think this is a valid case that calls for introducing a postprocessor-args-prepend flag to youtube-dl.

this gets added in the ffmpeg command after the input files and mux fails...

I think this is a valid case that calls for introducing a postprocessor-args-prepend flag to youtube-dl.

If #27723 is approved, it can be easily expanded to allow this without the need for another switch. See yt-dlp/yt-dlp@5b1ecbb for one possible implementation

@pukkandan: Many thanks 👍

yt-dlp -f 302+251 "W9mNLFseTT4" --ppa "Merger+ffmpeg_i1:-fflags +noparse -fflags +nofillin" =>

[youtube] W9mNLFseTT4: Downloading webpage
[youtube] W9mNLFseTT4: Downloading API JSON
[youtube] W9mNLFseTT4: Downloading MPD manifest
[youtube] W9mNLFseTT4: Downloading API JSON
[info] Downloading format(s) 302+251
[dashsegments] Total fragments: 55
[download] Destination: Blender Help - Dust Impact - Animated puff or cloud of d
ust from an object impact. [W9mNLFseTT4].f302.webm
[download] 100% of 6.36MiB in 00:15
[download] Destination: Blender Help - Dust Impact - Animated puff or cloud of d
ust from an object impact. [W9mNLFseTT4].f251.webm
[download] 100% of 3.15MiB in 00:02
[Merger] Merging formats into "Blender Help - Dust Impact - Animated puff or clo
ud of dust from an object impact. [W9mNLFseTT4].webm"
Deleting original file Blender Help - Dust Impact - Animated puff or cloud of du
st from an object impact. [W9mNLFseTT4].f302.webm (pass -k to keep)
Deleting original file Blender Help - Dust Impact - Animated puff or cloud of du
st from an object impact. [W9mNLFseTT4].f251.webm (pass -k to keep)
[SponSkrub] Trying to mark sponsor sections
[SponSkrub] No segments in the SponsorBlock database

Using ffmpeg n4.4 release, the resultant webm file plays with no issues at all on MPC-BE, MPC-HC, PotPlayer and (mpv-based) SMPlayer, but reproduction has serious video issues (audio is fine) in both VLC 2/VLC 3 (can't test VLC 4 here...).

So, if your default video player is NOT VLC, give the above "workaround" a try (unfortunate as it might be, currently it requires using a yt-dl fork); if you rely on VLC, as suggested, stick to ffmpeg n3.0.1 or wait (God knows for how long 😉 ) for the danny-wu patch to be merged (if approved) in (nightly) ffmpeg n4.5-dev ...
😃

Addendum: Using -fflags +noparse -fflags +nofillin indiscriminately for all your youtube downloads is a TERRIBLE idea (i.e. disabling ffmpeg's AVparser), just limit its use to these problematic VP9 HFR encodes...

I am on Windows Vista SP2 32-bit, it is currently extremely hard for me to find [...] recent 32-bit ffmpeg builds

@Vangelis66 May I suggest you have a look at https://forum.doom9.org/showthread.php?t=181802 ?

A Googler has filed an issue about their malformed VP9 encoding in their internal bug tracker.

Please try setts bitstream filter.

Doesn't work atleast without any parameters and I have no idea what params to use

Looking at ffmpeg.c, it seems to me that

int64_t max = ost->last_mux_dts + !(s->oformat->flags & AVFMT_TS_NONSTRICT);
...
if (pkt->dts < max) {
    if (pkt->pts >= pkt->dts)
        pkt->pts = FFMAX(pkt->pts, max);
    pkt->dts = max;
}

should be equivalent to (PREV_OUTDTS may need to be replaced with PREV_OUTDTS + 1, I've no idea whether VP9 is strict or not):

-bsf:v 'setts=pts=if((DTS < PREV_OUTDTS) * (PTS >= DTS)\, max(PTS\, PREV_OUTDTS)\, PTS):dts=max(DTS\, PREV_OUTDTS)'

at least the docs promise that “The expressions are evaluated through the eval API”.

Unfortunately I wasn't able to run even a simpler version of it:

Error parsing bitstream filter sequence 'setts=dts=max(DTS\, PREV_OUTDTS)': Bitstream filter not found

However, nonsensical stuff like 'setts=dts=sin(DTS + PREV_OUTDTS)' at least parses. Looks like the problem in the presence of comma, but I haven't found a way to escape it: no amount of backslashes works, and single quotes don't work either ("setts=dts='max(DTS, PREV_OUTDTS)'").

Does anybody know how to properly escape commas in bitstream filters? Did anyone have any success running setts filter?

If someone is tired waiting for FFmpeg devs to fix this issue, FFmpeg builds with a patch by @danny-wu can be found here: https://github.com/nihil-admirari/FFmpeg-With-VP9-Timestamp-Fix/releases. Builds are based on https://github.com/BtbN/FFmpeg-Builds.

When it comes to setts filter, looks like bitstream filter parser is based on a simple tokenizer, which completely ignores escape sequences. Most likely it's a bug, but until it is fixed, setts cannot be used to correct timestamps.

Your information about setts filter is incorrect and misleading. Also you provided no proofs for your claims.
Here is one possible example how to use setts filter:

-bsf:v setts=ts='N*(1001/60000)/TB'

I'm sure if you know how to properly overwrite non-monotonic PTS/DTS in stream that if you provide working formula I can write expression for you to be used in setts filter.

Your information about setts filter is incorrect and misleading. Also you provided no proofs for your claims.
Here is one possible example how to use setts filter:

-bsf:v setts=ts='N*(1001/60000)/TB

If you were to read what is written above carefully, you would've found the following:

However, nonsensical stuff like 'setts=dts=sin(DTS + PREV_OUTDTS)' at least parses. Looks like the problem in the presence of comma, but I haven't found a way to escape it: no amount of backslashes works, and single quotes don't work either ("setts=dts='max(DTS, PREV_OUTDTS)'").

I wasn't claiming that any TS filter expression results in an error, I was claiming that expressions containing commas do not parse. The error message was also presented, I don't quite understand how that isn't a proof:

Error parsing bitstream filter sequence 'setts=dts=max(DTS\, PREV_OUTDTS)': Bitstream filter not found

That said, I've retested everything again with latest FFmpeg from BtbN. Looks like a problem with commas has been fixed since June (now it's a problem with parentheses, see below).

Video downloaded with

yt-dlp --keep-video --ffmpeg-location /opt/ffmpeg-N-103585-gbb9141cc13-linux64-gpl/bin/ -f bv*[ext=webm]+ba[ext=webm]' -S +size W9mNLFseTT4

does merge with an additional -bsf:v 'setts=dts=max(DTS\, PREV_OUTDTS)', producing a warning:

[webm @ 0x557a20394dc0] Invalid DTS: 5355 PTS: 5339 in output stream 0:0, replacing by guess

Full FFmpeg command line:

/opt/ffmpeg-N-103585-gbb9141cc13-linux64-gpl/bin/ffmpeg -y -i 'file:Blender Help - Dust Impact - Animated puff or cloud of dust from an object impact. [W9mNLFseTT4].f303.webm' -i 'file:Blender Help - Dust Impact - Animated puff or cloud of dust from an object impact. [W9mNLFseTT4].f251.webm' -c copy -map 0:v:0 -map 1:a:0 -bsf:v 'setts=dts=max(DTS\, PREV_OUTDTS)' 'file:Blender Help - Dust Impact - Animated puff or cloud of dust from an object impact. [W9mNLFseTT4].temp.webm'

However, an attempt to set PTS in addition to DTS with -bsf:v 'setts=pts=if((DTS < PREV_OUTDTS) * (PTS >= DTS)\, max(PTS\, PREV_OUTDTS)\, PTS):dts=max(DTS\, PREV_OUTDTS)' fails with:

[setts @ 0x55dd6ed1efc0] [Eval @ 0x7ffe4eaaa0f0] Missing ')' in '(DTS<PREV_OUTDTS)*(PTS>=DTS),max(PTS,PREV_OUTDTS),PTS)'
[setts @ 0x55dd6ed1efc0] Error while parsing pts expression 'if((DTS < PREV_OUTDTS) * (PTS >= DTS), max(PTS, PREV_OUTDTS), PTS)'
Error initializing bitstream filter: setts
Error initializing output stream 0:0 --

I'm sure if you know how to properly overwrite non-monotonic PTS/DTS in stream that if you provide working formula

Quoting myself:

Looking at ffmpeg.c, it seems to me that

int64_t max = ost->last_mux_dts + !(s->oformat->flags & AVFMT_TS_NONSTRICT);
...
if (pkt->dts < max) {
    if (pkt->pts >= pkt->dts)
        pkt->pts = FFMAX(pkt->pts, max);
    pkt->dts = max;
}

should be equivalent to (PREV_OUTDTS may need to be replaced with PREV_OUTDTS + 1, I've no idea whether VP9 is strict or not):

-bsf:v 'setts=pts=if((DTS < PREV_OUTDTS) * (PTS >= DTS)\, max(PTS\, PREV_OUTDTS)\, PTS):dts=max(DTS\, PREV_OUTDTS)'

Looks like WebM & Matroska are both non-strict: https://github.com/FFmpeg/FFmpeg/blob/master/libavformat/webm_chunk.c#L298, https://github.com/FFmpeg/FFmpeg/blob/master/libavformat/matroskaenc.c#L2842 (correct me if I'm wrong, or if VP9 could be merged into a container that is strict).

I can write expression for you to be used in setts filter.

The task is to convert the C code above into FFmpeg eval expression. My attempt:

setts=pts=if((DTS < PREV_OUTDTS) * (PTS >= DTS)\, max(PTS\, PREV_OUTDTS)\, PTS):dts=max(DTS\, PREV_OUTDTS)

partially worked. I'd be happy to hear how to write a conditional that doesn't result in

Missing ')' in '(DTS<PREV_OUTDTS)*(PTS>=DTS),max(PTS,PREV_OUTDTS),PTS)'

Handling of commas was fixed in FFmpeg/FFmpeg@301d275, almost a month after my comment.

FFmpeg/FFmpeg@301d275 has not been backported to 4.4 release branch. Problem with commas is still reproducible there.

Turns out that eval doesn't support conditional operators, only functions. Correct syntax is:

-bsf:v 'setts=pts=if(lt(DTS\, PREV_OUTDTS) * gte(PTS\, DTS)\, max(PTS\, PREV_OUTDTS)\, PTS):dts=max(DTS\, PREV_OUTDTS)'

With PTS part present, Invalid DTS warning goes away. It should reproduce the C code, assuming that PREV_OUTDTS is ost->last_mux_dts, DTS is pkt->dts, PTS is pkt->pts, and that VP9 holding containers are non-strict.

Continuing the investigation. One merge was done with vanilla FFmpeg using setts filter:

/opt/ffmpeg-N-103588-g0b4d009587-linux64-gpl/bin/ffmpeg -i 'file:Blender Help - Dust Impact - Animated puff or cloud of dust from an object impact. [W9mNLFseTT4].f303.webm' -i 'file:Blender Help - Dust Impact - Animated puff or cloud of dust from an object impact. [W9mNLFseTT4].f251.webm' -c copy -map 0:v:0 -map 1:a:0 -bsf:v 'setts=pts=if(lt(DTS\, PREV_OUTDTS) * gte(PTS\, DTS)\, max(PTS\, PREV_OUTDTS)\, PTS):dts=max(DTS\, PREV_OUTDTS)' 'file:setts.webm'

A second merge was done with patched FFmpeg without using any filters:

/opt/ffmpeg-N-103588-g0b4d009587-linux64-nonfree/bin/ffmpeg -i 'file:Blender Help - Dust Impact - Animated puff or cloud of dust from an object impact. [W9mNLFseTT4].f303.webm' -i 'file:Blender Help - Dust Impact - Animated puff or cloud of dust from an object impact. [W9mNLFseTT4].f251.webm' -c copy -map 0:v:0 -map 1:a:0 'file:patched.webm'

FFprobe was used to show the packet structure:

/opt/ffmpeg-N-103588-g0b4d009587-linux64-gpl/bin/ffprobe -show_packets setts.webm > setts.pkts
/opt/ffmpeg-N-103588-g0b4d009587-linux64-gpl/bin/ffprobe -show_packets patched.webm > patched.pkts

Diff is empty. (If you know a better way to diff videos, please let me know.)

diff setts.pkts patched.pkts

Looks like setts filter expression is in fact identical to what the patch does. For example, replacing PREV_OUTDTS with PREV_OUTDTS + 1 produces a non-empty diff.

Once -bsf fix is propagated to FFmpeg releases, setts may become a viable solution to this problem. Currently it works only on master builds of FFmpeg.

@nihil-admirari

I want to congratulate you, Nil, 👍 for the thorough investigation of this ffmpeg issue (despite it being hosted in the youtube-dl issue tracker... 😕 ) - to the eyes of most here, this is a ffmpeg regression, since it used to work (n3.0.1), but no longer does...

Once -bsf fix is propagated to FFmpeg releases, setts may become a viable solution to this problem.
Currently, it works only on master builds of FFmpeg.

The non-coder, layman, user of youtube-dl/yt-dlp shouldn't need to master C (i.e. be able to read ffmpeg's source code) or ffmpeg's eval API to cough out a working -bsf:v "setts=blahblahblah" incantation, in order to successfully mux youtube VP9 streams... 😞 ; obviously, this has to be addressed now by the app(s) maintainers themselves, inside youtube-dl/yt-dlp code; seeing how things are at a standstill here 😉 , there's little hope for a youtube-dl fix coming soon... 😭

Most fortunately, the "patched" ffmpeg builds you provide act as a stopgap/workaround 👍 ; may I be cheeky and kindly ask you to submit a PR with that same fix (I believe that's the one) to this repo:

https://github.com/rdp/ffmpeg-windows-build-helpers

I'm in need of ffmpeg-win32-static builds that will run at least on Windows Vista SP2 32-bit (and higher), currently that script/toolchain/compiler is compatible with above requirements...

Many thanks indeed for your investigative work, much appreciated here! 👍 😄

Best regards

currently that script/toolchain/compiler is compatible with above requirements...

If you have master builds of FFmpeg younger than July, 4, you can simply use --ppa "Merger:-bsf:v ..." as you did before; full command line (Windows may need different quotes/backlashes):

yt-dlp -f 'bv*[ext=webm]+ba[ext=webm]' W9mNLFseTT4 --ppa "Merger:-bsf:v 'setts=pts=if(lt(DTS\, PREV_OUTDTS) * gte(PTS\, DTS)\, max(PTS\, PREV_OUTDTS)\, PTS):dts=max(DTS\, PREV_OUTDTS)'"

may I be cheeky and kindly ask you to submit a PR with that same fix (I believe that's the one) to this repo:

I think the patch can simply be applied along with other patches in the build script you've referenced:

# In  function build_ffmpeg
...
  cd $output_dir
    apply_patch file://$patch_dir/frei0r_load-shared-libraries-dynamically.diff
+ apply_patch "file://$patch_dir/0001-Fixes-ticket-9086.patch"

I won't be submitting a proper pull request: sorry, it's just too much work.

commented

Just saw this thread.. It's worth noting ffmpeg has several dts/time related "problems" that they refuse to address and they are not limited to YT. A datastream does not need to be contiguous, Forcing either PTS or DTS to anything without knowing their true state is asking for trouble. Unless YT fixed the videos linked above, I can't duplicate this or I'd test it myself with the sortdts fflag rather then try resetting it..

@h1z1 wrote:

Unless YT fixed the videos linked above, I can't duplicate this

The YT video (g6zva0stnOY) linked in the starting post of this thread has been made a private one, but I can still confirm the issue exists for W9mNLFseTT4 with master youtube-dl snapshot and ffmpeg-n4.4:

D:\Vangelis\Installers\youtube-dl>youtube-dl -v --console-title -c --no-part -f
302+251 "W9mNLFseTT4" -o "VP9_674p60+opus96k.webm"
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', '--console-title', '-c', '--no-part', '-f', '3
02+251', 'W9mNLFseTT4', '-o', 'VP9_674p60+opus96k.webm']
[debug] Encodings: locale cp1253, fs utf-8, out utf-8, pref cp1253
[debug] youtube-dl version 2021.06.06+18-git-20210701-ga803582+PR#28955v2
[debug] Python version 3.7.12 (CPython) - Windows-Vista-6.0.6003-SP2
[debug] exe versions: ffmpeg 4.4, ffprobe 4.4, phantomjs 2.1.1, rtmpdump 2.4
[debug] Proxy map: {}
[youtube] W9mNLFseTT4: Downloading webpage
[youtube] W9mNLFseTT4: Downloading MPD manifest
[debug] Invoking downloader on 'https://manifest.googlevideo.com/api/manifest/da
sh/expire/1633118612/ei/NBVXYbC0JZfW1wLu54ToCg/ip/46.12.100.142/id/5bd98d2c5b1e4
d3e/source/youtube/requiressl/yes/playback_host/r4---sn-4vguioxu-n3be.googlevide
o.com/mh/5x/mm/31%2C29/mn/sn-4vguioxu-n3be%2Csn-nv47lns6/ms/au%2Crdu/mv/m/mvi/4/
pl/25/hfr/all/as/fmp4_audio_clear%2Cwebm_audio_clear%2Cwebm2_audio_clear%2Cfmp4_
sd_hd_clear%2Cwebm2_sd_hd_clear/initcwndbps/623750/vprv/1/mt/1633095917/fvip/4/k
eepalive/yes/fexp/24001373%2C24007246/itag/0/sparams/expire%2Cei%2Cip%2Cid%2Csou
rce%2Crequiressl%2Chfr%2Cas%2Cvprv%2Citag/sig/AOq0QJ8wRgIhAJdl5mjh2ISrgeW5pDQAIW
jQEWkE5ifB6no6Aef3TyIAAiEA4mOZ8SqazJRgKhjO0WQCrqvcrmI1FkeohW61t1KKU4I%3D/lsparam
s/playback_host%2Cmh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps/lsig/AG3C_xAwR
gIhAM2Jraj0dl2p9VUF-xvV5trwuF7sBv3QPtXED6A9Gs1gAiEAgEn8N2GfgxaPqALivKhfDEh3GtriN
yZCZo7EVwybXPU%3D'
[dashsegments] Total fragments: 55
[download] Destination: VP9_674p60+opus96k.f302.webm
[download] 100% of 6.36MiB in 00:15
[debug] Invoking downloader on 'https://r4---sn-4vguioxu-n3be.googlevideo.com/vi
deoplayback?expire=1633118612&ei=NBVXYbC0JZfW1wLu54ToCg&ip=46.12.100.142&id=o-AG
RVeBCejDVoTANPIOgO5Ph-8mxaSVg20STvZ6gD0wbt&itag=251&source=youtube&requiressl=ye
s&mh=5x&mm=31%2C29&mn=sn-4vguioxu-n3be%2Csn-nv47lns6&ms=au%2Crdu&mv=m&mvi=4&pl=2
5&initcwndbps=623750&vprv=1&mime=audio%2Fwebm&ns=-2bcKEr5L5BP_tae8xjvhAUG&gir=ye
s&clen=3298833&otfp=1&dur=286.561&lmt=1601802151814820&mt=1633095917&fvip=4&keep
alive=yes&fexp=24001373%2C24007246&c=WEB&txp=6211222&n=e2Kbc5Boa99Zc3uT&sparams=
expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cns%2Cgir%2Ccl
en%2Cotfp%2Cdur%2Clmt&sig=AOq0QJ8wRQIhAMpazjbc0nDjiyjkCjVDLborzoI19rNAPhHhFAxbeP
77AiBFZ9cpX8RlJe279mgoYz2cxk-5aAuPGN5X16WBLqHQdg%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cm
s%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIhAKuNc2H53iAtsGB_Y5NojQvzcNF3rzp
tDK4q4OR9mE_tAiBnDvyKJXECtvsJMm33383xYj_iIYMZbUKNSphI2wjK-g%3D%3D'
[download] Destination: VP9_674p60+opus96k.f251.webm
[download] 100% of 3.15MiB in 00:55
[ffmpeg] Merging formats into "VP9_674p60+opus96k.webm"
[debug] ffmpeg command line: ffmpeg -y -loglevel "repeat+info" -i "file:VP9_674p
60+opus96k.f302.webm" -i "file:VP9_674p60+opus96k.f251.webm" -c copy -map "0:v:0
" -map "1:a:0" "file:VP9_674p60+opus96k.temp.webm"
[debug] ffmpeg version 4.4 Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 10.2.0 (GCC)
  configuration: --pkg-config=pkg-config --pkg-config-flags=--static --extra-ver
sion=ffmpeg-windows-build-helpers --enable-version3 --disable-debug --disable-w3
2threads --arch=x86 --target-os=mingw32 --cross-prefix=/home/runner/work/ffmpeg-
stable-autobuild/ffmpeg-stable-autobuild/sandbox/cross_compilers/mingw-w64-i686/
bin/i686-w64-mingw32- --enable-libcaca --enable-gray --enable-libtesseract --ena
ble-fontconfig --enable-gmp --enable-gnutls --enable-libass --enable-libbluray -
-enable-libbs2b --enable-libflite --enable-libfreetype --enable-libfribidi --ena
ble-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3l
ame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --ena
ble-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-lib
twolame --enable-libvo-amrwbenc --enable-libvorbis --enable-libwebp --enable-lib
zimg --enable-libzvbi --enable-libmysofa --enable-libopenjpeg --enable-libopenh2
64 --enable-liblensfun --enable-libvmaf --enable-libsrt --enable-demuxer=dash --
enable-libxml2 --enable-opengl --enable-libdav1d --enable-cuda-llvm --enable-lib
aom --enable-libvpx --enable-nvenc --enable-nvdec --extra-libs=-lharfbuzz --extr
a-libs=-lm --extra-libs=-lpthread --extra-cflags=-DLIBTWOLAME_STATIC --extra-cfl
ags=-DMODPLUG_STATIC --extra-cflags=-DCACA_STATIC --enable-amf --enable-libmfx -
-enable-gpl --enable-frei0r --enable-filter=frei0r --enable-librubberband --enab
le-libvidstab --enable-libx264 --enable-libx265 --enable-avisynth --enable-libar
ibb24 --enable-libxvid --enable-libdavs2 --enable-libxavs --enable-avresample --
extra-cflags='-mtune=generic' --extra-cflags=-O3 --enable-static --disable-share
d --prefix=/home/runner/work/ffmpeg-stable-autobuild/ffmpeg-stable-autobuild/san
dbox/cross_compilers/mingw-w64-i686/i686-w64-mingw32 --enable-nonfree --enable-l
ibfdk-aac --enable-decklink
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
Input #0, matroska,webm, from 'file:VP9_674p60+opus96k.f302.webm':
  Metadata:
    encoder         : google/video-file
    http://youtube.com/streaming/otf/durations/112015: Segment-Count: 54
                    : Segment-Durations-Ms: 5339,5338,5339(r=1),5338,5339(r=1),5
338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5
339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r
=1),5338,5339(r=1),5338,5339(r=1),533
                    :
                    :
  Duration: N/A, start: 0.000000, bitrate: N/A
  Stream #0:0(eng): Video: vp9 (Profile 0), yuv420p(tv, bt709/unknown/unknown),
1280x674, SAR 1:1 DAR 640:337, 59.94 fps, 59.94 tbr, 1k tbn, 1k tbc (default)
Input #1, matroska,webm, from 'file:VP9_674p60+opus96k.f251.webm':
  Metadata:
    encoder         : google/video-file
  Duration: 00:04:46.56, start: -0.007000, bitrate: 92 kb/s
  Stream #1:0(eng): Audio: opus, 48000 Hz, stereo, fltp (default)
Output #0, webm, to 'file:VP9_674p60+opus96k.temp.webm':
  Metadata:
    http://youtube.com/streaming/otf/durations/112015: Segment-Count: 54
                    : Segment-Durations-Ms: 5339,5338,5339(r=1),5338,5339(r=1),5
338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5
339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r
=1),5338,5339(r=1),5338,5339(r=1),533
                    :
                    :
    encoder         : Lavf58.76.100
  Stream #0:0(eng): Video: vp9 (Profile 0), yuv420p(tv, bt709/unknown/unknown),
1280x674 [SAR 1:1 DAR 640:337], q=2-31, 59.94 fps, 59.94 tbr, 1k tbn, 1k tbc (de
fault)
  Stream #0:1(eng): Audio: opus, 48000 Hz, stereo, fltp (default)
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #1:0 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame=    1 fps=0.0 q=-1.0 size=       1kB time=00:00:00.00 bitrate=8032.0kbits/
[webm @ 088fc4c0] Application provided invalid, non monotonically increasing dts
 to muxer in stream 0: 5355 >= 5339
av_interleaved_write_frame(): Invalid argument
frame=  323 fps=0.0 q=-1.0 Lsize=     198kB time=00:00:05.36 bitrate= 302.6kbits
/s speed=  98x
video:149kB audio:63kB subtitle:0kB other streams:0kB global headers:0kB muxing
overhead: unknown
ERROR: Conversion failed!
Traceback (most recent call last):
  File "youtube_dl\YoutubeDL.py", line 2115, in post_process
  File "youtube_dl\postprocessor\ffmpeg.py", line 526, in run
  File "youtube_dl\postprocessor\ffmpeg.py", line 238, in run_ffmpeg_multiple_fi
les
youtube_dl.postprocessor.ffmpeg.FFmpegPostProcessorError: Conversion failed!

FWIW, as a Windows Vista SP2 32-bit user, I have no access to the patched ffmpeg builds mentioned earlier in this thread (those, as well as the ones recently offered by yt-dlp devs, target Win7+ ...).

TL;DR: Youtube (read: Google) haven't fixed their HFR VP9 raw streams... 😞

@Vangelis66

FWIW, as a Windows Vista SP2 32-bit user, I have no access to the patched ffmpeg builds mentioned earlier in this thread (those, as well as the ones recently offered by yt-dlp devs, target Win7+ ...).

You have bigger shit to worry about if you're on Windows Vista. You do realize you're on an operating system with no security from Microsoft? There should be no reason for you to be on there other than pure incompetence.

Yes, respond with emojis. Have fun becoming part of the bot net @Vangelis66.

commented

Still failing with ffmpeg 4.1, 4.3.

Talked to FFmpeg developers on #ffmpeg-devel IRC. They stopped publishing IRC logs in June 2020 (https://lists.ffmpeg.org/pipermail/ffmpeg-devel-irc/), so here is the short summary:

  1. Nobody remembers whether disabling DTS correction was necessary to fix https://trac.ffmpeg.org/ticket/4313.
  2. They merged @danny-wu patch into FFmpeg master: FFmpeg/FFmpeg@68595b4.

https://trac.ffmpeg.org/ticket/9086 is now closed.