How to Convert DSD to FLAC Using FFmpeg

This article provides a straightforward, step-by-step guide on how to convert high-resolution DSD (Direct Stream Digital) audio files, such as .dsf and .dff, into the widely compatible FLAC format using the command-line tool FFmpeg. You will learn the exact commands needed to perform the conversion, optimize the output sample rate and bit depth, and batch-process entire folders of music while preserving maximum audio quality.

The Basic Conversion Command

If you have FFmpeg installed on your system, you can perform a basic conversion from DSD (DSF or DFF) to FLAC using a simple command. Open your terminal or command prompt and run:

ffmpeg -i input.dsf output.flac

While this command works, FFmpeg’s default settings may not yield the best audio quality for DSD files. DSD is a 1-bit high-frequency format, whereas FLAC is a PCM (Pulse Code Modulation) format. To get the best sound, you should specify the sample rate and bit depth during the conversion.

DSD64 is sampled at 2.8224 MHz (which is 64 times the CD rate of 44.1 kHz). When converting DSD to PCM-based FLAC, it is best to use a sample rate that is an exact multiple of 44.1 kHz, such as 88.2 kHz or 176.4 kHz, and a bit depth of 24-bit.

Use the following command to convert your DSD file to a 24-bit / 88.2 kHz FLAC file:

ffmpeg -i input.dsf -c:a flac -sample_fmt s32 -ar 88200 output.flac

Command Breakdown:

If you are converting higher-resolution DSD files, such as DSD128 or DSD256, you can increase the sample rate to 176400 (176.4 kHz):

ffmpeg -i input.dsf -c:a flac -sample_fmt s32 -ar 176400 output.flac

Batch Converting Multiple DSD Files

If you have an entire album or folder of DSD files, you can convert all of them at once using a simple command-line loop.

On Windows (Command Prompt):

Navigate to your folder containing the .dsf files and run:

for %i in (*.dsf) do ffmpeg -i "%i" -c:a flac -sample_fmt s32 -ar 88200 "%~ni.flac"

On macOS and Linux (Terminal):

Navigate to your directory and run:

for f in *.dsf; do ffmpeg -i "$f" -c:a flac -sample_fmt s32 -ar 88200 "${f%.*}.flac"; done

(Note: If your files end in .dff instead of .dsf, simply replace *.dsf and .dsf with *.dff and .dff in the scripts above).