Skip to main content

Video processing in Python

Project description

VALI

VALI is a video analytics and processing project for python. It’s set of C++ libraries and Python bindings which provide full HW acceleration for video processing tasks such as decoding, encoding, transcoding and GPU-accelerated color space and pixel format conversions.

VALI also supports DLPack and can share memory with all the modules which supports DLPack (e. g. share decoded surfaces with torch).

Documentation

https://romanarzumanyan.github.io/VALI

Prerequisites

VALI works on Linux(tested on Ubuntu 22.04) and Windows

  • NVIDIA display driver: 525.xx.xx or above

  • CUDA Toolkit 11.2 or above

    • CUDA toolkit has driver bundled with it e.g. CUDA Toolkit 12.0 has driver 530.xx.xx. During installation of CUDA toolkit you could choose to install or skip installation of the bundled driver. Please choose the appropriate option.
  • FFMPEG

    • VALI will download FFMPEG build from https://github.com/BtbN/FFmpeg-Builds
    • Make sure you don't have system FFMPEG packages installed. Otherwise, CMake will use them instead. You may run apt remove libavfilter-dev libavformat-dev libavcodec-dev libswresample-dev libavutil-dev on Ubuntu to remove them. Alternatively, build in Docker.
  • Python 3.11 and above

  • Install a C++ toolchain either via Visual Studio or Tools for Visual Studio.

    • Recommended version is Visual Studio 2017 and above (Windows only)

Licensing

VALI sources are available under Apache 2 license.

Wheels contain FFMpeg libraries downloaded from https://github.com/BtbN/FFmpeg-Builds/releases that are licensed under LGPLv2.1.

This software uses code of FFmpeg licensed under the LGPLv2.1 and its source can be downloaded here

Install from PyPi (Linux only for now)

python3 -m pip install python_vali

All information below is relevant if you want to build VALI on your local machine.

Linux

Ubuntu 22.04 is recommended.

Install dependencies

apt install -y \          
          wget \
          build-essential \
          git
Install CUDA Toolkit
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.0-1_all.deb
sudo dpkg -i cuda-keyring_1.0-1_all.deb
sudo apt-get update
sudo apt-get install -y cuda
# Ensure nvcc to your $PATH (most commonly already done by the CUDA installation)
export PATH=/usr/local/cuda/bin:$PATH
Install locally with pip
# Update git submodules
git submodule update --init --recursive
pip3 install .

To check whether VALI is correctly installed run the following Python script

import python_vali as vali

If using Docker via Nvidia Container Runtime, please make sure to enable the video driver capability: https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/user-guide.html#driver-capabilities via the NVIDIA_DRIVER_CAPABILITIES environment variable in the container or the --gpus command line parameter (e.g. docker run -it --rm --gpus 'all,"capabilities=compute,utility,video"' nvidia/cuda:12.1.0-base-ubuntu22.04).

Windows

# Update git submodules
git submodule update --init --recursive
pip install .

To check whether VALI is correctly installed run the following Python script

cuda_path = os.environ["CUDA_PATH"]
os.add_dll_directory(os.path.join(cuda_path, "bin"))
import python_vali as vali

Docker

For convenience, we provide a Docker images located at docker that you can use to easily install all dependencies (docker and nvidia-docker are required)

DOCKER_BUILDKIT=1 sudo docker build \
  --tag vali-gpu \
  --file docker/Dockerfile \
  --build-arg PIP_INSTALL_EXTRAS=torch .

docker run -it --rm --gpus=all vali-gpu

PIP_INSTALL_EXTRAS can be any subset listed under project.optional-dependencies in pyproject.toml.

Offline documentation

A documentation for VALI can be generated from this repository:

pip install . # install VALI
pip install sphinx  # install documentation tool sphinx
cd docs
make html

You can then open _build/html/index.html with your browser.

Community Support

Please use project's Discussions page for that.

OnPullRequest

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.

python_vali-4.8.6-cp314-cp314t-manylinux_2_28_x86_64.whl (42.8 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.28+ x86-64

python_vali-4.8.6-cp314-cp314-manylinux_2_28_x86_64.whl (42.2 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.28+ x86-64

python_vali-4.8.6-cp313-cp313-manylinux_2_28_x86_64.whl (42.2 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

python_vali-4.8.6-cp312-cp312-manylinux_2_28_x86_64.whl (42.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

python_vali-4.8.6-cp311-cp311-manylinux_2_28_x86_64.whl (42.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

File details

Details for the file python_vali-4.8.6-cp314-cp314t-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for python_vali-4.8.6-cp314-cp314t-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6d7249357f4c39423be18756d68ba0a6ba1d0acd085d69cbef19771cb82d7919
MD5 029207f9da4e0f32f18009293e66f771
BLAKE2b-256 0908e70973c28521a242126586fe8f8655a61a748126659b4d4f788979d1eac2

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_vali-4.8.6-cp314-cp314t-manylinux_2_28_x86_64.whl:

Publisher: OnTaggedCommitPush.yml on RomanArzumanyan/VALI

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file python_vali-4.8.6-cp314-cp314-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for python_vali-4.8.6-cp314-cp314-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 98e3719c11bbd3e12060800d26066ddcaa3b8d4d655562002c326deff5b1a588
MD5 6728ff1071975052118ac6e6759f263b
BLAKE2b-256 68ce165992ffb51dfe7079dd0b90a27a4421d0aa2ea2d142a7b30f62ea95579a

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_vali-4.8.6-cp314-cp314-manylinux_2_28_x86_64.whl:

Publisher: OnTaggedCommitPush.yml on RomanArzumanyan/VALI

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file python_vali-4.8.6-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for python_vali-4.8.6-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2dc7cda6b227e8c457171387765c9c0ead6e7ce3b4ca03edaf18237ea1659e8e
MD5 3d9458ba3c4721f0510ebe68fea5cdc8
BLAKE2b-256 f0fa677f05fd39582b82f7090e3424810a0492f458499a4777daf3bf4cda4584

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_vali-4.8.6-cp313-cp313-manylinux_2_28_x86_64.whl:

Publisher: OnTaggedCommitPush.yml on RomanArzumanyan/VALI

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file python_vali-4.8.6-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for python_vali-4.8.6-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 755eb742ffd1efd5dc047fe9604da964554c5466f56e0412e7aaaf12611bb503
MD5 ae916f8668a06473e967fde304fe0f6e
BLAKE2b-256 2bdfa85a61f8ad02ed950d2e2c65e85c92c3eed3a5ffaa7d64842552c21ae183

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_vali-4.8.6-cp312-cp312-manylinux_2_28_x86_64.whl:

Publisher: OnTaggedCommitPush.yml on RomanArzumanyan/VALI

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file python_vali-4.8.6-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for python_vali-4.8.6-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 dc52e40369a151dea380f2283efca693363f41415f656e19c690f728d70d23ba
MD5 f9f2257a467397c75d18b59723e03467
BLAKE2b-256 51aaecef11afca6858dcbb504165ce41f528c8ba2521361800a7ea18a72d8787

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_vali-4.8.6-cp311-cp311-manylinux_2_28_x86_64.whl:

Publisher: OnTaggedCommitPush.yml on RomanArzumanyan/VALI

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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