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

Conversation of youtube-mp4 to audio-format opus fails with newer ffmpeg versions #14381

Closed
Nothing4You opened this issue Oct 1, 2017 · 1 comment

Comments

@Nothing4You
Copy link

@Nothing4You Nothing4You commented Oct 1, 2017

Please follow the guide below

  • You will be asked some questions and requested to provide some information, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your issue (like this: [x])
  • Use the Preview tab to see what your issue will actually look like

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2017.10.01. If it's not, read this FAQ entry and update. Issues with outdated version will be rejected.

  • I've verified and I assure that I'm running youtube-dl 2017.10.01

Before submitting an issue make sure you have:

  • [x At least skimmed through the README, most notably the FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other

If the purpose of this issue is a bug report, site support request or you are not completely sure provide the full verbose output as follows:

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-f', '22', '-x', '--audio-format', 'opus', '--audio-quality', '0', '--add-metadata', '-k', '-v', 'hrdlVTHZSZY']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2017.10.01
[debug] Python version 3.6.2 - Linux-4.12.13-1-ARCH-x86_64-with-arch-Arch-Linux
[debug] exe versions: ffmpeg N-87628-g148c8e88c4, ffprobe N-87628-g148c8e88c4, rtmpdump 2.4
[debug] Proxy map: {}
[youtube] hrdlVTHZSZY: Downloading webpage
[youtube] hrdlVTHZSZY: Downloading video info webpage
[youtube] hrdlVTHZSZY: Extracting video information
[youtube] {22} signature length 40.40, html5 player vflcAIVzv
[youtube] {43} signature length 40.40, html5 player vflcAIVzv
[youtube] {18} signature length 40.40, html5 player vflcAIVzv
[youtube] {36} signature length 40.40, html5 player vflcAIVzv
[youtube] {17} signature length 40.40, html5 player vflcAIVzv
[youtube] {136} signature length 40.40, html5 player vflcAIVzv
[youtube] {247} signature length 40.40, html5 player vflcAIVzv
[youtube] {135} signature length 38.40, html5 player vflcAIVzv
[youtube] {244} signature length 40.40, html5 player vflcAIVzv
[youtube] {134} signature length 40.40, html5 player vflcAIVzv
[youtube] {243} signature length 40.40, html5 player vflcAIVzv
[youtube] {133} signature length 40.40, html5 player vflcAIVzv
[youtube] {242} signature length 40.40, html5 player vflcAIVzv
[youtube] {160} signature length 40.40, html5 player vflcAIVzv
[youtube] {278} signature length 40.40, html5 player vflcAIVzv
[youtube] {140} signature length 40.40, html5 player vflcAIVzv
[youtube] {171} signature length 40.40, html5 player vflcAIVzv
[youtube] {249} signature length 40.40, html5 player vflcAIVzv
[youtube] {250} signature length 40.40, html5 player vflcAIVzv
[youtube] {251} signature length 40.40, html5 player vflcAIVzv
[youtube] hrdlVTHZSZY: Downloading MPD manifest
[debug] Invoking downloader on 'https://r1---sn-5hnednlr.googlevideo.com/videoplayback?ipbits=0&ratebypass=yes&expire=1506914400&source=youtube&sparams=dur%2Cei%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Cratebypass%2Crequiressl%2Csource%2Cexpire&ei=AFzRWeuDIJqT1wLkk5nQCA&itag=22&lmt=1471395242712552&pl=18&ms=au&mt=1506892668&mv=m&ip=5.79.74.142&mime=video%2Fmp4&key=yt6&id=o-AMZ9_g8PhB_A-QkkqNOrRx0n_RSbQlm4vRV4Z6PrSKc2&requiressl=yes&dur=370.358&mm=31&mn=sn-5hnednlr&initcwndbps=2952500&signature=D9C83BD795958A2A7B228DC25E563A5DC0942B06.161D949C9498EB176E1FAF08DF6B40891D0CC635'
[download] Destination: Minupren & Epyleptika - Wir Brauchen Druck (Official Music Video)-hrdlVTHZSZY.mp4
[download] 100% of 49.78MiB in 00:02
[debug] ffmpeg command line: ffprobe -show_streams 'file:Minupren & Epyleptika - Wir Brauchen Druck (Official Music Video)-hrdlVTHZSZY.mp4'
[ffmpeg] Destination: Minupren & Epyleptika - Wir Brauchen Druck (Official Music Video)-hrdlVTHZSZY.opus
[debug] ffmpeg command line: ffmpeg -y -i 'file:Minupren & Epyleptika - Wir Brauchen Druck (Official Music Video)-hrdlVTHZSZY.mp4' -vn -acodec opus -b:a 0k 'file:Minupren & Epyleptika - Wir Brauchen Druck (Official Music Video)-hrdlVTHZSZY.opus'
ERROR: audio conversion failed: Conversion failed!
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/youtube_dl/postprocessor/ffmpeg.py", line 234, in run_ffmpeg
    FFmpegPostProcessor.run_ffmpeg(self, path, out_path, opts)
  File "/usr/lib/python3.6/site-packages/youtube_dl/postprocessor/ffmpeg.py", line 208, in run_ffmpeg
    self.run_ffmpeg_multiple_files([path], out_path, opts)
  File "/usr/lib/python3.6/site-packages/youtube_dl/postprocessor/ffmpeg.py", line 204, in run_ffmpeg_multiple_files
    raise FFmpegPostProcessorError(msg)
youtube_dl.postprocessor.ffmpeg.FFmpegPostProcessorError: Conversion failed!

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/youtube_dl/postprocessor/ffmpeg.py", line 305, in run
    self.run_ffmpeg(path, new_path, acodec, more_opts)
  File "/usr/lib/python3.6/site-packages/youtube_dl/postprocessor/ffmpeg.py", line 236, in run_ffmpeg
    raise AudioConversionError(err.msg)
youtube_dl.postprocessor.common.AudioConversionError: Conversion failed!

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/youtube_dl/YoutubeDL.py", line 2020, in post_process
    files_to_delete, info = pp.run(info)
  File "/usr/lib/python3.6/site-packages/youtube_dl/postprocessor/ffmpeg.py", line 308, in run
    'audio conversion failed: ' + e.msg)
