Mission Planner supports real-time video streaming from drones and other autonomous vehicles through integration with GStreamer, a powerful multimedia framework. This subsystem allows operators to view camera feeds, control gimbals, and manage camera settings directly within the Ground Control Station (GCS) interface.
The video streaming functionality includes:
Sources: ExtLibs/Utilities/GStreamer.cs21-32 ExtLibs/ArduPilot/Mavlink/CameraProtocol.cs18-35 Controls/GimbalVideoControl.cs27-34 ExtLibs/Utilities/CaptureMJPEG.cs13-29
The video streaming system consists of the core GStreamer wrapper, MAVLink protocol handlers, and specialized UI controls.
This diagram maps the high-level video components to their specific code entities.
Sources: ExtLibs/Utilities/GStreamer.cs21-38 Controls/GimbalVideoControl.cs34-58 ExtLibs/ArduPilot/Mavlink/CameraProtocol.cs37-40 Controls/Video.cs10
Mission Planner uses a dynamic backend selection for GStreamer, supporting Windows, Linux, and Android. The GStreamer class manages the pipeline lifecycle and frame delivery.
The NativeMethods.Backend property determines the platform and routes calls to WinNativeMethods, LinuxNativeMethods, or AndroidNativeMethods.
| Backend | Logic |
|---|---|
| Windows | PlatformID.Win32NT |
| Android | PlatformID.Unix and path starts with /data/user/ |
| Linux | PlatformID.Unix (Standard) |
Sources: ExtLibs/Utilities/GStreamer.cs40-63
The CameraProtocol.GStreamerPipeline function constructs pipeline strings based on the MAVLink.VIDEO_STREAM_TYPE.
| Stream Type | Logic / Element |
|---|---|
| RTSP | rtspsrc location={uri} latency=41 ... ! appsink name=outsink |
| RTPUDP | udpsrc port={port} ... encoding-name={H264/H265} ! appsink |
| TCP_MPEG | tcpclientsrc host={host} port={port} ! decodebin ! appsink |
| MPEG_TS | udpsrc port={port} ! tsparse ! tsdemux ! appsink |
Sources: ExtLibs/ArduPilot/Mavlink/CameraProtocol.cs37-93
Mission Planner implements the MAVLink Camera and Gimbal Manager protocols to provide integrated control within the video view.
This diagram illustrates how user input in GimbalVideoControl translates to MAVLink commands via GimbalManagerProtocol.
Sources: Controls/GimbalVideoControl.cs185-197 ExtLibs/ArduPilot/Mavlink/GimbalManagerProtocol.cs158-170
GimbalVideoControl: The main UI component that hosts the PictureBox (VideoBox) for the stream and handles user input via IMessageFilter. It manages GStreamer.OnNewImage to render frames. Controls/GimbalVideoControl.cs27-129CameraProtocol: Manages CAMERA_INFORMATION, CAMERA_SETTINGS, and VIDEO_STREAM_INFORMATION. It tracks capabilities such as HasZoom, HasFocus, and CanCaptureVideo. ExtLibs/ArduPilot/Mavlink/CameraProtocol.cs18-136GimbalManagerProtocol: Handles GIMBAL_MANAGER_INFORMATION and GIMBAL_DEVICE_ATTITUDE_STATUS. It provides methods like RetractAsync, NeutralAsync, and SetPitchYawAsync. ExtLibs/ArduPilot/Mavlink/GimbalManagerProtocol.cs8-170Mission Planner can automatically detect video streams through three primary mechanisms:
CameraProtocol maintains a ConcurrentDictionary of VideoStreams populated by VIDEO_STREAM_INFORMATION messages. ExtLibs/ArduPilot/Mavlink/CameraProtocol.cs35AutoConnect.cs contains a list of ConnectionInfo objects for common ports (5000, 5100, 5600, 5601) and specific hardware like HereLink and SkyViper. ExtLibs/Utilities/AutoConnect.cs23-53ZeroConf.cs probes for _rtsp._udp.local. services to identify RTSP hosts on the local network. ExtLibs/Utilities/ZeroConf.cs11-50The VideoStreamSelector UI allows users to choose from detected MAVLink streams or enter a raw GStreamer pipeline. The Video.cs form specifically utilizes ZeroConf.RtspHosts to populate a list of available RTSP streams. Controls/Video.cs23-64
Gimbal and video preferences are managed through GimbalControlSettings and configured via GimbalControlSettingsForm.
KeyBindingButton controls. Controls/GimbalControlSettingsForm.cs62-84GimbalControlSettingsForm applies the Mission Planner theme via ThemeManager.ApplyThemeTo(this). Controls/GimbalControlSettingsForm.cs26Sources: Controls/GimbalControlSettingsForm.cs29-160 Controls/GimbalVideoControl.cs168-197
If GStreamer is not found on the system:
GimbalVideoControl checks GStreamer.LookForGstreamer() and GStreamer.GstLaunchExists. Controls/GimbalVideoControl.cs131-135GStreamerUI.DownloadGStreamer(). Controls/GimbalVideoControl.cs147Sources: Controls/GimbalVideoControl.cs131-166 ExtLibs/Utilities/GStreamer.cs604-610
Refresh this wiki