Add WHEP video stream support#14591
Conversation
There was a problem hiding this comment.
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 (behindQGC_GST_WHEP). - Extends video settings/UI and
VideoManagerrouting 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. |
| 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
left a comment
There was a problem hiding this comment.
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
Codecov Report❌ Patch coverage is ❌ 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@@ 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
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 432 files with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
Build ResultsPlatform Status
All builds passed. Pre-commit
Pre-commit hooks: 0 passed, 0 failed, 0 skipped. Test Resultslinux-coverage-integration: 25 passed, 0 skipped Code Coverage
Artifact Sizes
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/
18ec372 to
84388b5
Compare
Description
Introduce WHEP (WebRTC-HTTP Egress Protocol) support, based on the WHEP draft, by wiring QGC video streaming to GStreamer’s
rswebrtcWHEP 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
rswebrtcplugin is found and GStreamer is not statically linked. In practice, this means it's not available for Linux daily builds (there is norswebrtcpackage 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
Testing
Platforms Tested
Flight Stacks Tested
Screenshots
Checklist
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).