Feat/rtsp server and UI - #68
Closed
Gabrick75 wants to merge 8 commits into
Closed
Conversation
…-reverse fork - implement rtsp_server command - stream MJPEG frames over RTSP (RTP/JPEG) - TCP interleaved transport (RFC 2326) - compatible with VLC, NVRs, Home Assistant - no external dependencies (ffmpeg/mediamtx not required)
…tors, camera search Redesign the HTTP server UI with a modern dark theme (default) / light theme toggle, responsive grid dashboard with camera search/filter, FPS and signal quality indicators on the live stream view, and updated README with mobile/PC screenshots.
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.
Pull Request: RTSP Server with H.264/JPEG, Modern HTTP UI, Docker Support, and Full Documentation
Metadata
DavidVentura/cam-reverse:masterGabrick75/cam-reverse-rtsp:feat/rtsp-server-and-uiExecutive Summary
This pull request introduces native RTSP streaming capability to
cam-reverse, enabling direct camera integration with Network Video Recorders (NVRs), VLC, Blue Iris, Frigate, Home Assistant, and any RTSP/RTP-compliant client. The implementation includes a full RTSP/RTP server with H.264 (via GStreamer transcoding) and JPEG/RTP (RFC 2435) modes, TCP and UDP transport, RTCP Sender Reports, and SDP negotiation. Additionally, the HTTP dashboard has been modernized with a responsive dark/light theme, real-time metrics, and camera search. Docker support and comprehensive documentation are included.Technical Changes
1. RTSP Server (
rtsp_server.ts)Implementation Details:
$+ channel + length + payload) per RFC 2326 §10.12client_port/server_portnegotiationOPTIONS,DESCRIBE,SETUP,PLAY,TEARDOWN,GET_PARAMETER/SET_PARAMETER(keepalive)SDP Generation:
PT=26):a=fmtp:26 quantization=255; width=640; height=480PT=96):a=fmtp:96 packetization-mode=1; profile-level-id=42C01E(Constrained Baseline)JPEG/RTP Packetization (RFC 2435 §3):
2. GStreamer Transcoder (
transcoder.ts)Pipeline Architecture:
Encoder Parameters:
complexity=low(real-time encoding)bitrate=300000(300 kbps target)gop-size=15(keyframe interval)usage-type=camera(tuned for live source)Operational Features:
Availability Detection:
gst-launch-1.0 --versionopenh264encplugin via test pipeline3. HTTP Dashboard (
http_server.ts,asd.html)UI Enhancements:
data-themeattribute, localStorage persistence, system preference detectiongrid-template-columns: repeat(auto-fill, minmax(340px, 1fr))Technical Stack:
4. Docker Support (
Dockerfile)Multi-Stage Build:
Key Decisions:
openh264package required foropenh264encplugin (licensing separation in Debian)cam) for security5. Documentation (
docs/)architecture.mdrtsp.mdhttp_server.mdprotocol.mdgstreamer.mdreversing.mdguide-initial-setup.mdDependency Changes
Removed
node-media-server@^4.2.4— Unused dependency (present inpackage.jsonbut never imported)Added (Runtime Only)
gstreamer1.0-tools,gstreamer1.0-plugins-{base,good,bad},openh264— Via Dockerfile / host installationVerification
Automated Checks
Manual Validation
node dist/bin.cjs rtsp_server --discovery_ip 192.168.1.255rtsp://<ip>:8554/cameranode dist/bin.cjs http_server --discovery_ip 192.168.1.255http://<ip>:5000renders dark/light theme, search, FPSdocker build -t cam-reverse . && docker run --net=host cam-reverseKnown Limitations
Multi-Camera RTSP Endpoint
Current Behavior: All discovered cameras stream to a single RTSP endpoint:
rtsp://<host>:8554/cameraImpact: NVRs cannot distinguish between cameras; only the first/active camera's stream is delivered.
Workaround: Run separate
rtsp_serverinstances per camera on distinct ports (e.g., 8554, 8555, 8556) with filtered discovery IPs.Resolution: Planned follow-up to implement path-based routing (
/camera/<devId>) with session-to-camera mapping.Backward Compatibility
rtsp_servercommand is additivecamerasobject)session.ts,handlers.ts,impl.ts,discovery.ts) unmodifiedReferences
docs/protocol.md,dissector.lua