youtube_dl.utils.PostProcessingError: audio conversion failed: Conversion failed!

ffmpeg -y -i 'file:Minupren & Epyleptika - Wir Brauchen Druck (Official Music Video)-hrdlVTHZSZY.mp4' -vn -acodec opus -b:a 0k 'file:Minupren & Epyleptika - Wir Brauchen Druck (Official Music Video)-hrdlVTHZSZY.opus'

ffmpeg version N-87628-g148c8e88c4 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 7.2.0 (GCC)
  configuration: --prefix=/usr --extra-cflags=-I/opt/cuda/include --extra-ldflags='-L/opt/cuda/lib64 -Wl,-rpath -Wl,/opt/intel/mediasdk/lib64' --enable-rpath --enable-gpl --enable-version3 --enable-nonfree --enable-shared --disable-static --enable-gray --enable-avresample --enable-alsa --enable-avisynth --enable-bzlib --enable-chromaprint --enable-frei0r --enable-gcrypt --enable-gmp --enable-gnutls --enable-iconv --enable-jack --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcelt --enable-libcdio --enable-libdc1394 --enable-libfdk-aac --enable-libflite --enable-fontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libiec61883 --enable-libilbc --enable-libkvazaar --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopencv --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-librtmp --enable-libshine --enable-libsmbclient --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtesseract --enable-libtheora --enable-libtwolame --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxcb --enable-libxcb-shm --enable-libxcb-xfixes --enable-libxcb-shape --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lzma --enable-decklink --enable-libmysofa --enable-openal --enable-opencl --enable-opengl --enable-openssl --enable-sndio --enable-sdl2 --enable-xlib --enable-zlib --enable-cuda --disable-cuda-sdk --enable-cuvid --enable-libmfx --enable-libnpp --enable-nvenc --enable-omx --enable-omx-rpi --enable-vaapi --enable-vdpau
  libavutil      55. 77.101 / 55. 77.101
  libavcodec     57.106.104 / 57.106.104
  libavformat    57. 82.102 / 57. 82.102
  libavdevice    57.  9.101 / 57.  9.101
  libavfilter     6.106.100 /  6.106.100
  libavresample   3.  6.  0 /  3.  6.  0
  libswscale      4.  7.103 /  4.  7.103
  libswresample   2.  8.100 /  2.  8.100
  libpostproc    54.  6.100 / 54.  6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'file:Minupren & Epyleptika - Wir Brauchen Druck (Official Music Video)-hrdlVTHZSZY.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    creation_time   : 2016-08-17T00:53:17.000000Z
  Duration: 00:06:10.29, start: 0.000000, bitrate: 1127 kb/s
    Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 999 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc (default)
    Metadata:
      creation_time   : 2016-08-17T00:53:17.000000Z
      handler_name    : ISO Media file produced by Google Inc.
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)
    Metadata:
      creation_time   : 2016-08-17T00:53:17.000000Z
      handler_name    : ISO Media file produced by Google Inc.
