[FFmpeg-user] Preserve bitdepth of input audio file during conversion to wav

Michal Šmucr msmucr at gmail.com
Wed Nov 27 13:04:39 CET 2013


Hello to all,

i would like to ask you. Is there any FFmpeg option or trick to
preserve bitdepth of input file during decompression to wave file?
For instance during conversion of 24bit FLAC or ALAC audio to WAV.
When i use straight "ffmpeg -i whatever-24bit.flac output.wav",
resulting file is always coded as PCM_S16LE.
I didn't find any way, how to do this, except of some wrapper script,
which will run ffmpeg or ffprobe before conversion, parse it's output
for audio stream info and set proper format to subsequent conversion.
However this approach is quite cumbersome, because it needs to lookup
in some table with corresponding formats for particular codec as for
instance ALAC with bitdepth > 16bit has format PCM_S32P which usually
needs to be adjusted to PCM_S24LE for output wav. And on Windows it
also requires to install some additional script interpreter (like
cygwin bash and coreutils or python).

Thanks

Michal


More information about the ffmpeg-user mailing list