Interpretation of FFmpeg open source license and application risks

FFmpeg is an open source software widely used in the field of audio and video. Thanks to its powerful functions, detailed documentation and rich ecological environment, it is favored by many developers. This article will explain the open source license of FFmpeg and its application risks in the development of audio and video products.

FFMPEG icon
FFMPEG icon

FFmpeg (https://github.com/FFmpeg/FFmpeg/tree/master) is an open source software widely used in the development of audio and video products. It has the functions of recording, converting and streaming audio and video in multiple formats. FFmpeg follows the LGPL v2.1 open source license and contains several modules that follow the GPL license. This article will explain the open source license of FFmpeg and its application risks in the development of audio and video products.


"Distribution" is the key link that triggers the infectious risk of LGPL and GPL licenses

LGPL and GPL licenses are both infectious to a certain extent, that is, if you develop something new based on LGPL or GPL components, you still have to license it according to the provisions of LGPL or GPL. This infectiousness is bounded by "distribution". "Distribution" means providing the software code (including source code and binary) to others, such as putting it in an App, software installation package or SDK for users to download and install. If the open source component runs completely in the background and provides SaaS services to users through the network, it is not considered distribution, and it will not trigger the infectious risks of LGPL and GPL.


Two common application methods of FFmpeg

The first is that the development team directly integrates the FFmpeg installation package in the product, which can be obtained from the FFmpeg official website or GitHub platform. The second is that the development team uses the SDK containing FFmpeg provided by other teams during the development process, thereby indirectly incorporating FFmpeg into the product. Whether it is introduced directly or indirectly, commercial product development must properly deal with the open source compliance risks brought by FFmpeg.


Application scenarios and risk isolation strategies of LGPL and GPL licenses

FFmpeg adopts the GNU Lesser General Public License (LGPL) v2.1 open source license. LGPL is an open source license issued by the Free Software Foundation that is less infectious than the General Public License (GPL). When developers use LGPL components in their software or products in a dynamic linking manner, they do not need to license the source code of the software or product to others under the terms of the LGPL. In other words, the key to the infectious circumvention solution for using LGPL components in commercial products lies in "dynamic linking".

However, the difference between FFmpeg and other LGPL components is that FFmpeg contains multiple modules that follow the GPL license. According to the introduction of the FFmpeg official website, FFmpeg may contain optional modules applicable to GPL v2+ (GNU General Public License version 2 or later). These modules are not enabled by default and need to be activated through the "--enable-gpl" configuration. Once these GPL modules are activated and used, FFmpeg's license will become the more infectious GPL. In order to use GPL components in commercial products and avoid the commercial code from being affected by the GPL terms, the current solution commonly adopted by the industry includes, in addition to purchasing commercial version licenses (if any), isolating GPL components from other commercial codes in different address spaces and communicating through pipes, sockets, command lines, etc.

If the developer does not activate the GPL module via the "--enable-gpl" configuration, FFmpeg will not include the GPL module and will not be subject to the terms of the GPL. For specific information about the GPL module, please refer to the information listed at https://github.com/FFmpeg/FFmpeg/blob/master/LICENSE.md.

If the developer wants to use FFmpeg under the terms of LGPL v3 or GPL v3, he can set "--enable-version3". In this case, FFmpeg will be subject to LGPL v3, and when the GPL module is activated, the GPL module will be subject to the terms of GPL v3.


Modifications to FFmpeg must be made public source code

Derivative works of FFmpeg that are made by modifications to FFmpeg are subject to the terms of the LGPL. The terms of the LGPL stipulate that when distributing FFmpeg modifications, the modifications to the files and the specific modification time must be clearly marked in the modified files (LGPL Section 2). When distributing a library or its derivative works under the terms of the LGPL, a complete machine-readable source code must be provided, and the source code must be provided through a medium commonly used for software exchange (LGPL Section 4). LGPL Section 4 further clarifies that if the binary distribution is obtained by providing a copy at a specified address, then providing a similar method of obtaining the source code at the same address can also meet the LGPL's requirements for source code provision. "The same address" is not clearly defined in the LGPL terms, and a more prudent approach is to place the source code on the server for binary downloads.


In past projects, an internal development team has asked whether it is possible not to directly disclose the modified source code of FFmpeg, but to leave a contact method and provide the source code directly to the requester when receiving relevant requests. Although the LGPL terms do not explicitly state that such methods are acceptable, referring to LGPL Section 6, which mentions that LGPL components used for dynamic linking can be disclosed through a "written offer", that is, providing the content required by LGPL Section 6(a) upon receiving relevant requests, we determine that leaving contact information in the copyright notice file and disclosing relevant source code upon receiving disclosure requests is less risky, but the premise is that upon receiving disclosure requests, relevant materials required by LGPL, such as modified source code of FFmpeg, must be disclosed in a timely manner.


Patent Risks of FFmpeg Components

This article focuses on the open source license risks of FFmpeg. At the same time, please note that using FFmpeg components (and other implementations based on the H.264 or H.265 standards) in commercial products may also infringe on codec standard patents. According to the FFmpeg official website, if FFmpeg is only used for personal purposes, the risk of patent infringement is relatively small; however, if FFmpeg is used for commercial product development, patent pool operators such as MPEG LA (later merged with Via to form Via LA) may launch rights protection actions. You can discuss the relevant patent risks with us and the patent team.


In summary, FFmpeg is a commonly used open source software in audio and video product development and is widely used in multiple audio and video products of the company. Therefore, please pay attention to the relevant open source license risks when using FFmpeg, and take appropriate risk avoidance measures.