How mavlink/mavlink-camera-manager works
Project type and purpose
• This is a cross-platform, full-stack camera server written in Rust.
• It exposes a REST API and a web UI for managing camera streams, integrates with GStreamer for media pipelines, and uses MAVLink to advertise streams to ground stations.
• It also offers WebRTC streaming via an embedded signalling server and optional TURN.
File structure
• Top-level:
• Cargo.toml / build.rs: Rust project config and build script
• docker/: Dockerfile and launch scripts
• src/main.rs: entrypoint (CLI)
• src/lib/: all business logic, grouped by domain
• src/lib modules:
• cli: parses args, bootstraps managers
• server: REST API (pages.rs serves HTML, manager.rs wires routes)
• stream: GStreamer pipelines, multiple sink types (RTSP, WebRTC, UDP)
• video & video_source: abstracts camera sources (V4L2, ONVIF, redirect, local)
• controls: camera control interfaces (V4L2, ONVIF)
• mavlink: rust-mavlink integration, advertises streams via MAVLink messages
• settings: persistent configuration
• logger: log management (rotation, verbosity)
• network/helper: utility functions, threads, macros
• Frontend nested under stream/webrtc/frontend: a Vue + Vite app serving the WebRTC client.
README for additional insights
• Describes key features: REST API + Swagger, WebRTC readiness, SDP files for RTSP, MAVLink integration, and CLI usage.
• Mentions ports (REST: 6020, MAVLink: configurable), GStreamer version, and persistent settings.
Elements
• CLI → Managers (initialization)
• Browser → REST API → Stream Manager → Pipelines → Sinks → Clients
• Stream Manager → MAVLink Manager → GCS
• Pipelines ⇄ GStreamer libraries
• Orange: frontend/UI