Example: confidence

Using FFmpeg with NVIDIA GPU Hardware Acceleration

VDA-08430-001_v02 | March 2022 Using FFmpeg with NVIDIA GPUH ardware AccelerationUser GuideUsing FFmpeg with NVIDIA GPU Hardware AccelerationvDA-08430-001_v02 | iiTable of ContentsChapter 1. 1 Chapter 2. Hardware Software Compiling Compiling for Compiling for Compiling for Windows Subsystem for Linux (WSL).. Commonly faced issues and tips to resolve 3. Basic 1:1 HWACCEL Transcode without 1:1 HWACCEL Transcode with 1:N HWACCEL Transcode with 1:N HWACCEL encode from YUV or RAW Multiple 1:N HWACCEL Transcode with Multiple 1:N Transcode with Scaling (SW Decode->HW Scaling->HW Encode).

Using FFmpeg with NVIDIA GPU Hardware Acceleration vDA-08430-001_v02 | 1 Chapter 1. Introduction All NVIDIA® GPUs starting with Kepler generation support fully-accelerated hardware video encoding and decoding. The hardware encoder and hardware decoder are referred to as NVENC and NVDEC, respectively, in the rest of the document.

Tags:

  Hardware, Nvidia, With, Acceleration, With nvidia gpu hardware acceleration

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Advertisement

Transcription of Using FFmpeg with NVIDIA GPU Hardware Acceleration

1 VDA-08430-001_v02 | March 2022 Using FFmpeg with NVIDIA GPUH ardware AccelerationUser GuideUsing FFmpeg with NVIDIA GPU Hardware AccelerationvDA-08430-001_v02 | iiTable of ContentsChapter 1. 1 Chapter 2. Hardware Software Compiling Compiling for Compiling for Compiling for Windows Subsystem for Linux (WSL).. Commonly faced issues and tips to resolve 3. Basic 1:1 HWACCEL Transcode without 1:1 HWACCEL Transcode with 1:N HWACCEL Transcode with 1:N HWACCEL encode from YUV or RAW Multiple 1:N HWACCEL Transcode with Multiple 1:N Transcode with Scaling (SW Decode->HW Scaling->HW Encode).

2 8 Chapter 4. Quality Video Video Command Line for Latency-Tolerant High-Quality Command Line for Low Latency 10 Chapter 5. Advanced Quality Adaptive Quantization (AQ).. 12 Chapter 6. Performance Evaluation and Measuring Aggregate Settings for Reduced Initialization FFmpeg with NVIDIA GPU Hardware AccelerationvDA-08430-001_v02 | 1 Chapter NVIDIA GPUs starting with Kepler generation support fully-accelerated Hardware videoencoding and decoding. The Hardware encoder and Hardware decoder are referred to as NVENCand NVDEC, respectively, in the rest of the Hardware capabilities of NVENC and NVDEC are exposed in the NVIDIA Video Codec SDKthrough APIs (herein referred to as NVENCODE API and NVDECODE API), by which the user canaccess the Hardware Acceleration abilities of NVENC and is the most popular multimedia transcoding software and is used extensively for videoand audio transcoding.

3 NVENC and NVDEC can be effectively used with FFmpeg to significantlyspeed up video decoding, encoding, and end-to-end document explains ways to accelerate video encoding, decoding and end-to-endtranscoding on NVIDIA GPUs through FFmpeg which uses APIs exposed in the NVIDIA VideoCodec FFmpeg with NVIDIA GPU Hardware AccelerationvDA-08430-001_v02 | 2 Chapter SetupFFmpeg with NVIDIA GPU Acceleration requires a system with Linux or Windows operatingsystem and a supported NVIDIA a list of supported GPUs, refer to .For the rest of this document, it is assumed that the system being used has a GPU which hasboth NVENC and supports both Windows and Linux.

4 FFmpeg has been compiled and tested withMicrosoft Visual Studio 2013 SP2 and above (Windows), MinGW (msys2-x86_64-20161025)(Windows) and gcc and above (Linux) requires separate git repository nvcodec-headers for NV-accelerated FFmpeg compile FFmpeg , the CUDA toolkit must be installed on the system, though the CUDA toolkitis not needed to run the FFmpeg compiled recommends reading the FFmpeg documentation before Using FFmpeg . Take note theversion of the Video Codec SDK it uses, and ensure that the minimum driver required for thatversion of the Video Codec SDK is FFmpegFFmpeg is an open-source project.

