Ubuntu

Unknown encoder mp3 error in ffmpeg (ibex)

Reported by mohan43u on 2008-11-11
28
This bug affects 5 people
Affects Status Importance Assigned to Milestone
ffmpeg (Ubuntu)
Undecided
Unassigned

Bug Description

while trying to reduce the size of mp3 file using ffmpeg, I got this error,

$ ffmpeg -i song.MP3 -acodec mp3 -ab 64kb song_new.mp3

FFmpeg version r11872+debian_3:0.svn20080206-12ubuntu3, Copyright (c) 2000-2008 Fabrice Bellard, et al.
  configuration: --enable-gpl --enable-pp --enable-swscaler --enable-x11grab --prefix=/usr --enable-libgsm --enable-libtheora --enable-libvorbis --enable-pthreads --disable-strip --enable-libfaad --enable-libfaadbin --enable-liba52 --enable-liba52bin --enable-libdc1394 --disable-armv5te --disable-armv6 --disable-altivec --disable-vis --enable-shared --disable-static
  libavutil version: 49.6.0
  libavcodec version: 51.50.0
  libavformat version: 52.7.0
  libavdevice version: 52.0.0
  built on Oct 3 2008 22:40:31, gcc: 4.3.2
Input #0, mp3, from 'song.MP3':
  Duration: 00:04:38.8, start: 0.000000, bitrate: 160 kb/s
    Stream #0.0: Audio: mp3, 44100 Hz, stereo, 160 kb/s
Unknown encoder 'mp3'

$ ldd /usr/bin/ffmpeg

 linux-gate.so.1 => (0xb7f19000)
 libavdevice.so.52 => /usr/lib/i686/cmov/libavdevice.so.52 (0xb7ee2000)
 libavformat.so.52 => /usr/lib/i686/cmov/libavformat.so.52 (0xb7e41000)
 libavcodec.so.51 => /usr/lib/i686/cmov/libavcodec.so.51 (0xb78f3000)
 libavutil.so.49 => /usr/lib/i686/cmov/libavutil.so.49 (0xb78e3000)
 libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb78bd000)
 libswscale.so.0 => /usr/lib/i686/cmov/libswscale.so.0 (0xb7890000)
 libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0xb7877000)
 libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7718000)
 libdc1394.so.22 => /usr/lib/libdc1394.so.22 (0xb76ab000)
 libX11.so.6 => /usr/lib/libX11.so.6 (0xb75bc000)
 libXext.so.6 => /usr/lib/libXext.so.6 (0xb75ad000)
 libz.so.1 => /usr/lib/libz.so.1 (0xb7597000)
 libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb7593000)
 libgsm.so.1 => /usr/lib/libgsm.so.1 (0xb7585000)
 libtheora.so.0 => /usr/lib/libtheora.so.0 (0xb753a000)
 libvorbisenc.so.2 => /usr/lib/libvorbisenc.so.2 (0xb7440000)
 libvorbis.so.0 => /usr/lib/libvorbis.so.0 (0xb7416000)
 /lib/ld-linux.so.2 (0xb7eff000)
 libraw1394.so.8 => /usr/lib/libraw1394.so.8 (0xb740f000)
 libxcb-xlib.so.0 => /usr/lib/libxcb-xlib.so.0 (0xb740b000)
 libxcb.so.1 => /usr/lib/libxcb.so.1 (0xb73f2000)
 libXau.so.6 => /usr/lib/libXau.so.6 (0xb73ef000)
 libogg.so.0 => /usr/lib/libogg.so.0 (0xb73e9000)
 libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0xb73e4000)

can somebody help ffmpeg to pick up libmp3lame?

Lionel Le Folgoc (mrpouit) wrote :

Hi,

Thanks for your bug report.
To have mp3 encoding, you need to install the 'libavcodec-unstripped-51' package, and pass '-acodec libmp3lame' instead of '-acodec mp3' in your command line.

