GithubHelp home page GithubHelp logo

lihuibng / videoprocessingframework Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nvidia/videoprocessingframework

0.0 1.0 0.0 2.48 MB

Set of Python bindings to C++ libraries which provides full HW acceleration for video decoding, encoding and GPU-accelerated color space and pixel format conversions

License: Apache License 2.0

Shell 0.10% C++ 85.24% Python 9.26% C 2.02% Cuda 0.65% Makefile 0.57% CMake 2.16%

videoprocessingframework's Introduction

VideoProcessingFramework

VPF stands for Video Processing Framework. It’s set of C++ libraries and Python bindings which provides full HW acceleration for video processing tasks such as decoding, encoding, transcoding and GPU-accelerated color space and pixel format conversions.

VPF also supports exporting GPU memory objects such as decoded video frames to PyTorch tensors without Host to Device copies. Check the Wiki page on how to build from source.

Installation

VPF works on Windows and Linux. The requirements are as follows

  • CUDA Toolkit (npp)
  • FFMPEG (with libavfilter>=7.110.100)
  • C++ compiler

Linux

We recommend Ubuntu 22.04 as it comes with a recent enough ffmpeg system packages.

# Install dependencies (replace XXX in libnvidia-encode-XXX, libnvidia-decode-XXX with your driver version)
# libnvidia-encode is part of the driver meta package so if your driver works fine you might already have it ! 
apt install -y \
          libavfilter-dev \
          libavformat-dev \
          libavcodec-dev \
          libswresample-dev \
          libavutil-dev\
          wget \
          cmake \
          build-essential \
          git \
          libnvidia-encode-XXX \
          libnvidia-decode-XXX 
# Install CUDA Toolkit (if not already present)
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 VPF
pip3 install git+https://github.com/NVIDIA/VideoProcessingFramework
# or if you cloned this repository
pip3 install .

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

import PyNvCodec

Please note that some examples have additional dependencies https://github.com/NVIDIA/VideoProcessingFramework/blob/73a14683a17c8f1c7fa6dd73952f8813bd34a11f/setup.py#L26-L31 that need to be installed via pip. Samples using PyTorch will require an optional extension which can be installed via

pip install src/PytorchNvCodec  # install Torch extension if needed (optional), requires "torch" to be installed before

After resolving those you should be able to run make run_samples_without_docker using your local pip installation.

Windows

# Indicate path to your FFMPEG installation (with subfolders `bin` with DLLs, `include`, `lib`)
$env:SKBUILD_CONFIGURE_OPTIONS="-DTC_FFMPEG_ROOT=C:/path/to/your/ffmpeg/installation/ffmpeg/" 

pip install .

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

import PyNvCodec

Please note that some examples have additional dependencies https://github.com/NVIDIA/VideoProcessingFramework/blob/73a14683a17c8f1c7fa6dd73952f8813bd34a11f/setup.py#L26-L31 that need to be installed via pip. Samples using PyTorch will require an optional extension which can be installed via

pip install src/PytorchNvCodec  # install Torch extension if needed (optional), requires "torch" to be installed before

Docker

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

DOCKER_BUILDKIT=1 docker build \
                --tag vpf-gpu-all \
                -f docker/Dockerfile.gpu \
                --build-arg GEN_PYTORCH_EXT=1 \
                --build-arg GEN_OPENGL_EXT=1 \
                .
docker run -it --rm --gpus=all vpf-gpu-all

Documentation

A documentation for Video Processing Framework can be generated from this repository:

pip install . # install Video Processing Framework
pip install src/PytorchNvCodec  # install Torch extension if needed (optional), requires "torch" to be installed before
pip install sphinx  # install documentation tool sphinx
cd docs
make html

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

Community Support

If you did not find the information you need or if you have further questions or problems, you are very welcome to join the developer community at NVIDIA. We have dedicated categories covering diverse topics related to video processing and codecs.

The forums are also a place where we would be happy to hear about how you made use of VPF in your project.

videoprocessingframework's People

Contributors

rarzumanyan avatar thehamsta avatar gedoensmax avatar vtpl1 avatar dependabot[bot] avatar kumattau avatar rnaskulwar avatar dbermond avatar sniklaus avatar tracelessle avatar mholtmanns avatar zjdneos avatar lferraz avatar sandhawalia avatar yozer avatar ferdnyc avatar vladimirgl avatar jeroenhoogers avatar litinglin avatar n1mmy avatar ald2004 avatar frank840306 avatar maxclaey avatar zhangheli avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.