This article describes some basic audio format conversions using ffmpeg utility. All ffmpeg format conversion commands use default ffmpeg setting. User should alter below commands to increase or decrease audio quality with additional ffmpeg options. All commands are performed on the following environment:

OS: Debian 6.0 Squeeze ( with multimedia repository, package: libavcodec52 )

Kernel: 2.6.32-5.686

Audio

WAV - Waveform Audio File Format

wav to mp3

Convert wav to mp3 with ffmpeg:

ffmpeg -i audio.wav -acodec libmp3lame audio.mp3

wav to ogg

Convert wav to ogg with ffmpeg:

ffmpeg -i audio.wav  -acodec libvorbis audio.ogg

wav to aac

Convert wav to acc with ffmpeg:

ffmpeg -i audio.wav  -acodec libfaac audio.aac

wav to ac3

Convert wav to ac3 with ffmpeg:

ffmpeg -i audio.wav -acodec ac3 audio.mp3

OGG - Free, open standard container

ogg to mp3

Convert ogg to mp3 with ffmpeg:

ffmpeg -i audio.ogg -acodec libmp3lame audio.mp3

ogg to wav

Convert ogg to wav with ffmpeg:

ffmpeg -i audio.ogg audio.wav

ogg to aac

Convert ogg to aac with ffmpeg:

ffmpeg -i audio.ogg  -acodec libfaac audio.aac

ogg to ac3

Convert ogg to ac3 with ffmpeg:

ffmpeg -i audio.ogg -acodec ac3 audio.ac3

AC3 - Acoustic Coder 3

ac3 to mp3

Convert ac3 to mp3 with ffmpeg:

ffmpeg -i audio.ac3 -acodec libmp3lame audio.mp3

ac3 to wav

Convert ac3 to wav with ffmpeg:

ffmpeg -i audio.ac3 audio.wav

ac3 to aac

Convert ac3 to aac with ffmpeg:

ffmpeg -i audio.ac3  -acodec libfaac audio.aac

ac3 to ogg

Convert ac3 to ogg with ffmpeg:

ffmpeg -i audio.ac3 -acodec libvorbis audio.ogg

AAC - Advanced Audio Coding

aac to mp3

Convert aac to mp3 with ffmpeg:

ffmpeg -i audio.aac -acodec libmp3lame audio.mp3

aac to wav

Convert aac to wav with ffmpeg:

ffmpeg -i audio.aac audio.wav

aac to ac3

Convert aac to ac3 with ffmpeg:

ffmpeg -i audio.aac  -acodec ac3 audio.ac3

aac to ogg

Convert aac to ogg with ffmpeg:

ffmpeg -i audio.aac -libvorbis audio.ogg