FFmpeg libfdk_aac License Restrictions

Compiling FFmpeg with the Fraunhofer FDK AAC (libfdk_aac) library provides access to one of the highest-quality AAC audio encoders available. However, combining these two software packages triggers a licensing conflict that prevents the redistribution of the compiled binary. This article explains the licensing incompatibility between FFmpeg and libfdk_aac, the restrictions on distributing the resulting software, and the legal alternatives available to developers.

The Licensing Conflict Explained

The core issue lies in the incompatibility between the license of libfdk_aac and the licenses under which FFmpeg is distributed (the GNU Lesser General Public License, or LGPL, and the GNU General Public License, or GPL).

  • FFmpeg's License: FFmpeg is licensed under the LGPL (v2.1 or later) by default. If compiled with certain external libraries or features, it upgrades to the GPL (v2.0 or later).
  • libfdk_aac License: The Fraunhofer FDK AAC library is distributed under its own proprietary, open-source-like license (the FDK License).

While the FDK License allows you to download, compile, and use the library for free, it contains specific terms that conflict directly with both the GPL and LGPL.

Key Restrictions of the FDK AAC License

The FDK License is considered GPL-incompatible due to two main restrictions:

  1. Patent Indemnity and Rights: The FDK license does not grant patent licenses for any patent claims that are infringed by the combination of the FDK software with other hardware or software. The GPL, conversely, requires that any patent licenses covering the software must be unrestricted for everyone's use.
  2. No Additional Restrictions: The GPL (v2 and v3) explicitly forbids the imposition of further restrictions on the recipients' exercise of the rights granted under the license. Because the FDK license contains proprietary restrictions and limitations on commercial distribution, it constitutes an "additional restriction" under the GPL.

The Distribution Ban

Because of these conflicting terms, if you compile FFmpeg and enable libfdk_aac (by configuring the build with --enable-libfdk-aac), you cannot legally distribute the resulting binary.

  • For Personal or Internal Use: You are legally allowed to compile FFmpeg with libfdk_aac for your own personal use, or for private, internal use within an organization.
  • For Distribution: You cannot upload the compiled binary to a public repository, share it with third parties, package it into a commercial software application, or distribute it as part of an operating system distribution.

To prevent accidental illegal distribution, FFmpeg's build system requires you to explicitly declare the build as "nonfree" when enabling the library. You must pass both --enable-libfdk-aac and --enable-nonfree to the configure script. If you also enable GPL components, you must pass --enable-gpl as well, which cements the non-redistributable status of the build.

If you need to distribute an application or server configuration that includes FFmpeg with AAC encoding capabilities, you have two primary options to avoid legal issues:

  • Use the Native FFmpeg AAC Encoder: FFmpeg includes its own native AAC encoder (enabled via -c:a aac). This encoder is fully compatible with the LGPL and GPL licenses, allowing you to freely distribute the compiled binary. While historically inferior to FDK, the native encoder has improved significantly and is suitable for most use cases.
  • Build On-Demand: If your users require libfdk_aac, you can distribute a script or installer that downloads the source code and compiles FFmpeg with libfdk_aac locally on the end-user's machine. Since the compilation and usage happen on the user's local system without redistribution of the binary, this remains legally compliant.