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

--audio-format=mp3 leads to encoder failure #302

Closed
ghost opened this issue Mar 4, 2012 · 8 comments
Closed

--audio-format=mp3 leads to encoder failure #302

ghost opened this issue Mar 4, 2012 · 8 comments

Comments

@ghost
Copy link

@ghost ghost commented Mar 4, 2012

I have been trying to use --audio-format=mp3 in order to create an mp3 from various youtube videos with the following result:

$ youtube-dl --extract-audio -t --audio-format=mp3 --console-title "https://www.youtube.com/watch?v=RJ2Xi3e1xzE"
[youtube] Setting language
[youtube] RJ2Xi3e1xzE: Downloading video webpage
[youtube] RJ2Xi3e1xzE: Downloading video info webpage
[youtube] RJ2Xi3e1xzE: Extracting video information
[download] Destination: Dave_Pearce_-_Now_We_Are_Free_Remix-RJ2Xi3e1xzE.flv
[download] 100.0% of 7.85M at   54.26k/s ETA 00:00
[ffmpeg] Destination: Dave_Pearce_-_Now_We_Are_Free_Remix-RJ2Xi3e1xzE.mp3
ERROR: audio conversion failed: Unknown encoder 'libmp3lame'

And a different one:

$ youtube-dl -v --extract-audio -t --audio-format=mp3 --console-title "https://www.youtube.com/watch?v=r0E-0ntoNWo"
[debug] Proxy map: {}
[youtube] Setting language
[youtube] r0E-0ntoNWo: Downloading video webpage
[youtube] r0E-0ntoNWo: Downloading video info webpage
[youtube] r0E-0ntoNWo: Extracting video information
[download] Resuming download at byte 5241856
[download] Destination: Mocha_in_His_First_Broccoli-r0E-0ntoNWo.flv
[download] 100.0% of 7.35M at    6.10M/s ETA 00:00
[ffmpeg] Destination: Mocha_in_His_First_Broccoli-r0E-0ntoNWo.mp3
ERROR: audio conversion failed: Unknown encoder 'libmp3lame'

mp3lame is installed:

$ locate libmp3lame
/usr/local/lib/libmp3lame.a
/usr/local/lib/libmp3lame.la
/usr/local/lib/libmp3lame.so
/usr/local/lib/libmp3lame.so.0

Using the default format works fine:

$ youtube-dl -v --extract-audio -t --console-title "https://www.youtube.com/watch?v=r0E-0ntoNWo"
[debug] Proxy map: {}
[youtube] Setting language
[youtube] r0E-0ntoNWo: Downloading video webpage
[youtube] r0E-0ntoNWo: Downloading video info webpage
[youtube] r0E-0ntoNWo: Extracting video information
[download] Mocha_in_His_First_Broccoli-r0E-0ntoNWo.flv has already been downloaded
[ffmpeg] Destination: Mocha_in_His_First_Broccoli-r0E-0ntoNWo.aac

I am using:

FreeBSD 9.0 amd64
lame-3.99.4
youtube_dl-2012.02.27
python27-2.7.2_4

@VxJasonxV
Copy link

@VxJasonxV VxJasonxV commented Mar 4, 2012

What about your ffmpeg version and available modules?

@ghost
Copy link
Author

@ghost ghost commented Mar 4, 2012

I just found out that ffmpeg isn't linked against lame. I rebuilt it with lame support and everything works as expected.

@ghost ghost closed this Mar 4, 2012
@reagle
Copy link

@reagle reagle commented Sep 17, 2012

youtube-dl -o '%(stitle)s' --extract-audio http://www.youtube.com/watch?v=3XBN72tQEvk will give me a file called aac. Otherwise:

`youtube-dl -o '%(stitle)s' --extract-audio --audio-format=libmp3lame http://www.youtube.com/watch?v=3XBN72tQEvk
Usage: youtube-dl [options] url [url...]

youtube-dl: error: invalid audio format specified
`

@g2g
Copy link

@g2g g2g commented Oct 6, 2012

youtube-dl -o '%(stitle)s' --extract-audio --audio-format mp3 http://www.youtube.com/watch?v=3XBN72tQEvk will only work if you install libmp3lame.
So, install this package (Debian flavour)
sudo apt-get install -y libavcodec-extra-53
Cheers,
Laurent.

@FiloSottile
Copy link
Collaborator

@FiloSottile FiloSottile commented Oct 6, 2012

Also, in the -o must compare the extension, so -o '%(stitle)s.%(ext)s' is the correct option.

@andreas-e
Copy link

@andreas-e andreas-e commented Dec 1, 2012

