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.7-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.7-cp314-cp314-manylinux_2_28_x86_64.whl (42.3 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.28+ x86-64

python_vali-4.8.7-cp313-cp313-manylinux_2_28_x86_64.whl (42.3 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

python_vali-4.8.7-cp312-cp312-manylinux_2_28_x86_64.whl (42.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

python_vali-4.8.7-cp311-cp311-manylinux_2_28_x86_64.whl (42.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

File details

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

File metadata

File hashes

Hashes for python_vali-4.8.7-cp314-cp314t-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 bcd4ad90f9aca0630242f9f345afbea0c5e186b6ec4715fc4742b71ca6f858f4
MD5 1f38539d1d9ac967a173a79421c171d0
BLAKE2b-256 79616d2029876f26cb47773eb1b6cffaf986a894f430ea445bafc915347c4c63

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for python_vali-4.8.7-cp314-cp314-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 990c37cb3926db90047456d5a9ca658b8da29464e33606b7feb1157b1cd14270
MD5 dc5ac2a1b37f541362fba5f981c87da9
BLAKE2b-256 ae5543a7dc6478ece897b17d8f9d33ff180e212595c6f01f2a07d8b75692fdee

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for python_vali-4.8.7-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3f15cde98796d9f865a4dc3f4c82dfe0e5daba1fae221bb44f0973b69bdcee75
MD5 b35b8e5e6da27943a060a7bbc71c6e83
BLAKE2b-256 cdd946b2dff4f79ea2bb3ef54b0e86f457ab81891c90f648e470612f8d1a6aa8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for python_vali-4.8.7-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3b4ec8b2859eb269c56e94fee7525536b40b2b91e8c634300044a283ec40daa1
MD5 be2466067cdb6daa002bb26a43db37f4
BLAKE2b-256 6e920242ab5c3e00dd2552093a22380cc9785d9a36ed730c4f407006c7887933

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for python_vali-4.8.7-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 261115034788b3be683aabdf03a733127e3089099f81b22c51312a76557acf21
MD5 c70268223fff48d92340954db105385d
BLAKE2b-256 0743f79386e13db97ff6004bdc280639515a0ee5526ee44e3124d7072f279f01

See more details on using hashes here.

Provenance

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