[FFmpeg-user] RAW audio to MP3 via ffmpeg

James Lu luj125 at gmail.com
Tue Aug 23 03:04:30 CEST 2011

On Mon, Aug 22, 2011 at 8:49 PM, Glau Stuff
<glau.stuff at ridiculousprods.com>wrote:

> I've got a .raw audio file I'd like to convert to MP3 using ffmpeg. I know
> that I could first convert it using sox with something like:
> sox -r 44100 -e unsigned -b 8 -c1 test_file.raw test_file.wav
> And then use ffmpeg to convert the WAV to MP3.
> But I want to skip a sox pass if I can and go straight to MP3.  Is that
> possible? I saw mention of raw formats in the documentation but not a set
> of
> commands specific for audio (unless I missed it)
> --
> Phil
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user

Hi Phil,

ffmpeg is really awesome, it should do any encoding you want. just go ahead
and do what you think you should:

ffmpeg -i input.raw -acodec libmp3 output.mp3

With encoding, you want to put in as many options as you can, so I suggest
using -ab. Check the documentation for more commands

Some tips:
1) use ffmpeg -formats and ffmpeg -codecs to check for which formats and
codecs are available for your build of ffmpeg
2) for audio manipulations, sox and audacity are usually better
alternatives, but ffmpeg has a much larger array of formats available.

Hope this helps,

More information about the ffmpeg-user mailing list