Times have changed from the days of Ubuntu 9.10 (when this question was originally asked) and now a modern version of FFmpeg in a recent Ubuntu release has both an encoder and decoder for the caf (Core Audio Format) container. Test your own modern version of FFmpeg as follows for 'D'ecoding and 'E'ncoding with caf:
ffmpeg -formats 2>/dev/null | grep caf
DE caf Apple CAF (Core Audio Format)
We can test with the following sample .caf
file:
wget samples.mplayerhq.hu/A-codecs/caf/waterfall.caf
And an easy conversion to mp3 with FFmpeg:
ffmpeg -i waterfall.caf -hide_banner -ac 1 test.mp3
[caf @ 0x66e8c0] Estimating duration from bitrate, this may be inaccurate
Guessed Channel Layout for Input Stream #0.0 : mono
Input #0, caf, from 'waterfall.caf':
Duration: 00:00:01.95, start: 0.000000, bitrate: 722 kb/s
Stream #0:0: Audio: pcm_s16le (lpcm / 0x6D63706C), 44100 Hz, mono, s16, 705 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (pcm_s16le (native) -> mp3 (libmp3lame))
Press [q] to stop, [?] for help
Output #0, mp3, to 'test.mp3':
Metadata:
TSSE : Lavf58.10.100
Stream #0:0: Audio: mp3 (libmp3lame), 44100 Hz, mono, s16p
Metadata:
encoder : Lavc58.13.100 libmp3lame
size= 16kB time=00:00:01.96 bitrate= 65.7kbits/s speed=75.6x
video:0kB audio:16kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.429291%
How cool is the command line :)
For MP3, I strongly suggest using Lame
, considered by many (including me) THE best MP3 encoder, specially for VBR.
sudo apt-get install lame
And to encode:
lame -V 5 file.wav file.mp3
This will create a high-quality MP3 VBR file around ~130kbps, which is great for casual listening. Use -V 3
for average bitrates around ~200kbps
If you want to create id3v1 and id3v2 tags at the same time, you can use:
lame -V 5 --add-id3v2 --pad-id3v2 --ignore-tag-errors --ta artist --tl album --tt title --tn track --ty year --tg genre --tc comment file.wav file.mp3
For OGG, the most traditional encoder is Vorbis
sudo apt-get install vorbis-tools
And to encode:
oggenc -q 3 -o file.ogg file.wav
Ogg is VBR by default. -q 3
stands for default quality, you may change 3 from -1 to 10, or omit the option. Also, output file is optional. If you omit -o file.ogg
it will automatically create a file with same name as input and .ogg extension. It also supports multiple input files (you can encode several at once, for example, using *.wav)
And for tagging:
oggenc -a artist -t title -l album -G genre -c comment -o file.ogg file.wav
Last but not least, since you seem to be very interested in encoding, an amazing forum for audio technical details and awesome source of knowledge is HydrogenAudio
And, for GUI, you said it yourself: soundconverter
is a great choice. It does have VBR for MP3 (for OGG, its the format's default, so don't worry).
Best Answer
1) add medibuntu repository. Instructions here
2) install ffmpeg libavcodec-extra-53
3) Run
ffmpeg -i inputfile.ra outputfile.mp3
To use this through a GUI: