Models / Libraries / Frameworks

What’s New in PyNvVideoCodec 2.0 for Python GPU-Accelerated Video Processing

Powerful hardware-accelerated video processing in Python just got easier. PyNvVideoCodec is an NVIDIA Python-based library for GPU-accelerated video encoding, decoding, and transcoding. Built directly on top of the low-level NVIDIA Video Codec SDK, PyNvVideoCodec is lightweight, MIT-licensed, and easy to install using pip. The performance is on par with the native SDK.

PyNvVideoCodec 2.0 is a major upgrade to how developers, researchers, and engineers build high-performance video pipelines using the familiar and flexible Python language.

Whether you’re working on video analytics, AI preprocessing, media transcoding, or real-time streaming, PyNvVideoCodec 2.0 delivers the speed of C++ and the ease of Python—now with even more features, better performance, and extended codec support. Read on to learn more.

Diagram showing a video processing pipeline. The flow begins with video input, passed to the PyNvVideoCodec Decode API. The decoded frames go through a processing block that handles pre-processing, training, inferencing, and post-processing. The results are passed to the PyNvVideoCodec Encode API, and finally output as video.
Figure 1. The PyNvVideoCodec video processing pipeline enables GPU-accelerated decode and encode operations around an AI or signal processing stage
Layered diagram showing the software stack for GPU-accelerated video processing using PyNvVideoCodec. The top layer includes user-level Python applications, which interact with PyNvVideoCodec APIs. These APIs interface with the NVIDIA Video Codec SDK. At the base of the stack is the NVIDIA GPU, which performs the actual hardware-accelerated video processing.
Figure 2. The software stack for GPU-accelerated video processing with PyNvVideoCodec

What’s new in PyNvVideoCodec 2.0?

The PyNvVideoCodec 2.0 release introduces several powerful features designed to optimize video workflows for AI, broadcast, multimedia, and streaming applications. These include enhancements for decode, encode, and transcode.

Decode enhancements

Decode enhancements new to PyNvVideoCodec 2.0 include the following:

  • Frame sampling and seeking: Flexible frame retrieval—sequential, random, periodic, batched, sliced, or even target frame rate.
  • Decoder caching: Perfect for short clips, reuse decoders without full reinitialization.
  • Threaded decoder: Get zero latency by decoding in a background thread.
  • Buffer-based decode: Process video directly from memory buffers—crucial for streaming use cases
  • Low latency decode: Zero-latency decoding support for sequences without B-frames.
  • SEI extraction: Extraction of SEI Messages allowing access to HDR metadata, timecodes, and custom user data.
  • Stream metadata: Easily retrieve keyframe indices, resolution, bit depth, and more.
  • Optimized GIL handling: Improved multithreaded performance through better handling of Global Interpreter Lock (GIL) in C++ layer.
  • Multi-GPU decode: Scale up your workloads across GPUs.
  • Extended codec support: H.264, HEVC, AV1, VP8, VP9, VC1, MPEG4/2/1.
  • 4:2:2 decoding: Decode high-fidelity 4:2:2 H264 and HEVC content in NV16, P210, and P216 formats. Note that this is supported on the NVIDIA Blackwell architecture onward.
  • Flexible output formats: Decode to various output formats including NV12, YUV420, YUV444, NV16, P010, P016, and RGB24 (interleaved and planar).

Encode enhancements

Encode enhancements new to PyNvVideoCodec 2.0 include the following:

  • Live encoder reconfiguration: Update encoding settings on the fly — no recreation needed.
  • SEI insertion: Insert SEI messages.
  • Multi-GPU encoding: Distribute encoding across multiple GPUs.
  • 4:2:2 encoding: Create broadcast-quality 4:2:2 streams in H.264/HEVC. Note that this is supported on the NVIDIA Blackwell architecture onward.
  • Extended input format support: NV12, YV12, IYUV, YUV444, YUV420_10BIT, YUV444_10BIT, NV16, P210, ARGB, ABGR, ARGB10, and ABGR10.

Transcode enhancements

Transcode enhancements new to PyNvVideoCodec 2.0 include the following:

  • Segment-based transcoding: Transcode video segments using timestamp ranges —optimized for deep learning-based video training workflows.

Easy installation and customization

Install PyNvVideoCodec with the following code. This process has not changed from previous versions.

pip install PyNvVideoCodec

For full source code access and customization (enabling NVTX profiling, for example), download from NVIDIA NGC and install:

pip install PyNvVideoCodec.zip

To adjust the internals or build from source, use the following code:

unzip PyNvVideoCodec.zip
cd PyNvVideoCodec
pip install .

Get started with PyNvVideoCodec 2.0

PyNvVideoCodec 2.0 delivers the performance of the NVIDIA Video Codec SDK to Python developers—with simplicity, flexibility, and raw power. 

To get you up and running quickly, sample Python applications and comprehensive PyNvVideoCodec documentation are bundled in both the PyPI and NGC packages. From simple decode and re-encode scripts to segmented based transcoding, these examples are designed to plug straight into your workflows.

To start building the next generation of video applications faster than ever, visit PyPI or NVIDIA NGC.

Discuss (0)

Tags