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

AV1 failing in FFMPEG #22803

Closed
Akkuma opened this issue Oct 22, 2019 · 3 comments
Closed

AV1 failing in FFMPEG #22803

Akkuma opened this issue Oct 22, 2019 · 3 comments
Labels

Comments

@Akkuma
Copy link

@Akkuma Akkuma commented Oct 22, 2019

Checklist

  • I'm reporting a broken site support issue
  • I've verified that I'm running youtube-dl version 2019.10.22
  • 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

youtube-dl "https://www.youtube.com/watch?v=pBuUkd5uakk" --merge-output-format webm -v
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'https://www.youtube.com/watch?v=pBuUkd5uakk', u'--merge-output-format', u'webm', u'-v']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2019.10.22
[debug] Python version 2.7.16 (CPython) - Darwin-18.6.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 4.2.1, ffprobe 4.2.1, rtmpdump 2.4
[debug] Proxy map: {}
[youtube] pBuUkd5uakk: Downloading webpage
[youtube] pBuUkd5uakk: Downloading video info webpage
[debug] Default format spec: bestvideo+bestaudio/best
[debug] Invoking downloader on u'https://r3---sn-5ualdnl7.googlevideo.com/videoplayback?expire=1571773653&ei=dQivXb7FHbWdlAPgwJyIBQ&ip=108.213.200.203&id=o-AAws99svgOPa3Gs9RBkXugRDaiqWmwNFGVL4EDa0MnQG&itag=137&aitags=133%2C134%2C135%2C136%2C137%2C160%2C242%2C243%2C244%2C247%2C248%2C278&source=youtube&requiressl=yes&mm=31%2C29&mn=sn-5ualdnl7%2Csn-5uaeznd7&ms=au%2Crdu&mv=m&mvi=2&pl=16&initcwndbps=755000&mime=video%2Fmp4&gir=yes&clen=171076265&dur=395.027&lmt=1553316821359253&mt=1571751960&fvip=6&keepalive=yes&fexp=23842630&c=WEB&txp=5535432&sparams=expire%2Cei%2Cip%2Cid%2Caitags%2Csource%2Crequiressl%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=ALgxI2wwRAIgXMAfSN9zVOTUa-x5a-Fsd0eKXOgYBxD_QJgGVi9c-kYCIGLZokIIFfCgDpOXLi3uEF0gUegJ4yr4BJGmR1zP2j1v&lsparams=mm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AHylml4wRgIhANQ6dJKgwxAbhdBPtykDykJim7zpNX-eNAviwINieS8JAiEAw5df2b6YHn4Z1IJzGWsPXGjuSroGKNJkZ4h9ALqhuVg%3D&ratebypass=yes'
[download] FINAL FANTASY XIV - SHADOWBRINGERS Full Trailer-pBuUkd5uakk.f137.mp4 has already been downloaded
[download] 100% of 163.15MiB
[debug] Invoking downloader on u'https://r3---sn-5ualdnl7.googlevideo.com/videoplayback?expire=1571773653&ei=dQivXb7FHbWdlAPgwJyIBQ&ip=108.213.200.203&id=o-AAws99svgOPa3Gs9RBkXugRDaiqWmwNFGVL4EDa0MnQG&itag=251&source=youtube&requiressl=yes&mm=31%2C29&mn=sn-5ualdnl7%2Csn-5uaeznd7&ms=au%2Crdu&mv=m&mvi=2&pl=16&initcwndbps=755000&mime=audio%2Fwebm&gir=yes&clen=6077321&dur=395.041&lmt=1553319151785813&mt=1571751960&fvip=6&keepalive=yes&fexp=23842630&c=WEB&txp=5511222&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=ALgxI2wwRAIgMKsc37faYGJEXF_yXVeqNGL4MCqNTOMyBMgNOpqhReYCIF6RXnUacxqGYEUd19w1Wmhr8vwlm6FvU5FspId9Nuya&lsparams=mm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AHylml4wRgIhANQ6dJKgwxAbhdBPtykDykJim7zpNX-eNAviwINieS8JAiEAw5df2b6YHn4Z1IJzGWsPXGjuSroGKNJkZ4h9ALqhuVg%3D&ratebypass=yes'
[download] FINAL FANTASY XIV - SHADOWBRINGERS Full Trailer-pBuUkd5uakk.f251.webm has already been downloaded
[download] 100% of 5.80MiB
[ffmpeg] Merging formats into "FINAL FANTASY XIV - SHADOWBRINGERS Full Trailer-pBuUkd5uakk.webm"
[debug] ffmpeg command line: ffmpeg -y -loglevel 'repeat+info' -i 'file:FINAL FANTASY XIV - SHADOWBRINGERS Full Trailer-pBuUkd5uakk.f137.mp4' -i 'file:FINAL FANTASY XIV - SHADOWBRINGERS Full Trailer-pBuUkd5uakk.f251.webm' -c copy -map '0:v:0' -map '1:a:0' 'file:FINAL FANTASY XIV - SHADOWBRINGERS Full Trailer-pBuUkd5uakk.temp.webm'
ERROR:   Stream #1:0 -> #0:1 (copy)
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 2064, in post_process
    files_to_delete, info = pp.run(info)
  File "/usr/local/bin/youtube-dl/youtube_dl/postprocessor/ffmpeg.py", line 512, in run
    self.run_ffmpeg_multiple_files(info['__files_to_merge'], temp_filename, args)
  File "/usr/local/bin/youtube-dl/youtube_dl/postprocessor/ffmpeg.py", line 235, in run_ffmpeg_multiple_files
    raise FFmpegPostProcessorError(msg)