Changed in ffmpeg:
status: New → Invalid
mohan43u (mohan43u) wrote :

mokka@mohan-laptop:~/songs$ ffmpeg -i MANRAM_VANTHA.mp3 -acodec libmp3lame -ab 64kb
MANRAM_VANTHA_new.mp3
FFmpeg version r11872+debian_3:0.svn20080206-12ubuntu3, Copyright (c) 2000-2008 Fabrice Bellard, et al.
  configuration: --enable-gpl --enable-pp --enable-swscaler --enable-x11grab --prefix=/usr --enable-libgsm --enable-libtheora --enable-libvorbis --enable-pthreads --disable-strip --enable-libfaad --enable-libfaadbin --enable-liba52 --enable-liba52bin --enable-libdc1394 --disable-armv5te --disable-armv6 --disable-altivec --disable-vis --enable-shared --disable-static
  libavutil version: 49.6.0
  libavcodec version: 51.50.0
  libavformat version: 52.7.0
  libavdevice version: 52.0.0
  built on Oct 3 2008 22:40:31, gcc: 4.3.2
Input #0, mp3, from 'MANRAM_VANTHA.mp3':
  Duration: 00:04:45.5, start: 0.000000, bitrate: 127 kb/s
    Stream #0.0: Audio: mp3, 44100 Hz, stereo, 128 kb/s
Output #0, mp2, to 'MANRAM_VANTHA_new.mp3':
    Stream #0.0: Audio: libmp3lame, 44100 Hz, stereo, 64 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
Press [q] to stop encoding
size= 2231kB time=285.6 bitrate= 64.0kbits/s
video:0kB audio:2231kB global headers:0kB muxing overhead 0.000000%
mokka@mohan-laptop:~/songs$

mokka@mohan-laptop:~/songs$ file MANRAM_VANTHA*
MANRAM_VANTHA.mp3: MPEG ADTS, layer III, v1, 128 kbps, 44.1 kHz, Stereo
MANRAM_VANTHA_new.mp3: MPEG ADTS, layer III, v1, 64 kbps, 44.1 kHz, JntStereo
mokka@mohan-laptop:~/songs$

Lionel,

Thanks for the suggession, ffmpeg converted correctly, but when converting, ffmpeg still shows 'mp2'?

Output #0, mp2, to 'MANRAM_VANTHA_new.mp3':

is this a bug in ffmpeg?

Thanks.

mohan43u (mohan43u) on 2008-11-12
description: updated
mohan43u (mohan43u) wrote :

this will be fixed by installing 'libavcodec-unstripped-51' package

gari126 (gari126) wrote :

I confirm also that installing 'libavcodec-unstripped-52' solved the issue on my Ubuntu 9.04

I confirm that installing 'libavcodec-unstripped-52' solved the issue on Ubuntu 9.10 aka Karmic Koala.

Following works now (both didn't work before installing the package)

    ffmpeg -i input.wav output.mp3
    ffmpeg -i input.wav -acodec libmp3lame output.mp3

thanks!

Raf Espanol (rafespanol) wrote :

hi, this post also helped me out on ubuntu 10.10 . as a followup for those who still don't know how to update libavcodec on ubuntu 10.10:

raf@samoslinux:~$ sudo apt-get install libavcodec-unstripped-52
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libmodplug1 libtagc0 libnetclasses0 libpopplerkit0 libavifile-0.7c2
  libmpcdec6
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  libavcodec-extra-52 libavutil-extra-50 libdirac-encoder0 libfaad2
  libopenjpeg2
Suggested packages:
  libfaad0
The following packages will be REMOVED:
  libavcodec52 libavutil50
The following NEW packages will be installed:
  libavcodec-extra-52 libavcodec-unstripped-52 libavutil-extra-50
  libdirac-encoder0 libfaad2 libopenjpeg2
0 upgraded, 6 newly installed, 2 to remove and 0 not upgraded.
Need to get 5,504kB of archives.
After this operation, 1,438kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://us.archive.ubuntu.com/ubuntu/ maverick/universe libavutil-extra-50 i386 4:0.6-2ubuntu3 [112kB]
...clipped for shortness...

after that

raf@samoslinux:~$ ffmpeg -i 4PbTOFQ4JOs.flv -acodec mp3 fff.mp3
FFmpeg version 0.6-4:0.6-2ubuntu6, Copyright (c) 2000-2010 the FFmpeg developers
  built on Oct 5 2010 22:35:47 with gcc 4.4.5
  configuration: --extra-version=4:0.6-2ubuntu6 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau
...clipped again to keep it short

... audiodatarate : 119
    totaldatarate : 731
    framerate : 30
    bytelength : 35757512
    canseekontime : true
    sourcedata : B4A7DD146MM1289927317339780
    purl :
    pmsg :
  Duration: 00:06:31.06, start: 0.000000, bitrate: 739 kb/s
    Stream #0.0: Video: h264, yuv420p, 640x480 [PAR 1:1 DAR 4:3], 617 kb/s, 29.97 tbr, 1k tbn, 60 tbc
    Stream #0.1: Audio: aac, 44100 Hz, stereo, s16, 122 kb/s
Output #0, mp3, to 'fff.mp3':
  Metadata:
    TSSE : Lavf52.64.2
    Stream #0.0: Audio: libmp3lame, 44100 Hz, stereo, s16, 64 kb/s
Stream mapping:
  Stream #0.1 -> #0.0
Press [q] to stop encoding
size= 3060kB time=391.65 bitrate= 64.0kbits/s
video:0kB audio:3060kB global headers:0kB muxing overhead 0.001053%
raf@samoslinux:~$ ls *.mp3
4PbTOFQ4JOs.mp3 fff.mp3 oo.mp3
raf@samoslinux:~$

again thanks for the clues.

raf

intuited (intuited) wrote :

Having this problem under 10.10 -- getting the message "Unknown encoder 'mp3'" when trying to convert passing `-acodec mp3`. I get the same message if I pass `libmp3lame` or even `ogg`.

Attempting to install libavcodec-unstripped-52 gives

vvvvvvvvvvvvvvvvvvvvvvvvv
The following NEW packages will be installed:
  libavcodec-extra-52{ab} libavcodec-unstripped-52 libavutil-extra-50{ab} libdirac-encoder0{a} libopencore-amrnb0{a} libopencore-amrwb0{a} libopenjpeg2{a}
0 packages upgraded, 7 newly installed, 0 to remove and 4 not upgraded.
Need to get 3,278kB of archives. After unpacking 7,500kB will be used.
The following packages have unmet dependencies:
  libavutil-extra-50: Conflicts: libavutil50 but 4:0.6-2ubuntu6.1 is installed.
  libavcodec-extra-52: Conflicts: libavcodec52 but 4:0.6-2ubuntu6.1 is installed.
The following actions will resolve these dependencies:

     Remove the following packages:
1) libavcodec52
2) libavutil50

Accept this solution? [Y/n/q/?] q
^^^^^^^^^^^^^^^^^^^^^^^^^

What's going on here? Why are there two different pairs of packages that seem to do the same thing?

Also: if I run `ffmpeg -codecs` it lists mp3 as one of the available codecs. Is that a different bug?

bitinerant (bitinerant) wrote :

@intuited - You're doing the right thing. Just type 'y' rather than 'q'. It needs to remove those two packages, but will install alternate packages which satisfy all the necessary dependencies.

I suspect that the pairs of packages "that seem to do the same thing" are for legal reasons--one includes full MP3 support and the other only includes MP3 decompression support. Someone correct me if I'm wrong.

Alastair Gilfillan (alastair-a) wrote :

@mrpouit Why is this considered invalid?

`avconv -formats | grep \mp3` lists "DE mp3 MPEG audio layer 3" yet I'm told mp3 is an unknown encoder.

In 2013, `sudo apt-get install libavcodec-extra-53` fixes this.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers