Trying to figure out ffmpeg, currently working on getting 24bit/96khz FLAC files into 16bit/48khz.
ffmpeg FLAC 24 bit 96khz to 16 bit 48khz
27.8k views Asked by Corey At
2
There are 2 answers
0
On
As a bash script, that produces new files with -16 appended to their names; one could rename then delete the original files easily in the script but I'm a little too paranoid for that.
#!/bin/sh
# requires: ffmpeg
for f in *.flac;
do
echo "Processing $f"
ffmpeg -i "$f" -sample_fmt s16 -ar 48000 "${f%.flac}-16.flac"
done
Basic example
ffmpeg -sample_fmts
ffmpeg -h encoder=flac
aresample filter example
Either example will result in the same output: you can verify with the hash muxer.
Changing the dithering method
See the
-dither_method
option for a list of available dithering methods and additional resampling options. Example:SoX resampler
FFmpeg supports two resamplers: the default swresample library, and the external SoX resampler (soxr).
To use soxr your
ffmpeg
must be compiled with--enable-libsoxr
. Then choose it with the-resampler
option:Or use the aresample filter to do it all:
More info