FFmpegPostProcessorError:   Stream #1:0 -> #0:1 (copy)

Description

I was trying to output a proper webm for use with a HTML5 video element. The mkv version is outputted and works as expected (generated by youtube-dl "https://www.youtube.com/watch?v=pBuUkd5uakk"), but trying to merge it as a webm fails despite it using av1 video & opus audio. I did manage to workaround this by using the mkv and running that through ffmpeg manually through the experimental flag by using ffmpeg directly.

FFMPEG details

ffmpeg version 4.2.1 Copyright (c) 2000-2019 the FFmpeg developers
  built with Apple clang version 11.0.0 (clang-1100.0.33.8)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/4.2.1_1 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags='-I/Library/Java/JavaVirtualMachines/adoptopenjdk-13.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/adoptopenjdk-13.jdk/Contents/Home/include/darwin -fno-stack-check' --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --disable-libjack --disable-indev=jack
  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
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'file:FINAL FANTASY XIV - SHADOWBRINGERS Full Trailer-pBuUkd5uakk.f137.mp4':
  Metadata:
    major_brand     : dash
    minor_version   : 0
    compatible_brands: iso6avc1mp41
    creation_time   : 2019-03-23T04:50:33.000000Z
  Duration: 00:06:35.03, start: 0.000000, bitrate: 3464 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 11 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
    Metadata:
      creation_time   : 2019-03-23T04:50:33.000000Z
      handler_name    : ISO Media file produced by Google Inc. Created on: 03/22/2019.
Input #1, matroska,webm, from 'file:FINAL FANTASY XIV - SHADOWBRINGERS Full Trailer-pBuUkd5uakk.f251.webm':
  Metadata:
    encoder         : google/video-file
  Duration: 00:06:35.04, start: -0.007000, bitrate: 123 kb/s
    Stream #1:0(eng): Audio: opus, 48000 Hz, stereo, fltp (default)
[webm @ 0x7f8559004e00] Only VP8 or VP9 or AV1 video and Vorbis or Opus audio and WebVTT subtitles are supported for WebM.
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #1:0 -> #0:1 (copy)

If I try to output this directly as an mp4 without manually using ffmpeg I get this error from the command generated by youtube-dl.

