rtsp: serve a scene as N fake RTSP cameras (sim side of #62)#54
Merged
Conversation
…mtx) scripts/serve-rtsp.sh renders each camera of a domain-neutral scene with the pure-numpy software rasterizer (no GPU) and publishes it as its own live rtsp:// stream through a local mediamtx (one ffmpeg H.264 encoder per camera), printing the URLs. This turns the simulator into a rig of fake IP cameras that multicam-rt's ingest-rtsp source consumes like real ones. Pixels only, no ground truth: RTSP carries encoded video, not the analytic manifest, so this is the realism / network-path test (and a rig-free way to exercise the distributed path later), NOT the eval path. MOTA/IDF1/pose scoring stays on the offline manifest. docs/rtsp.md says this plainly. Deps (documented): brew install mediamtx + ffmpeg@7. ffmpeg@7 is pinned to match the Rust consumer's ffmpeg-next (FFmpeg 8 dropped headers it needs); the script prefers ffmpeg@7 automatically. Scene is domain-neutral (items, no people, clean-room).
Use contextlib.suppress for the BrokenPipeError on stdin close, drop an f-string without placeholders, and context-manage the mediamtx temp config. Also applies ruff format to the ffmpeg argument list.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The multicam-sim side of the RTSP fake-camera work (#62). Turns the simulator into a rig of fake IP cameras so multicam-rt can consume streamed video like real network cameras.
What it does
scripts/serve-rtsp.shrenders each camera of a domain-neutral scene with the pure-numpy software rasterizer (no GPU,dsl/raster.py) and publishes it as its own livertsp://stream:One
ffmpegH.264 encoder per camera, a localmediamtxRTSP server, URLs printed on start. The scene is deterministic (rendered once, looped in real time). Verified end to end:serve-rtsp.sh --cameras 2→ pulled real rendered frames back over RTSP.Honest scoping (documented in
docs/rtsp.md)Pixels only, no ground truth. RTSP carries encoded video, not the analytic manifest — the
uv/visible/xyz_gtlabels do not travel over the wire. So this is the realism / network-path test (and a rig-free way to exercise the distributed path later), NOT the eval path: MOTA/IDF1/pose scoring stays on the offline manifest. Said plainly in the docs.Dependencies (documented)
ffmpeg@7is pinned because the Rust consumer links FFmpeg 7 (FFmpeg 8 removed headersffmpeg-nextneeds); the script prefers/opt/homebrew/opt/ffmpeg@7/bin/ffmpegautomatically.Files
scripts/serve_rtsp.py— the server (build scene, render, mediamtx + per-camera ffmpeg, loop, print URLs).scripts/serve-rtsp.sh— dependency-checked wrapper.docs/rtsp.md— architecture, scoping, deps, run.Clean-room, domain-neutral (items moving through a shared volume — no people, no proprietary terms). No AGPL. The multicam-rt
ingest-rtspconsumer + demo wiring land in a sibling PR on the multicam-rt repo.