How to Set AAC-LD Audio Profile in FFmpeg

This article provides a quick, step-by-step guide on how to configure FFmpeg to encode audio using the AAC-LD (Advanced Audio Coding Low Delay) profile. You will learn about the required encoder library, the specific command-line flags needed to enable this profile, and a practical command-line example to achieve low-latency audio encoding.

To encode audio using the AAC-LD profile in FFmpeg, you cannot use the default native AAC encoder, as it does not support this specific low-delay profile. Instead, you must use the external Fraunhofer FDK AAC library (libfdk_aac). This requires a version of FFmpeg that has been compiled with the --enable-libfdk-aac flag (and typically --enable-nonfree due to licensing).

Step 1: Select the FDK AAC Encoder

First, specify the FDK AAC encoder in your FFmpeg command using the audio codec flag:

-c:a libfdk_aac

Step 2: Set the AAC-LD Profile

To restrict the encoder to the Low Delay profile, use the -profile:a option followed by aac_ld:

-profile:a aac_ld

Complete Command Example

Combine these parameters with your input and output files. The following command takes an input audio file and converts it to an AAC-LD encoded audio file inside an M4A container:

ffmpeg -i input.wav -c:a libfdk_aac -profile:a aac_ld output.m4a

Alternative: Enhanced Low Delay (AAC-ELD)

If you require better audio quality at lower bitrates while maintaining low latency, you can opt for the Enhanced Low Delay (AAC-ELD) profile instead. To use AAC-ELD, change the profile value to aac_eld:

ffmpeg -i input.wav -c:a libfdk_aac -profile:a aac_eld output.m4a

By using these settings, FFmpeg will correctly output an audio stream optimized for VoIP, gaming, and other real-time communication systems where minimal delay is critical.