FFmpeg-KDU is a patchset against FFmpeg that adds support for the Kakadu SDK through the kduc.
The integration
branch contains the complete history of the patchset and is
intended to be squashed merged onto the master
branch of FFmpeg:
git remote add ffmpeg-kdu https://github.com/sandflow/ffmpeg-kdu.git
git fetch ffmpeg-kdu integration:kdu-integration
git checkout master
git merge --squash kdu-integration
Modifications to the patchset are developed on branches created from
integration
branch.
The master
branch of FFmpeg is regularly merged onto the integration
branch.
Install the prerequisites listed below, then configure FFmpeg to include :
./configure --enable-libkdu --extra-cflags="-I<path to kduc header files>" --extra-ldflags="-L<path to kduc library>"
See the FFmpeg Compilation Guide.
The patchset roughly mimics the kdu_compress
and kdu_expand
CLI applications
provided with the Kakadu SDK.
For example:
kdu_compress -i image.png Cmodes=HT Creversible=yes -o image.j2c
becomes
ffmpeg -i image.png -c:v libkdu -kdu_params "Cmodes=HT Creversible=yes" image.j2c
ffmpeg -i <input file> -c:v libkdu [kdu_option_1, kdu_option_2, ...] [-kdu_params "param_1 param_2 ..."] <output file>
kdu_options: ffmpeg -h encoder=libkdu
kdu_params: see kdu_params.h in the Kakadu SDK documentation.
ffmpeg -c:v libkdu [kdu_option_1, kdu_option_2, ...] [-kdu_params "param_1 param_2 ..."] -i <input file> <output file>
kdu_options: ffmpeg -h decoder=libkdu
kdu_params: see kdu_params.h in the Kakadu SDK documentation.
The script at .github/tests.sh can be used for smoke testing:
./.github/tests.sh <path to source image dir>
where the source images can be retrieved at s3://ffmpeg-kdu/tests/
.
The layout is identical to upstream
with the following exception:
.github
for files specific to FFmpeg-KDU
The .github
directory is not required to add support for the Kakadu SDK to
FFmpeg.
The Kakadu SDK must be installed. Below is a sample script for Ubuntu:
BUILD_DIR=~/tmp/kdu # <--- replace with a temporary location
KDU_SDK=v8_2_1-01908E # <--- replace with the version of the Kakadu SDK you are using
KDU_SDK_ZIP=~/downloads/$KDU_SDK.zip # <--- replace with the path to the Kakadu SDK zip
mkdir -p $BUILD_DIR
cd $BUILD_DIR
unzip $KDU_SDK_ZIP
cd $BUILD_DIR/$KDU_SDK
mv srclib_ht srclib_ht_noopt
cp -r altlib_ht_opt srclib_ht
cd $BUILD_DIR/$KDU_SDK/make
make CXXFLAGS=-DFBC_ENABLED -f Makefile-Linux-x86-64-gcc all_but_jni
cd $BUILD_DIR/$KDU_SDK
sudo cp bin/Linux-x86-64-gcc/* /usr/local/bin/
sudo cp lib/Linux-x86-64-gcc/* /usr/local/lib/
sudo ldconfig
sudo mkdir -p /usr/local/include/kakadu
sudo cp -r managed/all_includes/* /usr/local/include/kakadu
The kduc library must be installed and points to the Kakadu SDK libraries generated by the step above.
The patchset is licensed under the GNU Lesser General Public License version 2.1.
The Kakadu SDK is NOT free software. Please contact Kakadu Software for more information.