-
Notifications
You must be signed in to change notification settings - Fork 239
Building from source
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.
-
Install latest Nvidia video driver and CUDA SDK.
-
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 -
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 -
Install Python for Windows.
Recommended version is Python 3.7 -
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"
-
Open Visual Studio project & build the INSTALL target
-
Add path to FFMpeg dlls from Shared package to PATH or copy them to install folder
-
Run one of the Samples to check that build is fine
-
Install latest Nvidia video driver and CUDA SDK.
-
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
-
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. -
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