Skip to content

Add WHEP video stream support#14591

Open
ikalnytskyi wants to merge 1 commit into
mavlink:masterfrom
ikalnytskyi:feat/whep-video-stream
Open

Add WHEP video stream support#14591
ikalnytskyi wants to merge 1 commit into
mavlink:masterfrom
ikalnytskyi:feat/whep-video-stream

Conversation

@ikalnytskyi

Copy link
Copy Markdown
Contributor

Description

Introduce WHEP (WebRTC-HTTP Egress Protocol) support, based on the WHEP draft, by wiring QGC video streaming to GStreamer’s rswebrtc WHEP client (whepclientsrc).

WHEP is generally more resilient than RTSP on weak or unstable networks because it leverages WebRTC’s real-time adaptation mechanisms, including congestion control, to maintain smoother playback and lower latency under poor link conditions.

Note

This feature is ON as long as the GStreamer rswebrtc plugin is found and GStreamer is not statically linked. In practice, this means it's not available for Linux daily builds (there is no rswebrtc package for Ubuntu), nor for Android/iOS, which use static linking.

There is a yet-unsolved challenge in packaging 2+ GStreamer Rust plugins, and QGC already packages dav1d. See this Centricular devlog post and this related post by Amy Spark for more details on the Rust plugin linking issue.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring (no functional changes)
  • CI/Build changes
  • Other

Testing

  • Tested locally
  • Added/updated unit tests
  • Tested with simulator (SITL)
  • Tested with hardware

Platforms Tested

  • Linux
  • Windows
  • macOS
  • Android
  • iOS

Flight Stacks Tested

  • PX4
  • ArduPilot

Screenshots

Checklist

  • I have read the Contribution Guidelines
  • I have read the Code of Conduct
  • My code follows the project's coding standards
  • I have added tests that prove my fix/feature works
  • New and existing unit tests pass locally

Related Issues


By submitting this pull request, I confirm that my contribution is made under the terms of the project's dual license (Apache 2.0 and GPL v3).

Copilot AI review requested due to automatic review settings July 6, 2026 23:44
@ikalnytskyi
ikalnytskyi requested a review from HTRamsey as a code owner July 6, 2026 23:44
@github-actions github-actions Bot added github_actions Pull requests that update GitHub Actions code CMake Video size/S labels Jul 6, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds WHEP (WebRTC-HTTP Egress Protocol) as a new video-stream input option for QGroundControl’s GStreamer video pipeline, enabling more resilient streaming over unstable links by leveraging WebRTC transport/adaptation.

Changes:

  • Adds a new whepclientsrc-based GStreamer source path and URI validation for HTTP(S) WHEP endpoints (behind QGC_GST_WHEP).
  • Extends video settings/UI and VideoManager routing to support selecting and configuring a WHEP URL.
  • Updates GStreamer build orchestration/CI plugin lists to include rswebrtc and required WebRTC-related plugins when available.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/VideoManager/VideoReceiver/GStreamer/GstSourceFactory.h Documents HTTP(S) WHEP as a supported source scheme.
src/VideoManager/VideoReceiver/GStreamer/GstSourceFactory.cc Implements whepclientsrc construction and integrates it into source creation + jitter-buffer policy.
src/VideoManager/VideoReceiver/GStreamer/GStreamerHelpers.h Adds WHEP URI validation helper declaration.
src/VideoManager/VideoReceiver/GStreamer/GStreamerHelpers.cc Implements isValidWhepUri validation logic for HTTP(S) URIs.
src/VideoManager/VideoManager.cc Wires WHEP settings changes and routes WHEP URLs to receivers (plus auto-stream support when enabled).
src/Settings/VideoSettings.h Adds whepUrl Fact and exposes a WHEP source label to QML.
src/Settings/VideoSettings.cc Adds WHEP to selectable sources when enabled; adds whepUrl Fact and config checks.
src/Settings/Video.SettingsGroup.json Adds metadata for the new WHEP URL setting and updates source descriptions.
src/AppSettings/pages/Video.SettingsUI.json Adds a WHEP URL control shown when WHEP source is selected.
cmake/GStreamer/Orchestrator.cmake Defines QGC_GST_WHEP when rswebrtc is available in non-static builds; prunes WebRTC plugins otherwise.
.github/build-config.json Adds rswebrtc + related WebRTC plugins to the bundled plugin set.

