![]() ![]() There are two major data types which VPF operates: The core part of VPF are PyNvDecoder and PyNvEncoder classes which are Python bindings to NVIDIA Video Codec SDK. ![]() ![]() Since all the transcoding is done on the GPU, there’s no noticeable CPU load. The transcoding sample shown above is enough to saturate Nvenc unit on an RTX 5000 GPU as illustrated below:īig Buck Bunny sequence contains 14,315 frames and can be transcoded within 32 seconds which gives ~447fps without using any advanced techniques such as producer-consumer pattern with decoded frames queue being shared by decoder and encoder launched in separate threads. # Encoder is asynchronous, so we need to flush itĭespite a simple design, VPF demonstrates good performance. # Decoder will return zero surface if input file is over ĮncFrame = nvEnc.EncodeSingleSurface(rawSurface) ![]() To illustrate the ease of use, let’s start with a quick code snippet which shows how to do fully hardware-accelerated video transcoding on a GPU without raw frames copying between Host and Device:ĮncFile = "big_buck_bunny_1080p_h264.mov" VPF exports C++ video processing classes into PyNvCodec Python module. It relies on FFmpeg library for (de)muxing and pybind11 project for building Python bindings. VPF is a CMake-based open source cross-platform software released under Apache 2 license. VPF is a set of C++ libraries and Python bindings which provides full hardware acceleration for video processing tasks such as decoding, encoding, transcoding and GPU-accelerated color space and pixel format conversions. VPF utilizes the NVIDIA Video Codec SDK for flexibility and performance, and provides developers with the ease-of-use inherent to Python. However, hardware accelerated video features might be useful for a broader audience, and the intent of VPF (Video Processing Framework) is a simple, yet powerful tool for utilizing NVIDIA GPUs when working with video using Python. Another option is to use third party libraries and applications like FFmpeg or GStreamer which again require C/C++ expertise to be built-in and customized per user. While showing great performance and flexibility, it requires knowledge of C/C++. Support for accelerated hardware video encoding began with the Kepler generation of NVIDIA GPUs, and all GPUs since the Fermi generation support hardware video acceleration decoding through the NVIDIA Video Codec SDK. ![]()
0 Comments
Leave a Reply. |