Skip to content

sandflow/ffmpeg-kdu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

FFmpeg-KDU

Overview

FFmpeg-KDU is a patchset against FFmpeg that adds support for the Kakadu SDK through the kduc.

How to apply FFmpeg-KDU

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.

How to build

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.

Usage

Relationship with Kakadu demo apps

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

Encoding

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.

Decoding

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.

Tests

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/.

Directory layout

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.

Prerequisites

Kakadu SDK

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

kduc

The kduc library must be installed and points to the Kakadu SDK libraries generated by the step above.

License

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.