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

Opus audio conversion failure #1263

Closed
krzyzowiec opened this issue Aug 17, 2013 · 8 comments
Closed

Opus audio conversion failure #1263

krzyzowiec opened this issue Aug 17, 2013 · 8 comments

Comments

@krzyzowiec
Copy link

@krzyzowiec krzyzowiec commented Aug 17, 2013

When trying to extract and convert audio from a youtube video into an opus-encoded audio file I get "ERROR: audio conversion failed:" with no further explanation. Both libopus0 and opus-tools are installed and I have no problems with other codecs like vorbis. I'm not sure if this is because of the ffmpeg/avconv issue in Ubuntu or a bug in youtube-dl.

Distribution: Ubuntu 13.04
Version: 2013.08.17

Debug output:

Traceback (most recent call last):
File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 589, in post_process
keep_video_wish,new_info = pp.run(info)
File "/usr/local/bin/youtube-dl/youtube_dl/PostProcessor.py", line 205, in run
raise PostProcessingError(msg)
PostProcessingError

@GeorgeSG
Copy link

@GeorgeSG GeorgeSG commented Aug 18, 2013

I had the same issue and after an hour-long debug session with a friend of mine we found out that the problem was I was missing libmp3lame, which you can aquire by installing libavcodec-extra-53 :)

Hope that fixes it for you too :)

@krzyzowiec
Copy link
Author

@krzyzowiec krzyzowiec commented Aug 18, 2013

You had me excited with that response, unfortunately the solution isn't as easy for me, as libavcodec-extra-53 is already installed on my system :(

I'm debating trying another distro just to see if it is ubuntu-specific.

@phihag
Copy link
Contributor

@phihag phihag commented Aug 18, 2013

Thanks for the report. We should definitely include more debugging information. Can you post the entire output of youtube-dl when called with -v? That may give some helpful hints.

@krzyzowiec
Copy link
Author

@krzyzowiec krzyzowiec commented Aug 18, 2013

Sure,

[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-v', '-x', '--audio-format=opus', 'https://www.youtube.com/watch?v=mOA_HBRntyo']
[debug] youtube-dl version 2013.08.17
[debug] Python version 2.7.4 - Linux-3.9.0-030900-generic-x86_64-with-Ubuntu-13.04-raring
[debug] Proxy map: {}
[youtube] Setting language
[youtube] mOA_HBRntyo: Downloading video webpage
[youtube] mOA_HBRntyo: Downloading video info webpage
[youtube] mOA_HBRntyo: Extracting video information
[download] Xan - To The Clouds-mOA_HBRntyo.mp4 has already been downloaded
[avconv] Destination: Xan - To The Clouds-mOA_HBRntyo.opus
ERROR: audio conversion failed:
Traceback (most recent call last):
File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 589, in post_process
keep_video_wish,new_info = pp.run(info)
File "/usr/local/bin/youtube-dl/youtube_dl/PostProcessor.py", line 205, in run
raise PostProcessingError(msg)
PostProcessingError

@GeorgeSG
Copy link

@GeorgeSG GeorgeSG commented Aug 18, 2013

Tried it here, doesn't work for me either, because of the opus file format. With mp3 works fine.

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Oct 12, 2013

I've installed ffmpeg with opus support:

$ffmpeg -version
ffmpeg version 1.2.4
built on Oct 12 2013 12:40:16 with Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn)
configuration: --prefix=/usr/local/Cellar/ffmpeg/1.2.4 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --enable-vda --cc=cc --host-cflags= --host-ldflags= --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid --enable-libopus
libavutil      52. 18.100 / 52. 18.100
libavcodec     54. 92.100 / 54. 92.100
libavformat    54. 63.104 / 54. 63.104
libavdevice    54.  3.103 / 54.  3.103
libavfilter     3. 42.103 /  3. 42.103
libswscale      2.  2.100 /  2.  2.100
libswresample   0. 17.102 /  0. 17.102
libpostproc    52.  2.100 / 52.  2.100

The error I get is youtube_dl.utils.PostProcessingError: audio conversion failed: Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
If I run the same following ffmpeg command (the one youtube-dl executes):

ffmpeg -y -i 'Xan - To The Clouds-mOA_HBRntyo.mp4' -vn -acodec opus -aq 5 'Xan - To The Clouds-mOA_HBRntyo.opus'
ffmpeg version 1.2.4 Copyright (c) 2000-2013 the FFmpeg developers
  built on Oct 12 2013 12:40:16 with Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/1.2.4 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --enable-vda --cc=cc --host-cflags= --host-ldflags= --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid --enable-libopus
  libavutil      52. 18.100 / 52. 18.100
  libavcodec     54. 92.100 / 54. 92.100
  libavformat    54. 63.104 / 54. 63.104
  libavdevice    54.  3.103 / 54.  3.103
  libavfilter     3. 42.103 /  3. 42.103
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Xan - To The Clouds-mOA_HBRntyo.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    creation_time   : 2013-08-17 06:09:54
  Duration: 00:06:01.98, start: 0.000000, bitrate: 1152 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720, 957 kb/s, 29.97 fps, 29.97 tbr, 60k tbn, 59.94 tbc
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 191 kb/s
    Metadata:
      creation_time   : 2013-08-17 06:09:57
      handler_name    : IsoMedia File Produced by Google, 5-11-2011