Stream mapping:
  Stream #0:1 -> #0:0 (aac (native) -> opus (native))
Press [q] to stop, [?] for help
[opus @ 0x555ea8bad560] The encoder 'opus' is experimental but experimental codecs are not enabled, add '-strict -2' if you want to use it.
[opus @ 0x555ea8bad560] Alternatively use the non experimental encoder 'libopus'.
Average Intensity Stereo band: 0.0
Dual Stereo used: -nan%
Conversion failed!

Description of your issue, suggested solution and other information

Conversation of mp4 to opus fails on newer ffmpeg versions.
For comparison I tested on another machine running debian:

ffmpeg -y -i 'file:Minupren & Epyleptika - Wir Brauchen Druck (Official Music Video)-hrdlVTHZSZY.mp4' -vn -acodec opus '-b:a' 0k 'file:Minupren & Epyleptika - Wir Brauchen Druck (Official Music Video)-hrdlVTHZSZY.opus'
ffmpeg version 3.2.7-1~deb9u1 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 6.3.0 (Debian 6.3.0-18) 20170516
  configuration: --prefix=/usr --extra-version='1~deb9u1' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libebur128 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
  libavutil      55. 34.101 / 55. 34.101
  libavcodec     57. 64.101 / 57. 64.101
  libavformat    57. 56.101 / 57. 56.101
  libavdevice    57.  1.100 / 57.  1.100
  libavfilter     6. 65.100 /  6. 65.100
  libavresample   3.  1.  0 /  3.  1.  0
  libswscale      4.  2.100 /  4.  2.100
  libswresample   2.  3.100 /  2.  3.100
  libpostproc    54.  1.100 / 54.  1.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'file:Minupren & Epyleptika - Wir Brauchen Druck (Official Music Video)-hrdlVTHZSZY.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    creation_time   : 2016-08-17T00:53:17.000000Z
  Duration: 00:06:10.29, start: 0.000000, bitrate: 1127 kb/s
    Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 999 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc (default)
    Metadata:
      creation_time   : 2016-08-17T00:53:17.000000Z
      handler_name    : ISO Media file produced by Google Inc.
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)
    Metadata:
      creation_time   : 2016-08-17T00:53:17.000000Z
      handler_name    : ISO Media file produced by Google Inc.
[libopus @ 0x5651f1d91380] No bit rate set. Defaulting to 96000 bps.
Output #0, opus, to 'file:Minupren & Epyleptika - Wir Brauchen Druck (Official Music Video)-hrdlVTHZSZY.opus':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    encoder         : Lavf57.56.101
    Stream #0:0(und): Audio: opus (libopus), 48000 Hz, stereo, flt, 96 kb/s (default)
    Metadata:
      creation_time   : 2016-08-17T00:53:17.000000Z
      handler_name    : ISO Media file produced by Google Inc.
      encoder         : Lavc57.64.101 libopus
      major_brand     : mp42
      minor_version   : 0
      compatible_brands: isommp42
Stream mapping:
  Stream #0:1 -> #0:0 (aac (native) -> opus (libopus))
Press [q] to stop, [?] for help
size=    4544kB time=00:06:10.29 bitrate= 100.5kbits/s speed=22.8x    
video:0kB audio:4511kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.722119%

It seems that -avcodec opus used to be mapped to libopus and that doesn't seem to be the case anymore. If I change the command to ffmpeg -y -i 'file:Minupren & Epyleptika - Wir Brauchen Druck (Official Music Video)-hrdlVTHZSZY.mp4' -vn -acodec libopus -b:a 0k 'file:Minupren & Epyleptika - Wir Brauchen Druck (Official Music Video)-hrdlVTHZSZY.opus' on my arch machine (the one that I have found this issue on) it converts just fine using libopus as encoder.

@Nothing4You
Copy link
Author

@Nothing4You Nothing4You commented Oct 1, 2017

As a workaround --postprocessor-args '-strict -2' can be used to use the new experimental codec.

@dstftw dstftw closed this in d2ae7e2 Oct 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.