The choice of AAC encoder is one of the operational decisions every streaming pipeline makes, often without realizing it. ffmpeg ships with its native AAC encoder; many production pipelines use FDK-AAC (Fraunhofer's reference encoder) for quality reasons. The difference matters at lower bitrates (sub-128 kbps) where psychoacoustic modeling separates good encoders from acceptable ones. The licensing trade-off (FDK-AAC has redistribution restrictions) makes the choice non-trivial. This page is the engineering reference for picking the right AAC encoder for your pipeline.
The two encoders
ffmpeg native AAC encoder (-c:a aac in ffmpeg) — the open-source AAC encoder bundled with ffmpeg. Active development; quality has improved meaningfully in 2024-2025 versions. LGPL-licensed; redistributable; available in essentially every ffmpeg build.
FDK-AAC encoder (-c:a libfdk_aac) — Fraunhofer's reference AAC encoder. The de facto industry standard for production AAC encoding. Quality at low bitrates is meaningfully better than ffmpeg native. Licensing requires explicit Fraunhofer agreement; not redistributable as part of GPL projects. Available only in custom-built ffmpeg.
Quality comparison at common bitrates
Subjective quality difference between FDK-AAC and ffmpeg native AAC (representative content corpus, MOS-style listening):
| Bitrate (stereo) | FDK-AAC | ffmpeg native | Practical difference |
|---|---|---|---|
| 64 kbps | Acceptable | Noticeably worse | Audible difference; FDK clearly better |
| 96 kbps | Good | Acceptable | Small audible difference; FDK better |
| 128 kbps | Very good | Good | Subtle difference; FDK slightly better |
| 192 kbps | Excellent | Very good | Difficult to distinguish in casual listening |
| 256 kbps | Transparent | Transparent | No audible difference |
| 320 kbps | Transparent | Transparent | No audible difference |
The pattern: FDK is meaningfully better at low bitrates where psychoacoustic modeling matters most. Above 192 kbps, the encoders converge — both are essentially transparent for typical content.
Why FDK is better at low bitrates
The technical reasons:
Better psychoacoustic model — FDK's masking model is more sophisticated. It identifies what frequencies can be masked by louder neighbors and allocates bits accordingly. ffmpeg native's masking model is functional but less refined.
Better M/S stereo coding — Mid/Side stereo coding (encode mid and side channels rather than left/right) compresses better when stereo correlation is high. FDK's M/S decision-making is more aggressive when appropriate.
Better intensity stereo coding — at very low bitrates, intensity stereo coding (encode level differences without phase) helps. FDK uses it more effectively.
More refined window switching — AAC switches between long and short transform windows for transient handling. FDK's window-switching heuristic is better-tuned.
These aren't dramatic differences; they're cumulative refinements. At 64 kbps where every bit matters, they add up. At 192+ kbps where bits are abundant, they're invisible.
Licensing reality
FDK-AAC's licensing is complex enough to be a real production decision:
FDK-AAC source code license — non-redistributable. You can't include FDK-AAC source in a redistributable product. The Fraunhofer license permits use; it doesn't permit redistribution to other parties.
Streaming AAC patent license — separate from FDK-AAC's source license. The patent license (administered by Via Licensing) covers the AAC codec format itself. Required for commercial AAC streaming regardless of which encoder produces the bitstream.
Practical implication for pipelines:
- Internal use (you build your own ffmpeg with libfdk-aac for your own encoding service) — fine. No redistribution.
- Distributing software with FDK-AAC — not allowed. You can't ship a desktop app or open-source project with FDK-AAC included.
- SaaS using FDK-AAC — you build internally, customers consume the encoded output. Generally acceptable.
- Open-source project with FDK-AAC — not allowed. Use ffmpeg native instead.
For streaming services that build their own encoding infrastructure, FDK-AAC is workable. For products that ship encoder software, ffmpeg native is the licensing-compliant choice.
Building ffmpeg with FDK-AAC
Most distributions don't include FDK-AAC by default (because of the licensing). To use FDK-AAC, build ffmpeg yourself:
- Get FDK-AAC source — clone from
https://github.com/mstorsjo/fdk-aac(the maintained mirror). - Build FDK-AAC:
cd fdk-aac ./autogen.sh ./configure --prefix=/opt/fdk-aac make && sudo make install - Build ffmpeg with FDK support:
./configure --enable-libfdk-aac --enable-nonfree --extra-cflags="-I/opt/fdk-aac/include" --extra-ldflags="-L/opt/fdk-aac/lib" make sudo make install
The --enable-nonfree flag is required because FDK-AAC's licensing makes the resulting ffmpeg "non-free" (not redistributable). The build is for internal use only.
For containerized production (Docker), build the ffmpeg image with FDK-AAC and use it internally; don't push the image to public registries.
CLI usage
FDK-AAC at constant bitrate:
ffmpeg -i input.mov -c:v copy -c:a libfdk_aac -b:a 192k output.mp4
FDK-AAC at variable bitrate:
ffmpeg -i input.mov -c:v copy -c:a libfdk_aac -vbr 4 output.mp4
VBR levels:
- 1: ~64 kbps stereo
- 2: ~96 kbps stereo
- 3: ~128 kbps stereo
- 4: ~160 kbps stereo (production default)
- 5: ~192 kbps stereo
VBR generally produces better quality than CBR at the same average bitrate. Most production deployments use VBR level 4 or 5.
ffmpeg native AAC:
ffmpeg -i input.mov -c:v copy -c:a aac -b:a 192k output.mp4
The native encoder defaults to VBR-like behavior at 'auto' quality; explicit VBR control is more limited than FDK.
Profile selection
AAC has multiple profiles, available with both encoders:
- AAC-LC (Low Complexity) — the default profile. Bitrate range 64-320 kbps stereo. Use for most production.
- HE-AAC (AAC+) — adds Spectral Band Replication (SBR). Better quality at low bitrates (~24-64 kbps stereo).
- HE-AACv2 (AAC+ v2) — adds Parametric Stereo (PS). Better quality at very low bitrates (~16-32 kbps stereo).
CLI for HE-AAC with FDK:
-c:a libfdk_aac -profile:a aac_he -b:a 64k
For HE-AACv2:
-c:a libfdk_aac -profile:a aac_he_v2 -b:a 32k
ffmpeg native supports HE-AAC variants but quality is less consistent than FDK at low bitrates.
For most premium streaming, AAC-LC at 128-192 kbps is the default. HE-AAC variants matter for very-low-bandwidth use cases (mobile, podcasts at low quality).
Quality measurement
For automated quality measurement of AAC encodes:
ffmpeg -i reference.wav -i encoded.aac -lavfi \
"[0:a]aresample=async=1:first_pts=0,asetpts=PTS-STARTPTS[a0]; \
[1:a]aresample=async=1:first_pts=0,asetpts=PTS-STARTPTS[a1]; \
[a0][a1]aebur128=peak=true,asetnsamples=1024" \
-f null -
This measures EBU R128 loudness on both reference and encoded; differences indicate encoding artifacts.
For more sophisticated quality measurement, AQUA (Audio Quality Assessment) or PEAQ (Perceptual Evaluation of Audio Quality) algorithms exist but aren't built into ffmpeg. Tools like Aurio Touch or Adobe Audition's audio analysis features support PEAQ-style measurement.
For most production purposes, A/B listening on representative content is the practical quality test. Both FDK and ffmpeg native produce subjectively similar output at 192+ kbps; verify on your content type before committing.
Production deployment patterns
Pattern 1: Custom ffmpeg with FDK-AAC
Build internal ffmpeg with libfdk-aac; use across the encoding fleet. Quality benefit on all content. Licensing-compliant for internal SaaS use.
Pattern 2: ffmpeg native exclusively
Use ffmpeg native AAC for everything. Acceptable quality at 192+ kbps (production defaults). Simpler operations; standard ffmpeg builds work; no licensing complexity.
Pattern 3: Mixed — FDK for premium, native for basic
Premium streaming tiers use FDK; ad-supported tiers use ffmpeg native. The quality difference matters most at lower bitrates where ad-supported tiers don't operate anyway.
Pattern 4: Encoder-by-bitrate
Use FDK below 128 kbps where it matters; use ffmpeg native at 192+ where they're equivalent. Optimizes per-bitrate quality without committing the whole pipeline to FDK licensing.
When to use which
Use FDK-AAC when:
- Streaming at low bitrates (sub-128 kbps stereo).
- Premium audio quality matters and FDK licensing is acceptable.
- Internal/SaaS use where redistribution constraint isn't an issue.
- Already building custom ffmpeg.
Use ffmpeg native AAC when:
- Bitrate is 192 kbps or higher (encoders converge).
- Distribution-restricted use cases (open-source, redistributable apps).
- Pipeline simplicity matters more than the marginal quality gain.
- License compliance simplicity is a priority.
For most premium streaming services in 2026, FDK is the default for production audio. For consumer apps and open-source pipelines, ffmpeg native is the default.
Operational considerations
Things that matter for AAC encoder choice in production:
- Build provenance — track which ffmpeg version + libfdk-aac version is in production. Quality changes between versions.
- License documentation — maintain records of FDK-AAC licensing arrangements for audit purposes.
- Quality regression testing — when upgrading either encoder, regression-test against representative content corpus.
- Encoder version pinning — pin to specific versions in production. Don't auto-update encoder versions without testing.
- Multi-encoder fallback — some pipelines fall back to ffmpeg native if FDK fails; design behavior for fallback consistency.
- Bitrate calibration per encoder — FDK and native may produce slightly different output sizes at the same configured bitrate. Calibrate ladder bitrates per encoder if using both.
What MpegFlow does with AAC encoder selection
MpegFlow's FfmpegExecutor worker image includes both FDK-AAC and FFmpeg's native AAC; the choice is a workflow-level parameter that flows into the audio-encoding stage. Default for streaming workflows is FDK-AAC where licensing permits; the workflow YAML specifies aac to use FFmpeg native when that's the right call. The DAG runtime expresses audio encoding as its own stage with explicit dependency tracking and per-stage retry; the partitioner persists it to job_stages alongside the parallel video rendition stages.
License-compliance and worker-image build provenance are managed at the deployment layer rather than per-customer; build updates flow through controlled image rebuilds with regression validation.
The strict-broker security model handles audio encoding like any pipeline payload — workers carry no ambient credentials; content access flows through short-lived presigned URLs scoped per stage; access is disposed on completion.
For customers evaluating AAC encoder choice, the standing recommendation is FDK-AAC for premium streaming (quality matters at low bitrates, licensing fits SaaS use), FFmpeg native for everything else (simpler, license-compliant, adequate quality at production bitrates).
The general guidance: AAC encoder choice is one of the audio-pipeline decisions that's invisible when right (consistent quality across content) and visible (artifacts on low-bitrate content) when wrong. Match the encoder to the bitrate operating range and licensing tolerance of your pipeline.