How to Adjust FLAC Compression Level in FFmpeg

This article explains how to change the compression level when encoding audio to FLAC using FFmpeg. You will learn the exact command-line syntax to adjust this setting, understand how the compression scale from 0 to 8 impacts file size and encoding speed, and see practical examples of high-compression and fast-encoding commands.

In FFmpeg, you control the FLAC compression level using the -compression_level option (or the alias -lpc_passes). FLAC is a lossless format, meaning that changing the compression level only affects the encoding speed and the resulting file size, not the audio quality. The compression scale ranges from 0 to 8:

Basic Syntax

To set the compression level, place the -compression_level flag after specifying the FLAC encoder (-c:a flac):

ffmpeg -i input.wav -c:a flac -compression_level 5 output.flac

Examples

Maximum Compression (Level 8) If you want to save as much disk space as possible and do not mind a longer encoding process, use level 8:

ffmpeg -i input.wav -c:a flac -compression_level 8 output.flac

Fastest Encoding (Level 0) If you are encoding large batches of files and speed is your main priority, use level 0:

ffmpeg -i input.wav -c:a flac -compression_level 0 output.flac

By adjusting this single parameter, you can easily optimize FFmpeg’s FLAC encoder to suit either high-speed workflows or storage-efficient archiving.