Skip to main content

pynvvideocodec (PyNvVideoCodec) is NVIDIA's Python library for hardware-accelerated video encode/decode on NVIDIA GPUs.

Project description

PyNvVideoCodec

PyNvVideoCodec is NVIDIA's Python-based library that provides simple yet powerful Python APIs for hardware-accelerated video encoding and decoding on NVIDIA GPUs.

PyNvVideoCodec is built on top of the Video Codec SDK and offers encode, decode, and transcode performance on par with it.

The library is distributed under MIT license and is officially supported by NVIDIA.

Features

PyNvVideoCodec supports following features:

Decode Features

  • Seek and frame sampling: Provides efficient and flexible methods for fetching video frames in various modes, including sequential, random, periodic, indexed, batched, and sliced, as well as at a specified target frame rate.
  • Decoder caching: Optimizes decoding of short video clips through decoder caching and reconfiguration.
  • Threaded decoder: Supports decoding on separate threads, delivering pre-decoded frames with near-zero latency, enabling high-performance video processing pipelines.
  • Decode statistics extraction: Enables extraction of low-level decode statistics—such as QP values, coding-unit types, and motion vectors—from H.264 and H.265 streams. These statistics provide valuable insights into video quality, content complexity, and encoder behaviour.
  • Video processing from buffer: Supports video processing from memory buffers, reducing I/O overhead, enabling streaming applications.
  • Low latency decode: Offers zero-latency decoding for video sequences that do not contain B-frames.
  • SEI extraction: Supports the extraction of Supplemental Enhancement Information (SEI) messages, allowing access to additional information such as HDR information, timecodes, and custom user data.
  • Stream metadata access: Enables access to stream metadata, including frame width, height, bit depth, and keyframe indices, to enhance content management.
  • GIL handling: Improved multithreaded performance through better handling of Global Interpreter Lock (GIL) in C++ layer.
  • Multi-GPU decode: Enables multi-GPU decoding to efficiently handle larger workloads.
  • Extended codec support: Supports codecs H.264, HEVC, AV1, VP8, VP9, VC1, MPEG4, MPEG2, and MPEG1
  • 4:2:2 decode: Supports 4:2:2 decoding for both H.264 and HEVC formats on Blackwell GPUs (NV16, P210 and P216 surface formats).
  • Extended output formats: Decode to various output formats including NV12, YUV420, YUV444, NV16, P010, P016 and RGB24(interleaved and planar)

Encode Features

  • Encoder reconfiguration: Supports encoder reconfiguration, enabling dynamic updating of encoding parameters without recreating encoder instances.
  • SEI insertion: Allows insertion of SEI messages during encoding.
  • GIL handling: Improved multithreaded performance through better handling of Global Interpreter Lock (GIL) in C++ layer.
  • Multi-GPU encode: Enables multi-GPU encoding to efficiently handle larger workloads.
  • Codec support: Support encoding to codec H.264, HEVC, and AV1.
  • 4:2:2 encode: Supports 4:2:2 encoding for both H.264 and HEVC formats on Blackwell GPUs (NV16 and P210 surface formats).
  • Extended input formats: Encode from various input formats including NV12, YV12, IYUV, YUV444, YUV420_10BIT, YUV444_10BIT, NV16, P210, ARGB, ABGR, ARGB10, and ABGR10.

Transcode Features

  • Segment-based transcode: Enables transcoding of video segments based on timestamp ranges, ideal for content editing and partial processing.

What's New

v 2.2 (Latest)

  • NVIDIA Jetson support: Brings easy-to-use, GPU-accelerated Python video APIs to Jetson, making it easy to build video and AI pipelines for robotics and other edge devices.
  • NVIDIA DGX Spark support: Unlocks high-throughput, Python-based video decode and encode on DGX Spark, accelerating video curation, experimentation, prototyping, training, and deployment of video and AI pipelines.
  • Access to in-memory video data: Reads video directly from Python byte data and streams, allowing video input from network buffers or cloud storage (such as S3) without writing to temporary files, while still supporting random frame access and batch retrieval.
  • New samples:
    • Face protection: Jupyter notebook that demonstrates an important privacy use case on Jetson—detecting faces in video with a TensorRT-optimized RetinaFace model and blurring them using GPU-accelerated Gaussian blur to protect identities in video.
    • Video decode from memory: Illustrates decoding video directly from in-memory Python byte data and seekable binary streams (such as bytes, bytearray, memoryview, BytesIO, or file handles).
    • Video transcode: Shows end-to-end GPU video transcoding—demuxing, decoding, encoding, and muxing—using hardware-accelerated video decode and encode.
    • Video encode with muxing: The encode sample now shows how to write encoded video directly into container formats such as MP4 and MOV.

Distribution

