Python bindings for Blackmagic DeckLink SDK
Project description
pydecklink
Python bindings for the Blackmagic DeckLink SDK, exposing the capture and scheduled playback APIs via CPU buffers (numpy).
Requirements
- Linux or Windows (Blackmagic Desktop Video installed)
- Blackmagic DeckLink hardware
- Python 3.12+
- uv (manages Python and dependencies)
The DeckLink SDK headers are vendored in the repo.
| Linux | Windows | |
|---|---|---|
| Runtime library | libDeckLinkAPI.so loaded via dlopen |
COM interfaces via CoCreateInstance |
| Build toolchain | C++ compiler, CMake | MSVC, Windows SDK (provides MIDL), CMake |
| SDK artefacts | Pre-compiled headers + dispatch source | IDL files compiled to headers by MIDL at build time |
Install Blackmagic Desktop Video on the host for both platforms.
Install
uv pip install .
Or for development (editable build with the dev dependency group —
pytest, mypy, psutil):
uv sync
Windows
Building on Windows requires Visual Studio
with the Desktop development with C++ workload (includes MSVC and
the Windows SDK). CMake automatically locates midl.exe from the
Windows SDK to compile the vendored DeckLink IDL files into C++ headers
and COM stubs.
uv sync
Devcontainer (Linux)
A VS Code devcontainer provides a ready-to-code environment. It bind-mounts the host's Desktop Video libraries and DeckLink device nodes for hardware testing inside the container.
The container exposes Blackmagic's firmware tooling on PATH via
/var/lib/blackmagic/bin. BlackmagicFirmwareUpdater and
DesktopVideoUpdateTool are the same multi-call binary dispatched
on argv[0]; prefer DesktopVideoUpdateTool for scripted
invocations — its flag interface (--list, --device ID,
--all, --quiet) is the automation-friendly surface.
BlackmagicFirmwareUpdater is the interactive shorthand (status,
update [device]).
Quick start
import pydecklink
# Desktop Video runtime version
print(pydecklink.api_version().string)
# Enumerate DeckLink devices
for info in pydecklink.list_devices():
print(f"{info.index}: {info.model_name}")
# Display modes a device can output
dev = pydecklink.Device(0)
for m in dev.list_output_modes():
fps = pydecklink.get_mode_fps(m.mode)
print(f"{m.name}: {m.width}x{m.height} @ {fps:.2f}")
Examples
| Script | What it does |
|---|---|
passthrough.py |
Zero-copy SDI capture → playout loop. |
cuda_passthrough.py |
Canonical SDI → CUDA kernel → SDI recipe (drop in your own kernel callable). |
cuda_loopback_latency.py |
Fingerprint loopback benchmark for end-to-end latency. |
cuda_register_pinned.py |
Register CUDA pinned memory for the H2D capture path. |
detect_signals.py |
Walk all inputs, report which carry an active signal. |
dump_topology.py |
Print each device's identity and profile attributes. |
CUDA examples need the cuda-examples extra (uv pip install ".[cuda-examples]").
Running hardware tests
Hardware tests require a DeckLink card. They are excluded by default;
opt in with -m hardware.
uv run pytest -m hardware -v
License
BSD-3-Clause — see LICENSE.
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
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pydecklink-0.3.3-cp312-abi3-win_amd64.whl.
File metadata
- Download URL: pydecklink-0.3.3-cp312-abi3-win_amd64.whl
- Upload date:
- Size: 133.2 kB
- Tags: CPython 3.12+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d1f8d9c57f4dbc12e4dd9776616022ccbbe0f43eadbc831ef0456b7aa548508f
|
|
| MD5 |
255b20bd6f45a26504d07d3c0cd53d30
|
|
| BLAKE2b-256 |
a7c1ef64d03de7d795727de7195d8f73eca034fd9c6716aa33a28c650015d14b
|
Provenance
The following attestation bundles were made for pydecklink-0.3.3-cp312-abi3-win_amd64.whl:
Publisher:
publish.yml on Fuse-Technical-Group/pydecklink
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pydecklink-0.3.3-cp312-abi3-win_amd64.whl -
Subject digest:
d1f8d9c57f4dbc12e4dd9776616022ccbbe0f43eadbc831ef0456b7aa548508f - Sigstore transparency entry: 1856018974
- Sigstore integration time:
-
Permalink:
Fuse-Technical-Group/pydecklink@3e29c796efda4c2610bfc5d0262778a108c5cf22 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Fuse-Technical-Group
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3e29c796efda4c2610bfc5d0262778a108c5cf22 -
Trigger Event:
workflow_run
-
Statement type:
File details
Details for the file pydecklink-0.3.3-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: pydecklink-0.3.3-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 152.3 kB
- Tags: CPython 3.12+, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ccc32749367bff531fd0ae79c08d1d74c4e2870df797515856914b161898aec7
|
|
| MD5 |
28e18da16a810d906d5411172ecc631f
|
|
| BLAKE2b-256 |
64015951ad93a36ffee9f96c16a98a03ac19e71d063a20f2b1811cfd9ae1f1ae
|
Provenance
The following attestation bundles were made for pydecklink-0.3.3-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:
Publisher:
publish.yml on Fuse-Technical-Group/pydecklink
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pydecklink-0.3.3-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
ccc32749367bff531fd0ae79c08d1d74c4e2870df797515856914b161898aec7 - Sigstore transparency entry: 1856018942
- Sigstore integration time:
-
Permalink:
Fuse-Technical-Group/pydecklink@3e29c796efda4c2610bfc5d0262778a108c5cf22 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Fuse-Technical-Group
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3e29c796efda4c2610bfc5d0262778a108c5cf22 -
Trigger Event:
workflow_run
-
Statement type:
File details
Details for the file pydecklink-0.3.3-cp312-abi3-macosx_15_0_arm64.whl.
File metadata
- Download URL: pydecklink-0.3.3-cp312-abi3-macosx_15_0_arm64.whl
- Upload date:
- Size: 126.5 kB
- Tags: CPython 3.12+, macOS 15.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
64363a73f1d04e9b137d4930efda384b0d990bf81dd75a9c04ffdc9ee9509da4
|
|
| MD5 |
8d9046ef67dfc908506e50cba0b5210a
|
|
| BLAKE2b-256 |
c9af89173d7a6aa4988d3778d0b0db8e4be27cd78409e159e09b65ddaecb8104
|
Provenance
The following attestation bundles were made for pydecklink-0.3.3-cp312-abi3-macosx_15_0_arm64.whl:
Publisher:
publish.yml on Fuse-Technical-Group/pydecklink
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pydecklink-0.3.3-cp312-abi3-macosx_15_0_arm64.whl -
Subject digest:
64363a73f1d04e9b137d4930efda384b0d990bf81dd75a9c04ffdc9ee9509da4 - Sigstore transparency entry: 1856018900
- Sigstore integration time:
-
Permalink:
Fuse-Technical-Group/pydecklink@3e29c796efda4c2610bfc5d0262778a108c5cf22 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Fuse-Technical-Group
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3e29c796efda4c2610bfc5d0262778a108c5cf22 -
Trigger Event:
workflow_run
-
Statement type: