Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How can I convert FLAC to MP3 using FFmpeg?

What I've tried:

ffmpeg -i "file.flac"  "file.mp3"

Stream mapping:
  Stream #0:0 -> #0:0 (flac -> ?)
Encoder (codec none) not found for output stream #0:0

file.mp3 is empty


ffmpeg -codecs | grep flac
ffmpeg version N-46093-g14f69a0 Copyright (c) 2000-2012 the FFmpeg developers
  built on Oct 28 2012 15:24:03 with gcc 4.4.6 (GCC) 20120305 (Red Hat 4.4.6-4)
  configuration: --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-pic --enable-thumb --enable-libfaac --enable-gpl --enable-nonfree
  libavutil      52.  1.100 / 52.  1.100
  libavcodec     54. 69.100 / 54. 69.100
  libavformat    54. 35.100 / 54. 35.100
  libavdevice    54.  3.100 / 54.  3.100
  libavfilter     3. 20.106 /  3. 20.106
  libswscale      2.  1.101 /  2.  1.101
  libswresample   0. 16.100 /  0. 16.100
  libpostproc    52.  1.100 / 52.  1.100
 DEA..S flac                 FLAC (Free Lossless Audio Codec)


ffmpeg -codecs | grep mp3
ffmpeg version N-46093-g14f69a0 Copyright (c) 2000-2012 the FFmpeg developers
  built on Oct 28 2012 15:24:03 with gcc 4.4.6 (GCC) 20120305 (Red Hat 4.4.6-4)
  configuration: --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-pic --enable-thumb --enable-libfaac --enable-gpl --enable-nonfree
  libavutil      52.  1.100 / 52.  1.100
  libavcodec     54. 69.100 / 54. 69.100
  libavformat    54. 35.100 / 54. 35.100
  libavdevice    54.  3.100 / 54.  3.100
  libavfilter     3. 20.106 /  3. 20.106
  libswscale      2.  1.101 /  2.  1.101
  libswresample   0. 16.100 /  0. 16.100
  libpostproc    52.  1.100 / 52.  1.100
 D.A.L. mp3                  MP3 (MPEG audio layer 3) (decoders: mp3 mp3float )
 D.A.L. mp3adu               ADU (Application Data Unit) MP3 (MPEG audio layer 3) (decoders: mp3adu mp3adufloat )
 D.A.L. mp3on4               MP3onMP4 (decoders: mp3on4 mp3on4float )
share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

Your version of FFmpeg has no MP3 encoder. It can only decode, as indicated by the "D" in the command line output.

If you built it yourself, install LAME before — this depends on your distribution — and then reconfigure it --with-libmp3lame.

Or pick a static build from the FFmpeg download page.

This should give you access to the de facto standard MP3 encoder.

share|improve this answer
    
@teslasimus In addition to what slhck said, ffmpeg currently supports LAME versions ≥ 3.98.3. –  LordNeckbeard Dec 8 '12 at 23:12
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.