Skip to main content

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 an action_id into 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.20.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for matrice-streaming 0.20.0
File Size Uploaded Provenance Actions
matrice_streaming-0.20.0.tar.gz 849.4 kB Without provenance Details for matrice_streaming-0.20.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for matrice-streaming 0.20.0
File Interpreter ABI Platform Actions
matrice_streaming-0.20.0-py3-none-any.whl Python 3 none any Details for matrice_streaming-0.20.0-py3-none-any.whl

Total release size: 2.0 MB

Release files / matrice_streaming-0.20.0.tar.gz

Download URL matrice_streaming-0.20.0.tar.gz
Size 849.4 kB
Tags Source
SHA-256 checksum
How to use checksums
18dae779986647f6a84ddf8f14b08eef329459d6fb5ac20239f7d797cbec434c
BLAKE2b-256 checksum
How to use checksums
07f7c5a80fa3a671a17bae244942689e40618179f9c16c5990d0984b87d1155e
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.20.0-py3-none-any.whl

Download URL matrice_streaming-0.20.0-py3-none-any.whl
Size 1.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
8aa7c0c1e16e7140e2bbd45225b067fe11fd36f58d8c389b7aa380a9c1989c8c
BLAKE2b-256 checksum
How to use checksums
3f9e7519b989b0f0a89eb114bd2193bf827f48d52b45277628c60759bb642f26
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.20.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.

Release history Release notifications | RSS feed

This release

0.20.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page