PyNvVideoCodec library is distributed in two formats: binary distribution via PyPI and source code distribution via NVIDIA NGC. In both cases, the library and its dependencies can be installed using a single pip install command.

This package on PyPI contains Python WHLs of the PyNvVideoCodec library and sample applications that demonstrate the use of the PyNvVideoCodec API. To install these please open the shell prompt, and run the following command.

$ pip install pynvvideocodec

This is the recommended way to install PyNvVideoCodec.

Upon installation of the wheel, the sample applications and documents are placed in the Python site-packages directory. The specific location of site-packages may vary depending on the operating system and Python environment. The path can be identified by running:

import site; print(site.getsitepackages())

Sample Applications and Documents

  • A package containing PyNvVideoCodec source code, Python sample applications and documentation can be downloaded from NVIDIA NGC.
  • For your convenience, the documents are also accessible online at PyNvVideoCodec Online Documentation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pynvvideocodec-2.2.0-cp314-cp314-win_amd64.whl (20.4 MB view details)

Uploaded CPython 3.14Windows x86-64

pynvvideocodec-2.2.0-cp314-cp314-manylinux_2_34_aarch64.whl (26.3 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.34+ ARM64

pynvvideocodec-2.2.0-cp314-cp314-manylinux_2_28_x86_64.whl (26.4 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.28+ x86-64

pynvvideocodec-2.2.0-cp313-cp313-win_amd64.whl (20.4 MB view details)

Uploaded CPython 3.13Windows x86-64

pynvvideocodec-2.2.0-cp313-cp313-manylinux_2_34_aarch64.whl (26.3 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ ARM64

pynvvideocodec-2.2.0-cp313-cp313-manylinux_2_28_x86_64.whl (26.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

pynvvideocodec-2.2.0-cp312-cp312-win_amd64.whl (20.4 MB view details)

Uploaded CPython 3.12Windows x86-64

pynvvideocodec-2.2.0-cp312-cp312-manylinux_2_28_x86_64.whl (26.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

pynvvideocodec-2.2.0-cp312-cp312-manylinux_2_28_aarch64.whl (26.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

pynvvideocodec-2.2.0-cp311-cp311-win_amd64.whl (20.4 MB view details)

Uploaded CPython 3.11Windows x86-64

pynvvideocodec-2.2.0-cp311-cp311-manylinux_2_28_x86_64.whl (26.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

pynvvideocodec-2.2.0-cp311-cp311-manylinux_2_28_aarch64.whl (26.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

pynvvideocodec-2.2.0-cp310-cp310-win_amd64.whl (20.4 MB view details)

Uploaded CPython 3.10Windows x86-64

pynvvideocodec-2.2.0-cp310-cp310-manylinux_2_28_x86_64.whl (26.4 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

pynvvideocodec-2.2.0-cp310-cp310-manylinux_2_28_aarch64.whl (26.4 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ ARM64

File details

Details for the file pynvvideocodec-2.2.0-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for pynvvideocodec-2.2.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 4e0d7c802457ae70f7183625f893726e318548c035e9d64b6dc296b20937e7a8
MD5 5d09374251d88a9dfd4911d559144add
BLAKE2b-256 d7e9108f71708e0432c7a116f72dccef81cd550e7b3dfd6869c671dc2f80b1c8

See more details on using hashes here.

File details

Details for the file pynvvideocodec-2.2.0-cp314-cp314-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for pynvvideocodec-2.2.0-cp314-cp314-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 f3f7306d4ebfb871d67bd6b54d2144bb6e6e6a4ac5a2d315e9da0d08cb38861b
MD5 83a28149ebf535086a44d9e7f8230903
BLAKE2b-256 72199230bc0f1be3aa35e97370d0c67a2b56626991460fddd31b193a0b02af55

See more details on using hashes here.

File details

Details for the file pynvvideocodec-2.2.0-cp314-cp314-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pynvvideocodec-2.2.0-cp314-cp314-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0e0438dab630476f6fe137b6789b703226a3ca982a2322f9e84f6acc78993362
MD5 3c37468fdad1cd10f7a1236434d8ddae
BLAKE2b-256 9d762a4b07115b18d9295edb1d525d89d524ca5b484e9f4200a0f92191615d51

See more details on using hashes here.

File details

Details for the file pynvvideocodec-2.2.0-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for pynvvideocodec-2.2.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 1c984cced1c3805c6432ebc5c1b0ca7ab7469289d4528df82776435b2954b310
MD5 2787a4ba0efe6ef5f79e5a2ec75f43d5
BLAKE2b-256 b15eeaa0085686af5e3df0434d09586dc1407b8d931114e5be19098e12768566

See more details on using hashes here.

File details

Details for the file pynvvideocodec-2.2.0-cp313-cp313-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for pynvvideocodec-2.2.0-cp313-cp313-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 d6c2bd9a1046100e969fc0a682cfb9439d6b0ab5032ae0566f4215c4a47efc05
MD5 a9eb421e4c9d0cfa4939080a6f27b833
BLAKE2b-256 fe1b445fe120031be47b281aa6737d4c61bd2542b387c97b97f2e83c46350bb5

See more details on using hashes here.

File details

Details for the file pynvvideocodec-2.2.0-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pynvvideocodec-2.2.0-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 715658ab9ba756215d2ef755009ff4a58da8ae6a32e3a7de7daa66c9b39c7f2b
MD5 db5624f34f910f63252588d2051ece5b
BLAKE2b-256 4c0eebdf5fa81ac1bb216113888e74f0c2ab9782061f9e424c363847e9cf48c5

See more details on using hashes here.

File details

Details for the file pynvvideocodec-2.2.0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for pynvvideocodec-2.2.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 9144a8e6d79fa510bd8240fb8816cf304f044ec103c0c93784d67033c2cdc29e
MD5 61747aaa09040b111132ec5e7cabe900
BLAKE2b-256 e802ce42c399acce0597a4381c4092f90f442da57172ab4a7e7ed2b4b128fb26

See more details on using hashes here.

File details

Details for the file pynvvideocodec-2.2.0-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pynvvideocodec-2.2.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9218da028188cbc61ce221e59454712d6a7562e81074626fd02bbcf7ef152f98
MD5 849ca95109f84cc26c072ca55f9e86aa
BLAKE2b-256 6b1de5601e313855234ae4a8e6d9883e0b99dad2016625cc379f03755f81d0eb

See more details on using hashes here.

File details

Details for the file pynvvideocodec-2.2.0-cp312-cp312-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pynvvideocodec-2.2.0-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 8386b4455b7801a8976dc49775f1e0e61ccc157a365b606a1c9bac6ff61fd4c3
MD5 7cc5a1d46133792a059913d9c2ea4d61
BLAKE2b-256 94e6a2fdd37a486335d6b9b0f24bdb8cb328c8a8e6d318952f2f2c3c917f0c56

See more details on using hashes here.

File details

Details for the file pynvvideocodec-2.2.0-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for pynvvideocodec-2.2.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 ef4edcb3f245683c0137c71f6ddd6f4a8d0592260232b63e616054684599867d
MD5 e993ea1ff402312f74ad9e8edd0ce858
BLAKE2b-256 03ada66dd309dae77a58c3044e2f4a19bf137ffd8e0780f8476b5f8525d68374

See more details on using hashes here.

File details

Details for the file pynvvideocodec-2.2.0-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pynvvideocodec-2.2.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5a05f1c8981b3a233cb58016bfb50217cbaba772c75de521013d3f8b86474c71
MD5 30ea31d85b2319df442e9641c4f03397
BLAKE2b-256 934204619163bb29aafc4a8e8cf54b610443c740213b490e0784ae695d29c2b5

See more details on using hashes here.

File details

Details for the file pynvvideocodec-2.2.0-cp311-cp311-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pynvvideocodec-2.2.0-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 5281bbc02e25661bab2c0c9e47762149a08ced5f1ba58077cb66c86f3b536570
MD5 960ed3b6a8cc76fe70e19e99e4ef1a7b
BLAKE2b-256 ce19cfbda7f820dbe13d498fa24fc664fb4fb59ae76f84e33969ce5615e9d9a5

See more details on using hashes here.

File details

Details for the file pynvvideocodec-2.2.0-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for pynvvideocodec-2.2.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 c37860541a40fb2ff70c20c2c2b256022b9d352afc860ebd74308cc924452dc5
MD5 e725c14843285cec9a27afbdc9e24e40
BLAKE2b-256 66c87728bcbbf0cf5d1764b7f751e401e897751315852e855c920edb4494cbca

See more details on using hashes here.

File details

Details for the file pynvvideocodec-2.2.0-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pynvvideocodec-2.2.0-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6733feb8a0ea6b41d9c4cab0010559cb3c448f3683938a44a7514d236088e629
MD5 a4bbf58bec1bce5b755d97d4cb1c5a78
BLAKE2b-256 463cb3c00afb206d2f91faf7b576d18cd2291f1b0b90de0b630f8e3f836716c5

See more details on using hashes here.

File details

Details for the file pynvvideocodec-2.2.0-cp310-cp310-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pynvvideocodec-2.2.0-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 0e46c4d6e39756f14b337c089940517f8773425fcda72465b62fc1356e9b3066
MD5 0cc8c71d3bc04156a66ffb9564e6bfd5
BLAKE2b-256 46196c7998ec6a1f59670b0227bc582cbf2e17c7332048ae05887b169200f841

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page