5 Download the FFmpeg source code repository and compileit Using an appropriate Information on building FFmpeg can be found at: FFmpeg with NVIDIA GPU Hardware AccelerationvDA-08430-001_v02 | for LinuxFFmpeg with NVIDIA GPU Acceleration is supported on all Linux compile FFmpeg on Linux, do the following: Clone ffnvcodecgit clone Install ffnvcodeccd nv-codec-headers && sudo make install && cd Clone FFmpeg 's public GIT clone FFmpeg / Install necessary apt-get install build-essential yasm cmake libtool libc6 libc6-dev unzip wget libnuma1 libnuma-dev --enable-nonfree --enable-cuda-nvcc --enable-libnpp --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64 --disable-static --enable-shared Compilemake -j 8 Install the make for WindowsFFmpeg with NVIDIA GPU Acceleration is supported on all Windows platforms.

6 with compilationthrough Microsoft Visual Studio 2013 SP2 and above, and MinGW. Depending upon the VisualStudio Version and CUDA SDK version used, the paths specified may have to be compile FFmpeg on Windows, do the following: Install msys2 from Clone ffnvcodecgit clone Clone FFmpeg 's public GIT clone Create a folder named nv_sdk in the parent directory of FFmpeg and copy all the header filesfrom C:\Program Files\ NVIDIA GPU Computing Toolkit\CUDA\ \include and library filesfrom C:\Program Files\ NVIDIA GPU Computing Toolkit\CUDA\ \lib\x64 to nv_sdk folder.

7 Launch the Visual Studio x64 Native Tools Command FFmpeg with NVIDIA GPU Hardware AccelerationvDA-08430-001_v02 | 4 From the Visual Studio x64 Native Tools Command Prompt, launch the MinGW64environment by running from the msys2 installation folder. In the MinGW64 environment, install the necessary -S diffutils make pkg-config yasm Add the following paths by running the PATH="/c/Program Files (x86)/Microsoft Visual Studio ":$PATH export PATH="/c/Program Files/ NVIDIA GPU Computing Toolkit/ ":$PATH Goto nv-codec-headers directory and install ffnvcodecmake install PREFIX=/usr Go to the FFmpeg installation folder and run the following --enable-nonfree disable-shared --enable-cuda-nvcc --enable-libnpp -toolchain=msvc --extra-cflags= --extra-ldflags=-libpath.

8 /nv_sdk Compile the code by executing the following -j for Windows Subsystem for Linux (WSL) FFmpeg with NVIDIA GPU Acceleration is supported on WSL. To compile FFmpeg on WSL, followthe steps as specified in Compiling for faced issues and tips to resolve them Common compilation issues TOT may be broken at times. Please check out a release version if it is broken,or use an older snapshot. sure you are Using mingw64 for a 64-bit system. Using mingw32 would result inerrors such as - Relocation truncated to fit - R_X86_64_32 . (and not Msys2) cannot launch the mingw64 command shell.

9 It can only launch themingw32 shell. sure is available in /usr/local/cuda/include along with SDK header is required for enabling NVCUVID, otherwise the configuration will lead to an error - CUDA Not found . specifying --extra-ldflags in the correct format will lead to error - argument notrecognized. from CUDA toolkit version or higher does not support compiling for'compute_30'. This will cause the configure script to fail with the message 'ERROR:failed checking for nvcc.'. To work around this error, use --nvccflags="-gencode arch=compute_52,code=sm_52 -O2" which overrides the default nvcc flags.

10 Common run-time issues -vsync 0 option with decode to prevent FFmpeg from creating output YUV withduplicate and extra FFmpeg with NVIDIA GPU Hardware AccelerationvDA-08430-001_v02 | 5 gives errors such as - " missing from your computer while running FFmpeg . Workaround for this error - Copy all DLLs under C:\msys64\mingw64\bin in the folder where is FFmpeg with NVIDIA GPU Hardware AccelerationvDA-08430-001_v02 | 6 Chapter TestingOnce the FFmpeg binary with NVIDIA Hardware Acceleration support is compiled, Hardware -accelerated video transcode should be tested to ensure everything works well.


Related search queries