Quick Start¶
This topic shows the quickest way to get AVBlocks for Python running on Linux. You need a terminal, Python 3.12 or higher and nothing else: no IDE or project files. The steps are: install the Python SDK, download AVBlocks Core, point the SDK to it, and run a script.
Install the libraries required by AVBlocks and uv if you don’t have them.
Ubuntu 24.04 / 22.04 / 20.04:
sudo apt-get install libjpeg8 libtiff5 libpng16-16 libtbb2
curl -LsSf https://astral.sh/uv/install.sh | sh
Ubuntu 26.04:
sudo apt-get install libjpeg8 libtiff6 libpng16-16t64
curl -LsSf https://astral.sh/uv/install.sh | sh
1. Create a virtual environment and install the SDK¶
We use uv to install Python and to create the virtual environment. The Python must match the architecture of your machine, so that it can load the AVBlocks Core library (use an x64 Python on x86_64 machines and an arm64 Python on aarch64 machines).
mkdir -p ~/avblocks/hello
cd ~/avblocks/hello
Select the Python architecture. Use one of the following two blocks, depending on your machine:
# x64 (x86_64): use this one or the arm64 one, not both
export UV_PYTHON_ARCH=x86_64
# arm64 (aarch64): use this one or the x64 one, not both
export UV_PYTHON_ARCH=aarch64
Create the virtual environment and install the SDK:
uv venv --python 3.12
source .venv/bin/activate
uv pip install git+https://github.com/avblocks/avblocks-py.git@3.4.0.2
2. Download AVBlocks Core¶
Download the demo version of AVBlocks Core into ./sdk:
AVBLOCKS_BASE_URL="https://github.com/avblocks/avblocks-core/releases/download"
AVBLOCKS_VERSION="v3.4.0-demo.1"
# select the build that matches the machine
case "$(uname -m)" in
arm64|aarch64) PLATFORM="linux-arm64"; ARCH="arm64" ;;
*) PLATFORM="linux"; ARCH="x64" ;;
esac
mkdir -p ./sdk
cd ./sdk
curl -L \
-o "avblocks-${AVBLOCKS_VERSION}-${PLATFORM}.tar.gz" \
"${AVBLOCKS_BASE_URL}/${AVBLOCKS_VERSION}/avblocks-${AVBLOCKS_VERSION}-${PLATFORM}.tar.gz"
tar -xzf "avblocks-${AVBLOCKS_VERSION}-${PLATFORM}.tar.gz"
cd ..
3. Point the SDK to AVBlocks Core¶
Set AVBLOCKS_CORE_PATH to the directory that contains libAVBlocks64.so:
export AVBLOCKS_CORE_PATH=$PWD/sdk/lib/$ARCH
4. Run a script¶
Create the file hello.py:
from avblocks import Library
Library.initialize()
print(Library.description())
Library.shutdown()
Run it:
python hello.py
The output looks similar to this:
AVBlocks.Python 3.4.0, core: AVBlocks 3.4.0 (ba37215) x64 Release Demo Linux
The environment variable is only set in the current terminal. In a new terminal run source .venv/bin/activate and the export AVBLOCKS_CORE_PATH=... command again.
Next steps¶
Installation has the same steps for all platforms and the demo assets used by the samples.
Try the Simple Video Converter or the Simple Audio Converter.