Command:

 youtube-dl "https://www.youtube.com/watch?v=pBuUkd5uakk" --merge-output-format mp4 -v
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'https://www.youtube.com/watch?v=pBuUkd5uakk', u'--merge-output-format', u'mp4', u'-v']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2019.10.22
[debug] Python version 2.7.16 (CPython) - Darwin-18.6.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 4.2.1, ffprobe 4.2.1, rtmpdump 2.4
[debug] Proxy map: {}
[youtube] pBuUkd5uakk: Downloading webpage
[youtube] pBuUkd5uakk: Downloading video info webpage
[debug] Default format spec: bestvideo+bestaudio/best
[debug] Invoking downloader on u'https://r3---sn-5ualdnl7.googlevideo.com/videoplayback?expire=1571774757&ei=xQyvXdz_KsPb4QTcgZLIBA&ip=108.213.200.203&id=o-AKo4t2IRRwn-Xr_YHgFbj2J0Li0Zy_4f_HDKl8PGwbmA&itag=137&aitags=133%2C134%2C135%2C136%2C137%2C160%2C242%2C243%2C244%2C247%2C248%2C278&source=youtube&requiressl=yes&mm=31%2C26&mn=sn-5ualdnl7%2Csn-q4flrnee&ms=au%2Conr&mv=m&mvi=2&pl=16&initcwndbps=858750&mime=video%2Fmp4&gir=yes&clen=171076265&dur=395.027&lmt=1553316821359253&mt=1571753049&fvip=3&keepalive=yes&fexp=23842630&c=WEB&txp=5535432&sparams=expire%2Cei%2Cip%2Cid%2Caitags%2Csource%2Crequiressl%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=ALgxI2wwRQIhAKvUnjO85GDpdHLuO5mvVunUh3k_b68qEzey0nL2BgZXAiBqQ_h5X2k5GXMYZ5avZwpkgJYiEvSCUoCJOSZXFvEj-A%3D%3D&lsparams=mm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AHylml4wRgIhAMFIZKxSQxBefMh-xFwKm3x3zKXCp-zbwpac9RdPBVlWAiEAymyXhDI9OnoqOMRLuszpV6uU4E0MDXq-Np6ZrgP7nTE%3D&ratebypass=yes'
[download] FINAL FANTASY XIV - SHADOWBRINGERS Full Trailer-pBuUkd5uakk.f137.mp4 has already been downloaded
[download] 100% of 163.15MiB
[debug] Invoking downloader on u'https://r3---sn-5ualdnl7.googlevideo.com/videoplayback?expire=1571774757&ei=xQyvXdz_KsPb4QTcgZLIBA&ip=108.213.200.203&id=o-AKo4t2IRRwn-Xr_YHgFbj2J0Li0Zy_4f_HDKl8PGwbmA&itag=251&source=youtube&requiressl=yes&mm=31%2C26&mn=sn-5ualdnl7%2Csn-q4flrnee&ms=au%2Conr&mv=m&mvi=2&pl=16&initcwndbps=858750&mime=audio%2Fwebm&gir=yes&clen=6077321&dur=395.041&lmt=1553319151785813&mt=1571753049&fvip=3&keepalive=yes&fexp=23842630&c=WEB&txp=5511222&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=ALgxI2wwRAIgBT2MM_J4Dj0ojecuSBE4pv8nL6fEiQzFoCwQ-hHs4V0CIDFGwleUIZi5GAiLs1PUCfUvLADL8-pVlPInN-kRhO8S&lsparams=mm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AHylml4wRgIhAMFIZKxSQxBefMh-xFwKm3x3zKXCp-zbwpac9RdPBVlWAiEAymyXhDI9OnoqOMRLuszpV6uU4E0MDXq-Np6ZrgP7nTE%3D&ratebypass=yes'
[download] FINAL FANTASY XIV - SHADOWBRINGERS Full Trailer-pBuUkd5uakk.f251.webm has already been downloaded
[download] 100% of 5.80MiB
[ffmpeg] Merging formats into "FINAL FANTASY XIV - SHADOWBRINGERS Full Trailer-pBuUkd5uakk.mp4"
[debug] ffmpeg command line: ffmpeg -y -loglevel 'repeat+info' -i 'file:FINAL FANTASY XIV - SHADOWBRINGERS Full Trailer-pBuUkd5uakk.f137.mp4' -i 'file:FINAL FANTASY XIV - SHADOWBRINGERS Full Trailer-pBuUkd5uakk.f251.webm' -c copy -map '0:v:0' -map '1:a:0' 'file:FINAL FANTASY XIV - SHADOWBRINGERS Full Trailer-pBuUkd5uakk.temp.mp4'
ERROR:   Stream #1:0 -> #0:1 (copy)
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 2064, in post_process
    files_to_delete, info = pp.run(info)
  File "/usr/local/bin/youtube-dl/youtube_dl/postprocessor/ffmpeg.py", line 512, in run
    self.run_ffmpeg_multiple_files(info['__files_to_merge'], temp_filename, args)
  File "/usr/local/bin/youtube-dl/youtube_dl/postprocessor/ffmpeg.py", line 235, in run_ffmpeg_multiple_files
    raise FFmpegPostProcessorError(msg)
FFmpegPostProcessorError:   Stream #1:0 -> #0:1 (copy)

Error:

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'file:FINAL FANTASY XIV - SHADOWBRINGERS Full Trailer-pBuUkd5uakk.f137.mp4':
  Metadata:
    major_brand     : dash
    minor_version   : 0
    compatible_brands: iso6avc1mp41
    creation_time   : 2019-03-23T04:50:33.000000Z
  Duration: 00:06:35.03, start: 0.000000, bitrate: 3464 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 11 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
    Metadata:
      creation_time   : 2019-03-23T04:50:33.000000Z
      handler_name    : ISO Media file produced by Google Inc. Created on: 03/22/2019.
Input #1, matroska,webm, from 'file:FINAL FANTASY XIV - SHADOWBRINGERS Full Trailer-pBuUkd5uakk.f251.webm':
  Metadata:
    encoder         : google/video-file
  Duration: 00:06:35.04, start: -0.007000, bitrate: 123 kb/s
    Stream #1:0(eng): Audio: opus, 48000 Hz, stereo, fltp (default)
[mp4 @ 0x7feb0580d400] track 1: codec frame size is not set
[mp4 @ 0x7feb0580d400] opus in MP4 support is experimental, add '-strict -2' if you want to use it.
Could not write header for output file #0 (incorrect codec parameters ?): Experimental feature
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #1:0 -> #0:1 (copy)
@remitamine
Copy link
Collaborator

@remitamine remitamine commented Oct 22, 2019

you're trying to merge incompatible formats:

  • the codec for format 137 is avc1 which is not supported by webm container.
  • the codec for format 251 is opus which is not supported by mp4 container.

so it's better not to mess with --merge-output-format and let youtube-dl choose the container suitable for the selected formats unless you're sure of what you're doing.

@remitamine remitamine closed this Oct 22, 2019
@remitamine remitamine added the invalid label Oct 22, 2019
@alakani

This comment was marked as off-topic.

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Feb 29, 2020

No, it's not. OP specifies incompatible merge output format, once you specify that all bets are off and it's your responsibility to provide compatibility via format selection.

@ytdl-org ytdl-org locked and limited conversation to collaborators Feb 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.