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.5-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.5-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.5-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.5-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.5-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.5-cp314-cp314t-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for python_vali-4.8.5-cp314-cp314t-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0f55568a6a0312e27790d8c3594fb306d9e1c38df88f06710dae31c396ea5b93
MD5 f30b5ddf302cfc12599097826b7b4750
BLAKE2b-256 fffd988de93658974fe34ba07a10ba5c9df917239417799ed59c1f28dc0f6779

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_vali-4.8.5-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.5-cp314-cp314-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for python_vali-4.8.5-cp314-cp314-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 21031125644c7b0ffe611ccf5da08b564f7b6caf08e02481558514e7ca6a1bcb
MD5 fe1b270b21bee9dc8c506db8d7bc4705
BLAKE2b-256 caaa868f94e794ff8703bfcae94df0d5bac42dc39cda77f52e7b417039e9b0b1

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_vali-4.8.5-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.5-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for python_vali-4.8.5-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8fd74d6468d6b9f58c35d26718f532f067dd9171fa22c06c0b2d0509a4b38a4e
MD5 066699d5a1c8f268f663d51c68dced9d
BLAKE2b-256 dfd4fa0d67b6680dfe06f550239c219ed1204620cb9b715d86d91c55925ba91b

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_vali-4.8.5-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.5-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for python_vali-4.8.5-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 15dad6f89c05563b80e267271b36b82508a9fbae6914a626b6d00e29aa7a30aa
MD5 3614b6ef44882a89602399b7f7429e15
BLAKE2b-256 8dffc7b8a6f6ebe56435af6a2e1108c8135fb95661aa483e85933c232e3c87ce

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_vali-4.8.5-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.5-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for python_vali-4.8.5-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5b5c5de0cdfe34a9af6bf8a70c0f426edfb236b41696629483f3f170311e6266
MD5 084225d83026712e196710041ac1ea73
BLAKE2b-256 9732c39fc3eb727fbc42189012b4670001cdb64edcdd7539099ad3d1fa1a2e5a

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_vali-4.8.5-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