rg3/youtube-dl — Issue #302: --audio-format=mp3 leads to encoder failure
Author: roxorzfoo
Created: 2012-03-04 09:43:09+00:00
State: open

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