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.22.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.22.0
File Size Uploaded Provenance Actions
matrice_streaming-0.22.0.tar.gz 865.6 kB Without provenance Details for matrice_streaming-0.22.0.tar.gz

Built distribution (wheel)

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

Total release size: 2.0 MB

Release files / matrice_streaming-0.22.0.tar.gz

Download URL matrice_streaming-0.22.0.tar.gz
Size 865.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d5c9db79936b6c1b26686752d764c0d23cf93722d60ff9ba85d6353cae2dcd15
BLAKE2b-256 checksum
How to use checksums
7355ff687a2a719304bf03a29dc25343d7cc6eed687d6adaadf73b98777103ff
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.22.0-py3-none-any.whl

Download URL matrice_streaming-0.22.0-py3-none-any.whl
Size 1.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
c65df017870e360ebccadd3c02ebc97c419c81370510e96b03c2924d1604b3bd
BLAKE2b-256 checksum
How to use checksums
f10aa913ed1f0ec12e42715262af45b1d588822f4f4b79e14c439643d11ab9ca
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.22.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.22.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