matrice_streaming — Streaming Gateway
matrice_streaming is the Streaming Gateway (SG), the frame producer of the
Matrice video pipeline. Given a set of cameras, it opens each stream (RTSP fronted by
MediaMTX, or file/HTTP sources), decodes frames at a target FPS, and publishes every
decoded frame into a per-camera shared-memory ring buffer that downstream processes —
primarily the inference engine — attach to and read zero-copy. Cameras are added,
updated, and removed at runtime without restarting the process, driven by Kafka events
plus a periodic backend poll.
There are two decode backends, chosen at construction:
- NVDEC (GPU) — the production path. Frames stay on the GPU as NV12 surfaces and are handed to the inference engine through CUDA IPC.
- OpenCV (CPU) — a
cv2.VideoCapture-based fallback for hosts without a usable GPU decode stack.
SG does not run inference and does not force preprocessing: frames are published at native resolution and the inference engine owns resize/letterbox/color conversion.
Install
pip install matrice_streaming
Heavy runtime dependencies (NVDEC/CuPy, OpenCV, Kafka and Redis clients) are provided by the deployment image rather than declared as hard dependencies of the wheel.
Public API
Everything external lives under matrice_streaming.streaming_gateway:
StreamingAction— the production entry point; turns anaction_idinto a running, monitored, auto-restarting gateway.StreamingGateway— the orchestrator underneath, used directly in tests or custom control loops.InstanceStreamingGatewayUtil/StreamingGatewayUtil— backend API clients.InputStream— the per-camera config dataclass.InstanceEventListener— Kafka-driven camera reconciliation.
Documentation
The knowledge-transfer docs live in docs/. Start with the
docs index, which gives the session reading order and a glossary.
The chapters most readers need first:
| # | Chapter | One line |
|---|---|---|
| 01 | Architecture overview | StreamingAction → StreamingGateway → one decode backend, the process/thread model, and lifecycle states. |
| 03 | NVDEC pipeline | The production decode path: demuxers, codec handling, per-GPU worker processes, the decoder pool, and the watchdog. |
| 07 | Configuration and ops | Environment variables and constructor parameters, plus production symptoms → causes → knobs. |
| 15 | Local dev and testing | Running the gateway and its tests on a development host. |
Contributor workflow (hooks, signed commits, trailers) is in CONTRIBUTING.md and docs/git-hooks-commit-workflow.md.
License
See LICENSE.
Metadata
Release files for matrice-streaming 0.21.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| matrice_streaming-0.21.0.tar.gz | 865.2 kB | Without provenance | Details for matrice_streaming-0.21.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| matrice_streaming-0.21.0-py3-none-any.whl | Python 3 | none | any | Details for matrice_streaming-0.21.0-py3-none-any.whl |
Total release size: 2.0 MB
Release files / matrice_streaming-0.21.0.tar.gz
| Download URL | matrice_streaming-0.21.0.tar.gz |
|---|---|
| Size | 865.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
07bcfc02111a3f359104254eb2377bce8a70c7467fcf02a472d0580b95887830
|
|
BLAKE2b-256 checksum How to use checksums |
1e47e7c39b781096f27268de7ddb4c5a301988ffa02d17c3c66bfdefc0f01e4c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Release files / matrice_streaming-0.21.0-py3-none-any.whl
| Download URL | matrice_streaming-0.21.0-py3-none-any.whl |
|---|---|
| Size | 1.1 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d86a024ebbeeb2b981584f10a6893fd1db0e020fc767406707cea18ffb741840
|
|
BLAKE2b-256 checksum How to use checksums |
77a239be93ec4a9bab8e362ee2e433790c88baef5e79a4570818902dee124034
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Security for matrice-streaming 0.21.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.