Skip to content
This repository was archived by the owner on Jun 10, 2024. It is now read-only.

Building from source

Roman Arzumanyan edited this page Feb 27, 2020 · 23 revisions

Build process is same both for Windows & Linux.

VPF relies on FFmpeg for bitstream demuxing, Video Codec SDK for multimedia features and CUDA for processing on GPU.
Make sure you have latest Nvidia video driver & CUDA SDK installed on your machine.

Build procedure details for Windows users:

  1. Install latest Nvidia video driver and CUDA SDK.

  2. Download Zeranoe FFMpeg build from https://ffmpeg.zeranoe.com/builds/
    Get Windows 64-bit builds for both Shared and Dev linkage.
    Unzip Dev package e. g. to C:\Install\ffmpeg-20191224-287620f-win64-dev
    Unzip Shared package e. g. to C:\Install\ffmpeg-20191224-287620f-win64-shared

  3. Download Nvidia Video Codec SDK from https://developer.nvidia.com/nvidia-video-codec-sdk
    Unzip package e. g. to C:\Install\Video_Codec_SDK_9.1.23

  4. Install Python for Windows.
    Recommended version is Python 3.7

  5. Clone VPF into e. g. c:\GitHub\VideoProcessingFramework
    Then generate Visual Studio project with CMake: \

cd c:\GitHub\VideoProcessingFramework\
mkdir build
cd build
cmake .. ^
  -G"Visual Studio 15 2017 Win64" ^
  -DFFMPEG_DIR:PATH="C:/Install/ffmpeg-20191224-287620f-win64-dev" ^
  -DVIDEO_CODEC_SDK_DIR:PATH="C:/Install/Video_Codec_SDK_9.1.23" ^
  -DGENERATE_PYTHON_BINDINGS:BOOL="1" ^
  -DCMAKE_INSTALL_PREFIX:PATH="C:/GitHub/VideoProcessingFramework"
  1. Open Visual Studio project & build the INSTALL target

  2. Add path to FFMpeg dlls from Shared package to PATH or copy them to install folder

  3. Run one of the Samples to check that build is fine

Build procedure details for Linux users:

  1. Install latest Nvidia video driver and CUDA SDK.

  2. If you wish to build FFMpeg from sources, clone https://github.com/FFmpeg/FFmpeg.git into e. g.

/home/user/GitHub/ffmpeg

If you wish to keep multiple FFMpeg versions across your machine, launch configure script with install prefix option:

cd /home/user/GitHub/ffmpeg
mkdir -p build_release
./configure --prefix=$(pwd)/build_release
make -j -s && make install
  1. VPF user CMake find_library to locate ffmpeg which searches default paths (such as e. g. /usr/lib) first and user-provided path second. Make sure you link VPF against desired ffmpeg version.

  2. The rest of build procedure is similar to that for Windows:

# Path to particular Video Codec SDK release root directory
export PATH_TO_SDK=/home/user/Video_Codec_SDK

# Here it points to the ffmpeg compiled from sources.
# Don't need it if ffmpeg is installed via packet manager.
export PATH_TO_FFMPEG=/home/user/GitHub/ffmpeg/build_release

cd /home/user/GitHub/VideoProcessingFramework
export INSTALL_PREFIX=$(pwd)/install

mkdir -p install
mkdir -p build
cd build

cmake .. \
  -DFFMPEG_DIR:PATH="$PATH_TO_FFMPEG" \
  -DVIDEO_CODEC_SDK_DIR:PATH="$PATH_TO_SDK" \
  -DGENERATE_PYTHON_BINDINGS:BOOL="1" \
  -DCMAKE_INSTALL_PREFIX:PATH="$INSTALL_PREFIX"

make -j -s && make install

# Now launch a sample to check if it works fine:
cd $INSTALL_PREFIX/bin
export LD_LIBRARY_PATH=$PATH_TO_FFMPEG/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$(pwd):$LD_LIBRARY_PATH
python3 ./SampleDecode.py
Clone this wiki locally