By default, when FFmpeg is built using the build_ffmpeg.sh script, it will be configured with the following flags:
--enable-gpl --enable-nonfree
FFmpeg can be built to qualify for the LGPL license. To do this the following flags need to be disabled. To disable the flags, FFmpeg needs to be configured manually i.e. not using the build_ffmpeg.sh script. To view the default configuration set by the build_ffmpeg.sh script, use the steps below:
Go to the FFmpeg directory (directory name depends on the FFmpeg version) with the following command:
cd FFmpeg
Clean the folder for compilation with the following command:
sudo make clean
Get the configuration:
bash build_ffmpeg.sh –dry
The response for the above command should look like this :
./configure --pkg-config-flags=--static --enable-gpl --enable-nonfree --extra-ldflags=-lm --extra-ldflags=-ldl --enable-ni_quadra --disable-ni_logan --disable-filter=drawtext_ni_quadra --enable-pic --enable-pthreads --extra-libs=-lpthread --enable-encoders --enable-decoders --enable-avfilter --enable-muxers --enable-demuxers --enable-parsers --disable-debug --disable-ffplay --disable-ffprobe --disable-libx264 --disable-libx265 --disable-libaom --disable-libvpx --disable-libxml2 --disable-libsrt --disable-cuda-nvcc --disable-cuda --disable-cuvid --disable-nvdec --disable-nvenc --disable-libvmaf --enable-static --disable-shared --extra-cflags=-UNI_DEC_GSTREAMER_SUPPORT --extra-cflags=-UNI_MEASURE_LATENCY
To build FFmpeg to comply with the LGPL license, change the following flags from
--enable-gpl --enable-nonfree
to
--disable-gpl --disable-nonfree
Now the configure command need to be executed:
./configure --pkg-config-flags=--static --disable-gpl --disable-nonfree --extra-ldflags=-lm --extra-ldflags=-ldl --enable-ni_quadra --disable-ni_logan --disable-filter=drawtext_ni_quadra --enable-pic --enable-pthreads --extra-libs=-lpthread --enable-encoders --enable-decoders --enable-avfilter --enable-muxers --enable-demuxers --enable-parsers --disable-debug --disable-ffplay --disable-ffprobe --disable-libx264 --disable-libx265 --disable-libaom --disable-libvpx --disable-libxml2 --disable-libsrt --disable-cuda-nvcc --disable-cuda --disable-cuvid --disable-nvdec --disable-nvenc --disable-libvmaf --enable-static --disable-shared --extra-cflags=-UNI_DEC_GSTREAMER_SUPPORT --extra-cflags=-UNI_MEASURE_LATENCY
Once FFmpeg is configured it needs to be built and installed on the system using the following steps:
Build FFmpeg with the command:
make
Install FFmpeg to the host $PATH with the following command:
sudo make install
The build_ffmpeg.sh script with the --dry flag can be used with other custom configurations as shown in Section 4.2.9 (Step 3). The --dry flag can also be added at the end of the build_ffmpeg.sh script to get the configuration
For example
bash build_ffmpeg.sh --quadra –-logan –-dry
The above command will print out the FFmpeg configuration with the Quadra and Logan libraries enabled. The above step can be followed with an install of FFmpeg with the LGPL license, with Quadra and Logan features also enabled.