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, macOS, or Windows with Blackmagic Desktop Video installed
- Blackmagic DeckLink hardware
- Python 3.12+
Install
uv pip install pydecklink
Prebuilt wheels ship for Linux (manylinux x86_64), macOS, and Windows. Building from source requires a C++ toolchain — see CONTRIBUTING.md.
Usage
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
The examples/ directory in the repo contains runnable scripts:
| 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 "pydecklink[cuda-examples]").
API
The package ships type stubs (pydecklink/_bindings.pyi) and a py.typed
marker, so editors and mypy see the full typed surface. Key entry points:
Device discovery
list_devices() -> list[DeviceInfo],device_count() -> intapi_version() -> APIVersion— Desktop Video runtime versionconnector_label(device) -> str | None— physical SDI port label
Display-mode helpers
get_mode_width(mode),get_mode_height(mode),get_mode_fps(mode)get_mode_frame_duration(mode),get_frame_bytes(mode, pixel_format),get_row_bytes(pixel_format, width)
Device — open a card with Device(index), then:
- Capture:
enable_video_input(...),start_streams(), andpop_capture_frame()(copying) orpop_capture_frame_ref()(zero-copy). - Scheduled playback:
enable_video_output(...),create_frame_pool(...),acquire_output_frame(),schedule_output_frame(...),start_scheduled_playback(...). - Zero-copy passthrough:
schedule_capture_frame(...)forwards a captured frame straight to output with no memcpy.
Frames — CaptureFrame, CaptureFrameRef (zero-copy), and MutableFrame
expose pixel data as a numpy array via .data, alongside .width,
.height, .row_bytes.
Enums — DisplayMode, PixelFormat, VideoConnection, VideoInputFlag,
VideoOutputFlag, FieldDominance, and related SDK constants.
Custom memory — VideoBufferAllocator / VideoBufferAllocatorProvider
back capture and playback with caller-owned buffers (e.g. CUDA pinned memory)
for direct GPU DMA. Connector profiles — ProfileManager, Profile,
and ProfileID switch a card's duplex/sub-device layout.
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.4.0-cp312-abi3-win_amd64.whl.
File metadata
- Download URL: pydecklink-0.4.0-cp312-abi3-win_amd64.whl
- Upload date:
- Size: 138.5 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 |
8e232cdf59d984b5e3af3d562d0b5ff03aa590dc4415d3a8e9155859adf2fc8b
|
|
| MD5 |
c5b46677ea5d86b5cb4fa4e4f431a4eb
|
|
| BLAKE2b-256 |
43b61e336465e5985365e87b2c9250c323fa651a485017f1ed52375202012602
|
Provenance
The following attestation bundles were made for pydecklink-0.4.0-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.4.0-cp312-abi3-win_amd64.whl -
Subject digest:
8e232cdf59d984b5e3af3d562d0b5ff03aa590dc4415d3a8e9155859adf2fc8b - Sigstore transparency entry: 2135322124
- Sigstore integration time:
-
Permalink:
Fuse-Technical-Group/pydecklink@56e631096ce43f1b0936ed5ae08efb0eb667f3ce -
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@56e631096ce43f1b0936ed5ae08efb0eb667f3ce -
Trigger Event:
workflow_run
-
Statement type:
File details
Details for the file pydecklink-0.4.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: pydecklink-0.4.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 160.7 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 |
e5faba0000bef17a0b777048010b609f0433f64360109a95531ff2595160f08b
|
|
| MD5 |
324f968a41459624ad2c613fbd205e15
|
|
| BLAKE2b-256 |
bef76187591fb5be3b8052b021aa9d6c24fead7e6842cb10f288d6700238573a
|
Provenance
The following attestation bundles were made for pydecklink-0.4.0-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.4.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
e5faba0000bef17a0b777048010b609f0433f64360109a95531ff2595160f08b - Sigstore transparency entry: 2135322113
- Sigstore integration time:
-
Permalink:
Fuse-Technical-Group/pydecklink@56e631096ce43f1b0936ed5ae08efb0eb667f3ce -
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@56e631096ce43f1b0936ed5ae08efb0eb667f3ce -
Trigger Event:
workflow_run
-
Statement type:
File details
Details for the file pydecklink-0.4.0-cp312-abi3-macosx_26_0_arm64.whl.
File metadata
- Download URL: pydecklink-0.4.0-cp312-abi3-macosx_26_0_arm64.whl
- Upload date:
- Size: 132.9 kB
- Tags: CPython 3.12+, macOS 26.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a98176932844a3149dfaa308da0a809a8b6aeaf0c0472a05b163538dfa77ab9
|
|
| MD5 |
a372299ac4163cda6619f982a2b8280a
|
|
| BLAKE2b-256 |
64b379f860a48726c3e374c184a4932a715ec1efe2ff009d4b2da05d332a9395
|
Provenance
The following attestation bundles were made for pydecklink-0.4.0-cp312-abi3-macosx_26_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.4.0-cp312-abi3-macosx_26_0_arm64.whl -
Subject digest:
8a98176932844a3149dfaa308da0a809a8b6aeaf0c0472a05b163538dfa77ab9 - Sigstore transparency entry: 2135322136
- Sigstore integration time:
-
Permalink:
Fuse-Technical-Group/pydecklink@56e631096ce43f1b0936ed5ae08efb0eb667f3ce -
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@56e631096ce43f1b0936ed5ae08efb0eb667f3ce -
Trigger Event:
workflow_run
-
Statement type: