-
Notifications
You must be signed in to change notification settings - Fork 626
Building FFmpegKit with Custom Libraries
ffmpeg-kit
build scripts come with a list of external libraries that can be enabled out of the box.
However, ffmpeg-kit
is not limited to those built-in libraries only. You can build ffmpeg
with other libraries as well. You just to tell build scripts how they can be compiled. And they will do that for you.
Top level build scripts (android.sh
, ios.sh
, linux.sh
, macos.sh
and tvos.sh
) support optional flags to pass that information.
- First, the following flags must be provided to build a custom library. All of them are mandatory except
repo-commit
andrepo-tag
. Those two are interchangeable. Providing only one of them is sufficient. You can build more than one custom library as well.
--enable-custom-library-[n]-name=value name of the custom library []
--enable-custom-library-[n]-repo=value git repository of the source code []
--enable-custom-library-[n]-repo-commit=value git commit to download the source code from []
--enable-custom-library-[n]-repo-tag=value git tag to download the source code from []
--enable-custom-library-[n]-package-config-file-name=value package config file installed by the build script []
--enable-custom-library-[n]-ffmpeg-enable-flag=value library name used in ffmpeg configure script to enable the library []
--enable-custom-library-[n]-license-file=value licence file path relative to the library source folder []
The following Android
only flag is also optional. It must be provided if the custom library uses libc++
. Loading ffmpeg
will fail with linking errors if the custom library uses it but the flag is not specified.
--enable-custom-library-[n]-uses-cpp flag to specify that the library uses libc++ []
Examples:
./macos.sh \
--enable-custom-library-1-name=chromaprint \
--enable-custom-library-1-repo=https://github.com/arthenica/chromaprint \
--enable-custom-library-1-repo-tag=v1.5.0 \
--enable-custom-library-1-package-config-file-name=libchromaprint \
--enable-custom-library-1-ffmpeg-enable-flag=chromaprint \
--enable-custom-library-1-license-file=LICENSE.md
./android.sh \
--enable-custom-library-1-name=x265 \
--enable-custom-library-1-repo=https://github.com/arthenica/x265 \
--enable-custom-library-1-repo-tag=3.4 \
--enable-custom-library-1-package-config-file-name=x265 \
--enable-custom-library-1-ffmpeg-enable-flag=libx265 \
--enable-custom-library-1-license-file=COPYING \
--enable-custom-library-1-uses-cpp \
--enable-gpl
- The second step is to provide the compile script. It must be created under the
scripts/android
folder for Android, under thescripts/linux
folder for Linux and under thescripts/apple
folder for the Apple platforms. It's name must be in the form ofname.sh
. Where thename
is the samename
given in the--enable-custom-library-[n]-name
option passed. That's it.
You can look and copy the compile scripts we have for the built-in libraries under the scripts/android
, scripts/linux
and scripts/apple
folders. They will show you the general syntax and environment variables we're using in each platform.
Copyright (c) 2021-2024 FFmpegKit
- Status
- Versions
- Changelog
- Project Layout
- API
- Using
- Building
- External Libraries
- Patents
- License