2. Installation Guide

2.1. Dependencies

This project uses ffmpeg-io, nrc2, c-vector and aff3ct-core projects as Git submodules, you need to download them with the following command:

git submodule update --init --recursive

Note

ffmpeg-io requires the ffmpeg executable: you need to install ffmpeg on your system if you want to be able to read video files. In addition, if you want to enable text indications in generated videos/images, the OpenCV library is required.

On Debian like systems you can easily install these packages with the apt package manager:

sudo apt install ffmpeg libopencv-dev

On macOS, we recommend you to use the homebrew package manager:

brew install ffmpeg opencv

2.2. Compilation with CMake

This project uses CMake in order to generate any type of projects (Makefile, Visual Studio, Eclipse, CLion, XCode, etc.). The code can easily be compiled with the following command lines:

mkdir build
cd build
cmake ..
make -j4

Note

The previous CMake command (cmake ..) will generate a Makefile without any compiler flag.

If you are using a GNU or Clang compiler like, it is advised to use the following CMake command line instead:

cmake .. -DFMDT_OPENCV_LINK=ON -DFMDT_AFF3CT_RUNTIME=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="-O3 -g" -DCMAKE_C_FLAGS_RELWITHDEBINFO="-O3 -g" -DCMAKE_CXX_FLAGS="-Wall -funroll-loops -fstrict-aliasing -march=native" -DCMAKE_C_FLAGS="-funroll-loops -fstrict-aliasing -march=native"

Note

On Apple Silicon M1 CPUs and with Apple Clang, use -mcpu=apple-m1 instead of -march=native.

The previous command line generates a Makefile in release mode (with debug information -g). It will produce optimized and ready for debug binaries. Moreover, OpenCV and AFF3CT libraries will be used during the compilation. It enables advanced features (see the following CMake Options section for more details about it).

2.2.1. CMake Options

Here is the list of the CMake available options:

  • FMDT_DETECT_EXE

    Type

    BOOLEAN

    Default

    ON

    Example

    cmake .. -DFMDT_DETECT_EXE=OFF

    Compile the detection chain executable

  • FMDT_VISU_EXE

    Type

    BOOLEAN

    Default

    ON

    Example

    cmake .. -DFMDT_VISU_EXE=OFF

    Compile the tracking visualization executable.

  • FMDT_CHECK_EXE

    Type

    BOOLEAN

    Default

    ON

    Example

    cmake .. -DFMDT_CHECK_EXE=OFF

    Compile the check executable.

  • FMDT_MAXRED_EXE

    Type

    BOOLEAN

    Default

    ON

    Example

    cmake .. -DFMDT_MAXRED_EXE=OFF

    Compile the max reduction executable.

  • FMDT_DEBUG

    Type

    BOOLEAN

    Default

    OFF

    Example

    cmake .. -DFMDT_DEBUG=ON

    Build the project using debugging prints: these additional prints will be output on stderr and prefixed by (DBG).

  • FMDT_OPENCV_LINK

    Type

    BOOLEAN

    Default

    OFF

    Example

    cmake .. -DFMDT_OPENCV_LINK=ON

    Link with OpenCV library (required to enable some options for improved visualization in fmdt-xxx executables).

  • FMDT_AFF3CT_RUNTIME

    Type

    BOOLEAN

    Default

    OFF

    Example

    cmake .. -DFMDT_AFF3CT_RUNTIME=ON

    Link with AFF3CT runtime and produce multi-threaded detection executable (fmdt-detect-rt).

  • FMDT_LSL_LINK

    Type

    BOOLEAN

    Default

    OFF

    Example

    cmake .. -DFMDT_LSL_LINK=ON

    Link with an external CCL library. Then the CCL implementation can be changed with the --ccl-impl parameter. This library is not public yet so it may fail when enabling this option.

  • FMDT_USE_VCIO

    Type

    BOOLEAN

    Default

    OFF

    Example

    cmake .. -DFMDT_USE_VCIO=ON

    Link with the external vcodecs-io library. This library can be used to decode video files with the --vid-in-dec parameter. This library is not public yet so it may fail when enabling this option.