@g2g I doubt this will work on Debian.

I have Debian myself, and libavcodec-extra-53 will only provide the following (quoting):

This package is a replacement for the regular libavcodec53 library package; it contains the following additional codecs:

  • OpenCORE Adaptive Multi-Rate (AMR) Narrow-Band (Encoder/Decoder)
  • OpenCORE Adaptive Multi-Rate (AMR) Wide-Band (Decoder)
  • Android VisualOn AAC (Encoder)

* Android VisualOn Adaptive Multi-Rate (AMR) Wide-Band (Encoder)

So on Debian you will neither win nor lose anything.

Your method, however, works fine on Ubuntu where the extra package actually does contain the mp3 codecs.

@markitics
Copy link

@markitics markitics commented Oct 22, 2014

In case relevant, I'm running youtube-dl on a heroku django app.

This works for me to run on heroku server:

(1) in heroku config

BUILDPACK_URL:                https://github.com/ddollar/heroku-buildpack-multi.git

See http://blog.pogoapp.com/youtube-mp3-with-node-js-and-ffmpeg/ for instructions
This references the two buildpacks in .buildpacks
Note: this included lame support, but I got an ffprobe error until I edited requirements.txt (see step 3)

(2) in a file called .buildpacks (this sits in root, alongside files like .env and requirements.txt)

https://github.com/jayzes/heroku-buildpack-ffmpeg.git
https://github.com/heroku/heroku-buildpack-python.git

That's also from http://blog.pogoapp.com/youtube-mp3-with-node-js-and-ffmpeg/ for instructions
but I've put "python" for me instead of node. You can put ruby or other as required, see https://devcenter.heroku.com/articles/buildpacks#default-buildpacks

(3) in requirements.txt

youtube-dl==2014.09.25
ffprobe

Adding that ffprobe explicitly solved all mp3 codec errors


Now when I run heroku run bash:

.....$ heroku run bash
Running `bash` attached to terminal... up, run.4970
~ $ ffprobe
ffprobe version git-2013-08-02-b3f858b Copyright (c) 2007-2013 the FFmpeg developers
  built on Aug  2 2013 01:49:41 with gcc 4.4.3 (Ubuntu 4.4.3-4ubuntu5.1)
  configuration: --enable-shared --enable-gpl --enable-libmp3lame --enable-avfilter --disable-asm --prefix=/app/vendor/ffmpeg --extra-cflags='-I/app/vendor/x264/include -I/app/vendor/mp3lame/include' --extra-ldflags='-L/app/vendor/x264/lib -L/app/vendor/mp3lame/lib'
  libavutil      52. 40.100 / 52. 40.100
  libavcodec     55. 19.100 / 55. 19.100
  libavformat    55. 12.102 / 55. 12.102
  libavdevice    55.  3.100 / 55.  3.100
  libavfilter     3. 82.100 /  3. 82.100
  libswscale      2.  4.100 /  2.  4.100
  libswresample   0. 17.103 /  0. 17.103
  libpostproc    52.  3.100 / 52.  3.100
Simple multimedia streams analyzer
usage: ffprobe [OPTIONS] [INPUT_FILE]

You have to specify one input file.
Use -h to get full help or, even better, run 'man ffprobe'.
~ $ ffmpeg
ffmpeg version git-2013-08-02-b3f858b Copyright (c) 2000-2013 the FFmpeg developers
  built on Aug  2 2013 01:49:41 with gcc 4.4.3 (Ubuntu 4.4.3-4ubuntu5.1)
  configuration: --enable-shared --enable-gpl --enable-libmp3lame --enable-avfilter --disable-asm --prefix=/app/vendor/ffmpeg --extra-cflags='-I/app/vendor/x264/include -I/app/vendor/mp3lame/include' --extra-ldflags='-L/app/vendor/x264/lib -L/app/vendor/mp3lame/lib'
  libavutil      52. 40.100 / 52. 40.100
  libavcodec     55. 19.100 / 55. 19.100
  libavformat    55. 12.102 / 55. 12.102
  libavdevice    55.  3.100 / 55.  3.100
  libavfilter     3. 82.100 /  3. 82.100
  libswscale      2.  4.100 /  2.  4.100
  libswresample   0. 17.103 /  0. 17.103
  libpostproc    52.  3.100 / 52.  3.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

Use -h to get full help or, even better, run 'man ffmpeg'
~ $ 
@andreas--e
Copy link

@andreas--e andreas--e commented Dec 16, 2014

Oh, what an old issue. --audio-format=mp3 works perfectly here now on Lubuntu (I've moved away from Debian since, but thanks for the trip down memory lane LOL)

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