Installing PyNvVideoCodec Python Module#

Attention

PyNvVideoCodec will download and install additional third-party open source software projects - DLPack. Review the license terms of these open source projects before use.

The Python module can be installed using following ways.

Installing from PyPI#

  1. The ready-to-use Python WHL’s (Wheel) of the PyNvVideoCodec for supported Windows, Linux, WSL (Windows Subsystem for Linux), Jetson Thor, and DGX Spark platforms are hosted on PyPI.

  2. Open the bash/shell prompt and run:

    pip install PyNvVideoCodec
    

This is the recommended way to install PyNvVideoCodec.

Upon installation of the wheel, the sample applications and benchmark scripts 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:

python -c "import site; print(site.getsitepackages())"

Building and Installing from Source on NVIDIA NGC#

The package containing PyNvVideCodec Python module’s source code, all dependencies, Python sample applications, and documents is hosted on NVIDIA NGC.

Follow these steps:

  1. Download the zip file of the latest package from NVIDIA NGC .

  2. Open the bash/shell prompt from the same directory where zip was downloaded and run the following command, replacing “PyNvVideoCodec.zip” with the actual name of the downloaded zip file:

    pip install "PyNvVideoCodec.zip"
    
  3. You can access documents and Python sample applications from the package.

Use this method if you need any customization on PyNvVideoCodec Python module e.g. enabling NVTX markers for profiling.

Follow these steps to build customized version:

  1. Unzip the source package to a directory.

  2. Do the necessary modifications to the source.

  3. On the same directory where setup.py is located, run the following commands:

    pip install .