SoX vs. ffmpeg to take a 24-bit FLAC to 16-bit WAV?

Effects, Recipes, Interfacing with other software, etc.
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
Post Reply
allencmcbride
Posts: 149
Joined: Wed Jul 30, 2008 2:02 am
Operating System: Please select

SoX vs. ffmpeg to take a 24-bit FLAC to 16-bit WAV?

Post by allencmcbride » Sun Mar 08, 2009 10:33 pm

I need to write a shell script to turn a bunch of 24-bit FLAC files into VBR MP3 files with a particular quality setting. I'm thinking I should not use ffmpeg to do this in one step, because as Koz has said, it's best to downsample to 16 bits before encoding an MP3. So I'm thinking my first step should be to go from 24-bit flac to 16-bit wav, and then my second step should be to encode the wav to mp3. I know how to use the LAME command-line utility for the second step, but what about the first step? It seems like ffmpeg or sox would do it, but would one or the other be better?

On the one hand, I read somewhere that codecs' built-in downsampling routines are low-quality, so one should use a separate downsampler. And sox seems to use libsamplerate, while I assume ffmpeg uses the codecs' built-in routines. On the other hand, sox's package says it "doesn't do anything very well", so I figure I should be wary.

Thanks for any advice.
--Allen

allencmcbride
Posts: 149
Joined: Wed Jul 30, 2008 2:02 am
Operating System: Please select

Re: SoX vs. ffmpeg to take a 24-bit FLAC to 16-bit WAV?

Post by allencmcbride » Mon Mar 09, 2009 2:39 am

Never mind... I now realize I wasn't even using the word "downsample" correctly... (what's the word for changing bit depth, anyway?) And I figured out how to do this with SoX and it sounds fine to my ears. So I think I'm okay. But I won't delete my original post, just in case anyone has more interesting insight to offer, as is often the case around here. --Allen

steve
Site Admin
Posts: 81627
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: SoX vs. ffmpeg to take a 24-bit FLAC to 16-bit WAV?

Post by steve » Mon Mar 09, 2009 9:23 pm

Not really answering your question, but thought you may be interested.
By default Audacity uses libresample, but may be compiled to use libsamplerate.

Note that there was a bug in Audacity that only allowed the slower high quality setting to be used (reducing multi-track performance in Audacity), but this has now been fixed in cvs. I wrote a bit about it here: http://www.audacityteam.org/forum/viewt ... =28&t=8555
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Post Reply