[libopus @ 0x7ffedb0e4800] No bit rate set. Defaulting to 96000 bps.
[libopus @ 0x7ffedb0e4800] Quality-based encoding not supported, please specify a bitrate and VBR setting.
Output #0, ogg, to 'Xan - To The Clouds-mOA_HBRntyo.opus':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    Stream #0:0(und): Audio: opus, 48000 Hz, stereo, flt, 96 kb/s
    Metadata:
      creation_time   : 2013-08-17 06:09:57
      handler_name    : IsoMedia File Produced by Google, 5-11-2011
Stream mapping:
  Stream #0:1 -> #0:0 (aac -> libopus)
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height

The problem is with the -aq 5 option, if I drop it everything works fine, according to the ffmpeg docs, it has a codec specific meaning.

@jaimeMF jaimeMF closed this in 0f6d12e Oct 13, 2013
@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Oct 13, 2013

It's fixed now, but you'll need to install a version of ffmpeg built with the --enable-libopus.
Thanks for the rerports!

@kstohr
Copy link

@kstohr kstohr commented Oct 9, 2017

I am getting the same error message using youtube-dl installed with --enable-libopus. I am trying to extract audio from an .mp4 file. The audio codec in the container is 'aac'. I am trying to extract the audio and convert it to ogg/opus for transcription. Any insight into why this is happening very much appreciated.

I have tried uninstalling and reinstalling/compiling both Youtube-dl and FFMPEG. I confirmed that libopus is enabled.

I get the following error message running Python 3.6.2 on OS 10.11.6 with FFMPEG 3.3.4 using the sample code provided for embedding youtube-dl in python scripts:

Python 3.6.2 (default, Jul 17 2017, 16:44:47) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin Type "help", "copyright", "credits" or "license" for more information. from pblc.audio_video_utils import DownloadConvert file_input = "https://s3-us-west-2.amazonaws.com/pblc02/media/test_video/sausalito_nov2016_5min_conv.mp4" file_output = './test/test_files/sausalito_nov2016_5min_conv.ogg' audio_codec = 'opus' dl = DownloadConvert(file_input, file_output, audio_codec) dl.download_convert_file() Done downloading, now converting ... ERROR: audio conversion failed: Conversion failed!

Here is the traceback:

Traceback (most recent call last): File "/Users/kate/dev/pblc_dev/pblc_02/web_app/venv3/lib/python3.6/site-packages/youtube_dl/postprocessor/ffmpeg.py", line 234, in run_ffmpeg FFmpegPostProcessor.run_ffmpeg(self, path, out_path, opts) File "/Users/kate/dev/pblc_dev/pblc_02/web_app/venv3/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 "/Users/kate/dev/pblc_dev/pblc_02/web_app/venv3/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!'
Converting to flac works just fine:

2.amazonaws.com/pblc02/media/test_video/sausalito_nov2016_5min_conv.mp4" file_output = './test/test_files/sausalito_nov2016_5min_conv.flac' audio_codec = 'flac' dl = DownloadConvert(file_input, file_output, audio_codec) dl.download_convert_file() Done downloading, now converting ... File conversion done.
`
FFMPEG config info:

$ ffmpeg -version ffmpeg version 3.3.4 Copyright (c) 2000-2017 the FFmpeg developers built with Apple LLVM version 8.0.0 (clang-800.0.42.1) configuration: --prefix=/usr/local/Cellar/ffmpeg/3.3.4 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-gpl --enable-libmp3lame --enable-libopus --enable-libx264 --enable-libxvid --enable-opencl --enable-videotoolbox --disable-lzma --enable-vda libavutil 55. 58.100 / 55. 58.100 libavcodec 57. 89.100 / 57. 89.100 libavformat 57. 71.100 / 57. 71.100 libavdevice 57. 6.100 / 57. 6.100 libavfilter 6. 82.100 / 6. 82.100 libavresample 3. 5. 0 / 3. 5. 0 libswscale 4. 6.100 / 4. 6.100 libswresample 2. 7.100 / 2. 7.100 libpostproc 54. 5.100 / 54. 5.100

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
5 participants
You can’t perform that action at this time.