Comment thread src/VideoManager/VideoReceiver/GStreamer/GstSourceFactory.cc Outdated
Comment on lines +316 to +321
GstElement* buildWhepSource(const QString& uri, const QUrl& sourceUrl, const Config& config)
{
const QByteArray whepEndpoint = uri.toUtf8();
if (!GStreamer::isValidWhepUri(whepEndpoint.constData())) {
qCCritical(GstSourceFactoryLog) << "Invalid WHEP URI:" << sourceUrl.toDisplayString(QUrl::RemoveUserInfo);
return nullptr;

@ikalnytskyi ikalnytskyi left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In order to test WHEP, the easiest way is to use MediaMTX. One can use as simple a configuration as the following:

webrtcAddress: :8889
webrtcLocalUDPAddress: :8189
paths:
  all_others:
    source: publisher

  video1:
    source: <RTSP_URI>   # better use H264, MediaMTX may not support other codecs
    sourceProtocol: udp

  video2:
    runOnInit:
      ffmpeg -re -stream_loop -1 -i <PATH_TO_VIDEOFILE>
        -an
        -c:v libx264 -preset veryfast -tune zerolatency
        -pix_fmt yuv420p -profile:v high -level 4.1
        -g 30 -keyint_min 30 -sc_threshold 0
        -f rtsp -rtsp_transport tcp rtsp://127.0.0.1:8554/video2
    runOnInitRestart: yes

Comment thread cmake/GStreamer/Orchestrator.cmake Outdated
@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 21.87500% with 25 lines in your changes missing coverage. Please review.
✅ Project coverage is 30.67%. Comparing base (f29efd3) to head (84388b5).
⚠️ Report is 127 commits behind head on master.

Files with missing lines Patch % Lines
...anager/VideoReceiver/GStreamer/GStreamerHelpers.cc 0.00% 14 Missing ⚠️
src/Settings/VideoSettings.cc 37.50% 3 Missing and 2 partials ⚠️
src/VideoManager/VideoManager.cc 0.00% 4 Missing ⚠️
...anager/VideoReceiver/GStreamer/GstSourceFactory.cc 60.00% 0 Missing and 2 partials ⚠️

❌ Your patch check has failed because the patch coverage (21.87%) is below the target coverage (30.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #14591      +/-   ##
==========================================
+ Coverage   25.47%   30.67%   +5.20%     
==========================================
  Files         769      785      +16     
  Lines       65912    66814     +902     
  Branches    30495    30958     +463     
==========================================
+ Hits        16788    20494    +3706     
+ Misses      37285    32368    -4917     
- Partials    11839    13952    +2113     
Flag Coverage Δ
unittests 30.67% <21.87%> (+5.20%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/Settings/VideoSettings.h 100.00% <100.00%> (+85.71%) ⬆️
...anager/VideoReceiver/GStreamer/GstSourceFactory.cc 31.47% <60.00%> (ø)
src/VideoManager/VideoManager.cc 7.99% <0.00%> (+6.09%) ⬆️
src/Settings/VideoSettings.cc 31.01% <37.50%> (+15.22%) ⬆️
...anager/VideoReceiver/GStreamer/GStreamerHelpers.cc 36.05% <0.00%> (-0.64%) ⬇️

... and 432 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0983301...84388b5. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Build Results

Platform Status

Platform Status Details
Linux Passed View
Windows Passed View
MacOS Passed View
Android Passed View

All builds passed.

Pre-commit

Check Status Details
pre-commit Failed (non-blocking) View

Pre-commit hooks: 0 passed, 0 failed, 0 skipped.

Test Results

linux-coverage-integration: 25 passed, 0 skipped
linux-coverage-unit: 103 passed, 0 skipped
Total: 128 passed, 0 skipped

Code Coverage

Coverage Baseline Change
66.3% 66.3% +0.0%

Artifact Sizes

Artifact Size Δ from master
QGroundControl 236.38 MB +10.12 MB (increase)
QGroundControl-aarch64 181.40 MB +1.98 MB (increase)
QGroundControl-installer-AMD64 142.32 MB +3.95 MB (increase)
QGroundControl-installer-AMD64-ARM64 80.44 MB -0.21 MB (decrease)
QGroundControl-installer-ARM64 109.31 MB +0.11 MB (increase)
QGroundControl-linux 87.09 MB -78.79 MB (decrease)
QGroundControl-mac 87.09 MB No change
QGroundControl-windows 86.14 MB No change
QGroundControl-x86_64 193.64 MB +1.99 MB (increase)
Total size decreased by 60.86 MB

Updated: 2026-07-07 01:37:29 UTC • Commit: 84388b5 • Triggered by: Android

Introduce WHEP (WebRTC-HTTP Egress Protocol) support, based on the WHEP
draft[^1], by wiring QGC video streaming to GStreamer’s `rswebrtc` WHEP
client (`whepclientsrc`)[^2].

WHEP is generally more resilient than RTSP on weak or unstable networks
because it leverages WebRTC’s real-time adaptation mechanisms, including
congestion control, to maintain smoother playback and lower latency
under poor link conditions.

[^1]: https://datatracker.ietf.org/doc/draft-ietf-wish-whep/
[^2]: https://gstreamer.freedesktop.org/documentation/rswebrtc/
@ikalnytskyi
ikalnytskyi force-pushed the feat/whep-video-stream branch from 18ec372 to 84388b5 Compare July 7, 2026 00:43
@github-actions github-actions Bot added the Tests label Jul 7, 2026
@DonLakeFlyer DonLakeFlyer added this to the Release V5.2 milestone Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CMake github_actions Pull requests that update GitHub Actions code size/S Tests Video

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants