Instructions for building the Vulkan Video Samples repository on Linux and Windows.
Please make sure you have installed the latest NVIDIA BETA drivers from https://developer.nvidia.com/vulkan-driver. The minimum supported BETA driver versions by this application are 553.51 (Windows) / 550.40.82 (Linux) that must support Vulkan API version 1.3.230 or later. The Windows and Linux BETA drivers are available for download at https://developer.nvidia.com/vulkan-driver.
Note: An alternative version of this repository is also available at the official Khronos Group repository: https://github.com/KhronosGroup/Vulkan-Video-Samples
VULKAN_VIDEO_GIT_REPO="https://github.com/nvpro-samples/vk_video_samples.git"
git clone $VULKAN_VIDEO_GIT_REPO
cd vk_video_samples
The project supports the following main build options:
BUILD_DECODER
(Default: ON) - Build the Vulkan video decoder componentsBUILD_ENCODER
(Default: ON) - Build the Vulkan video encoder componentsBUILD_VIDEO_PARSER
(Default: ON) - Build the video parser library used by both encoder and decoder
These options can be specified during CMake configuration. For example:
cmake -DBUILD_DECODER=ON -DBUILD_ENCODER=OFF -DBUILD_VIDEO_PARSER=ON ...
Windows 10 or Windows 11 with the following software packages:
- Microsoft Visual Studio VS2019 or later (any version)
- CMake
- Tell the installer to "Add CMake to the system PATH" environment variable
- Python 3
- Select to install the optional sub-package to add Python to the system PATH
- Ensure the
pip
module is installed (it should be by default) - Python3.3 or later is necessary for the Windows py.exe launcher
- Git
- Tell the installer to allow it to be used for "Developer Prompt" as well as "Git Bash"
- Tell the installer to treat line endings "as is"
- Install both 32-bit and 64-bit versions
- Vulkan SDK
- Install current Vulkan SDK (i.e. VulkanSDK-1.4.304.0-Installer.exe or later)
- [FFMPEG libraries for Windows]
- Download the latest version of the FFMPEG shared libraries archive from https://github.com/BtbN/FFmpeg-Builds/releases
- The archive must have the following pattern in the name: ffmpeg--win64--shared.zip
- Example download link: https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-win64-gpl-shared.zip
- Extract to <APP_INSTALLED_LOC>\bin\libs\ffmpeg
- Add the path <APP_INSTALLED_LOC>\bin\libs\ffmpeg\win64\ to your system PATH
- Verify that <APP_INSTALLED_LOC>\bin\libs\ffmpeg\win64\bin contains:
- avformat-59.dll
- avutil-59.dll
- avcodec-59.dll
- Verify that <APP_INSTALLED_LOC>\bin\libs\ffmpeg\win64\lib contains the corresponding .lib files
For Debug build:
cmake . -B build -DCMAKE_GENERATOR_PLATFORM=x64 -DCMAKE_INSTALL_PREFIX="$(PWD)/build/install/Debug" -DCMAKE_BUILD_TYPE=Debug
cmake --build build --parallel 16 --config Debug
cmake --build build --config Debug --target INSTALL
For Release build:
cmake . -B build -DCMAKE_GENERATOR_PLATFORM=x64 -DCMAKE_INSTALL_PREFIX="$(PWD)/build/install/Release" -DCMAKE_BUILD_TYPE=Release
cmake --build build --parallel 16 --config Release
cmake --build build --config Release --target INSTALL
This repository has been tested on recent Ubuntu LTS versions. Minimum requirements:
- Ubuntu 18.04.5 LTS or later
- GCC 7.5.0 or Clang 6.0.0
- Vulkan SDK vulkansdk-linux-x86_64-1.4.304.0.tar.xz or later
Required packages:
sudo apt-get install git cmake build-essential libx11-xcb-dev libxkbcommon-dev \
libmirclient-dev libwayland-dev libxrandr-dev libavcodec-dev \
libavformat-dev libavutil-dev ninja-build
- Execute the dependency script:
./ubuntu-update-dependencies.sh
- Configure and build:
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Debug .. # or Release
make -j16
sudo make install
Before running tests, verify Vulkan Video extensions:
vulkaninfo | grep VK_KHR_video
For decoder testing:
./demos/vk-video-dec-test -i '<Video content file with h.264 or h.265 format>' [--c N]
For encoder testing:
./demos/vk-video-enc-test -i <yuv-video-input-file.yuv> --codec <"h264" | "h265" | "av1"> \
--inputNumPlanes <2 | 3> --inputWidth <input Y width> --inputHeight <input Y height> \
--startFrame 0 --numFrames <max frame num>