Skip to content

[WIP] Two video streams - #13686

Closed
d0vgan wants to merge 2 commits into
mavlink:masterfrom
d0vgan:two_video_streams
Closed

[WIP] Two video streams#13686
d0vgan wants to merge 2 commits into
mavlink:masterfrom
d0vgan:two_video_streams

Conversation

@d0vgan

@d0vgan d0vgan commented Dec 1, 2025

Copy link
Copy Markdown

[WIP] Two video streams

Description

You can treat this as a lite alternative to the #8017 .
To be honest, I don't really know QML, and this is just a small attempt to add the support of 2 video streams to QGC.
Here is what it does:

  • it assumes there are 2 cameras, and each of these cameras has an HQ and a LQ videostream;
  • an "Enable auxiliary video streams" checkbox has been added to QGC's Video Settings;
  • once the "Enable auxiliary video streams" checkbox, you can specify the Cam 1 HQ, Cam 2 LQ, Cam 2 HQ and Cam 1 LQ streams there.

This is work-in-progress and demonstrates the current state. Any hints and contributions are welcome.

Test Steps

  1. Start mediamtx: ./mediamtx
  2. Start video stream 1: ffmpeg -re -stream_loop -1 -i anim1.mp4 -c copy -f rtsp rtsp://127.0.0.1:8554/stream1
  3. Start video stream 2: ffmpeg -re -stream_loop -1 -i anim2.mp4 -c copy -f rtsp rtsp://127.0.0.1:8554/stream2
  4. Start QGC and specify the given streams in the Video Settings
  5. In QGC's window, right-click the small video and select "Switch to auxiliary video stream"

And here is the problem: currently, the switching between the video streams is very "heavy". This is how the video receivers seem to work. Maybe this can be improved by updating the GStreamer-related code, but I don't have such expertise.

Related Issue

#8017

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@HTRamsey
HTRamsey marked this pull request as draft December 21, 2025 05:18
@DronecodeBot

Copy link
Copy Markdown

This pull request has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there:

https://discuss.px4.io/t/qgc-to-support-multiple-cameras-videostreams/47878/6

@DonLakeFlyer

Copy link
Copy Markdown
Contributor

Is this to provide display of two video streams simultaneously or is it for switching between two streams. If it's for switching between streams QGC support for mavlink v2 camera protocol already support that. Not super interested in creating some other way to do this.

@d0vgan

d0vgan commented Mar 5, 2026

Copy link
Copy Markdown
Author

Could you provide more details on "QGC support for mavlink v2 camera protocol" ?
Our reasoning to do the changes in the code were the following:

  1. A drone has 2 cameras
  2. Each of the 2 cameras provides 2 streams: HQ stream and LQ stream
  3. We need to see a HQ stream from 1st camera and a LQ stream from 2nd camera simultaneously and to be able to switch between them (i.e. when clicking a small view with the 2nd camera LQ stream, we are replacing it with a bigger view with the 2nd camera HQ stream, while the previously shown 1st camera HQ stream is replaced with the small view with the 1st camera LQ stream).

Let me iilustrate this by an image:
2cams2streams

@DonLakeFlyer

Copy link
Copy Markdown
Contributor

Mavlink Camera protocol: https://mavlink.io/en/services/camera.html

That said, even with that qgc does not have support to show two video streams at once. Adding support for that on top of the existing Mavlink camera protocol is interesting. But adding support for the whole thing as a one-off from the new camera protocol is not interesting for regular QGC codebase.

@DonLakeFlyer

Copy link
Copy Markdown
Contributor

Closing this since it isn't something we are going to support unless it uses mavlink camera protocol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants