Convert Audio to 24-Bit FLAC Using FFmpeg
This article provides a quick and direct guide on how to transcode audio files into the lossless FLAC format with a 24-bit depth using the FFmpeg command-line tool. You will learn the precise command-line arguments required to force 24-bit output, adjust sample rates, and verify that your output file is truly lossless high-resolution audio.
To transcode any audio file to a 24-bit FLAC file, use the following basic FFmpeg command structure in your terminal or command prompt:
ffmpeg -i input.wav -c:a flac -sample_fmt s32 output.flacUnderstanding the Command Parameters
-i input.wav: Specifies the path to your input audio file (this can be WAV, MP3, ALAC, or any other format supported by FFmpeg).-c:a flac: Selects the native FFmpeg FLAC encoder.-sample_fmt s32: Forces the encoder to use a 32-bit sample format. Because the FLAC format standard does not support true 32-bit integer depth, the FFmpeg FLAC encoder automatically transcodes this to a high-quality 24-bit depth.output.flac: The name and format of the resulting output file.
Preserving or Changing the Sample Rate
By default, FFmpeg will preserve the original sample rate of the
input file (e.g., 44.1 kHz or 48 kHz). If you need to resample the audio
to a specific high-resolution rate (such as 96 kHz) during the
conversion, add the -ar flag:
ffmpeg -i input.wav -c:a flac -sample_fmt s32 -ar 96000 output_96k.flacVerifying the Output Bit Depth
After transcoding, you can verify that the output file is indeed
24-bit by using the ffprobe tool, which is included with
your FFmpeg installation:
ffprobe -v error -show_entries stream=sample_fmt,bits_per_raw_sample -of default=noprint_wrappers=1 output.flacThe output should display bits_per_raw_sample=24,
confirming a successful 24-bit lossless transcode.