Experimental video processing pipeline using Jax.
# Install dependencies.
sudo apt install pkg-config python3 libavformat-dev libavcodec-dev libavdevice-dev \
libavutil-dev libswscale-dev libswresample-dev libavfilter-dev
# Setup a virtual environment (optional).
python3 -m venv venv
# Activate the virtual environment (optional).
source venv/bin/activate
# Install PyAV from source (this links against system ffmpeg libraries, which is necessary to get hardware-accelerated encoders).
pip3 install av --no-binary av
# Install JAX (with NVIDIA GPU support).
pip3 install jax[cuda12]
# Or, install CPU-only JAX.
pip3 install jax
# See Jax documentation for installing JAX with experimental backends (eg. AMD ROCm):
# https://jax.readthedocs.io/en/latest/installation.html
# Install homebrew (https://brew.sh/) and Python
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install python3
# Install ffmpeg (default is version 7 as of this writing, which is not supported by PyAV, so we force version 6).
brew install ffmpeg@6 pkg-config
brew link ffmpeg@6
# Setup a virtual environment (optional).
python3 -m venv venv
# Activate the virtual environment (optional).
source venv/bin/activate
# Install JAX with the experimental METAL backend.
pip3 install jax-metal
# Install other dependencies.
pip3 install tqdm