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.flac

Understanding the Command Parameters

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.flac

Verifying 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.flac

The output should display bits_per_raw_sample=24, confirming a successful 24-bit lossless transcode.