Hi. I have camera which is 640x480, but perhaps has non-square pixels, and thus gives 16:9 picture. Apps like USB camera, Cheese etc. show all correctly. As for QGC it shows 4:3 picture and completely ignores aspect ratio setting. Can anyone help?
Thank you
Hi Alexander,
Welcome to the QGroundControl community!
Your observation is interesting because 640×480 describes the pixel dimensions, but not necessarily the intended display aspect ratio if the camera uses non-square pixels.
I checked the current QGroundControl source and found a possible explanation in the USB camera handling.
In UVCReceiver::adjustAspectRatio(), QGC calculates the aspect ratio directly from the camera format resolution:
const qreal aspectRatio =
static_cast<qreal>(resolution.width()) / resolution.height();
For 640×480, this produces 4:3, even if the intended display aspect ratio is 16:9.
The Fly View QML also appears to prioritize the USB camera item’s dimensions over the configured video aspect ratio, which could explain why changing that setting has no visible effect.
Could you confirm:
-
Which QGroundControl version and operating system are you using?
-
Is the camera connected directly as a USB/UVC device, or through an RTSP/UDP video stream?
-
Does the camera report 640×480 in QGC and the other applications?
If this is a USB/UVC camera with non-square pixels, I think the appropriate fix would be to support an explicit display-aspect-ratio override without affecting normal square-pixel cameras.
This looks worth investigating as a QGC video display issue.
Best regards,
Yiğitcan Öztürk
PAMILANGA LIMITED
Hi Yigitcan, thanks for the prompt reply and consideration. 1. I use QGC 5.1.5 and tried it with Ubuntu 24.04 and Android 16 and 12. All the same. 2. through RTSP. I did not find direct UVC connection option though QGC is among apps which float up when connecting camera. 3. yes, camera reports exact 640x480 in other apps (not sure if checked in QGC). “I think the appropriate fix would be to support an explicit display-aspect-ratio override without affecting normal square-pixel cameras.” - that sounds good if someone could do that. Looks fair if aspect ratio setting overrides everything.
Hi Alexander,
Thanks for confirming the details. That helps narrow this down significantly.
Since you’re using RTSP rather than a direct USB/UVC connection, my earlier observation about UVCReceiver::adjustAspectRatio() is unlikely to explain your specific issue.
I took another look at QGroundControl’s video handling.
In the current source, VideoManager::aspectRatio() prioritizes the decoded video dimensions when they are available:
if (!_videoSize.isEmpty()) {
return static_cast<double>(_videoSize.width())
/ _videoSize.height();
}
This means a decoded 640×480 stream produces a 4:3 aspect ratio, even when the intended display aspect ratio is 16:9.
That behavior appears consistent with your observations, although we should verify the exact implementation in QGC 5.1.5.
I agree with your suggestion that an explicit user-configured display aspect ratio should take precedence over the automatically calculated ratio.
Ideally, QGC should support:
-
Automatic aspect ratio detection by default.
-
An explicit display aspect ratio override.
-
Correct handling of streams with non-square pixels.
-
Consistent behavior across Linux and Android.
One additional check would be useful: could you confirm whether setting the video aspect ratio to 1.777778 in QGC 5.1.5 has absolutely no effect, including after restarting the video stream?
If so, I think we have a good basis for a focused GitHub issue and potentially a small upstream fix.
Best regards,
Yiğitcan Öztürk
PAMILANGA LIMITED
Hi Yigitcan, yes, absolutely, I put there not only 1.777 (aspect ratio) but also 1 or 3 - no reaction. It ignores the field. I tried also another camera 640x480 with square pixels and could not change aspect ratio in QGC either, which any normal app does. What I have not done, I did not change RTX and its way of connection to QGC. Just no other choice. Btw, you may do this experiment yourself if interested. Do you know how to submit this issue to developers? Best regards
P.S. Not to be wrongly understood. On Android I use USB Camera app which produces RTSP stream and, sure, I put there 16:9 which this app itself reproduces ok.
Hi Alexander,
Thank you for running these additional tests.
Your results provide strong evidence of a reproducible issue in QGroundControl 5.1.5.
The fact that changing the aspect ratio to 1, 1.777, or 3 produces no visible effect, even with different cameras, suggests that the configured display aspect ratio is not being applied to the RTSP video output.
You can report this directly to the QGroundControl developers through the project’s GitHub issue tracker.
I would suggest the following issue title:
QGC 5.1.5: RTSP video ignores configured display aspect ratio
The report should include your Ubuntu and Android versions, the RTSP configuration, the 640×480 source resolution, and the results of your aspect ratio tests.
I would also recommend investigating whether VideoManager::aspectRatio() prioritizes decoded video dimensions over the user-configured value in version 5.1.5.
I can help investigate the relevant source code and prepare a targeted fix for upstream review.
Thanks again for taking the time to verify this across multiple platforms.
Best regards,
Yiğitcan Öztürk
PAMILANGA LIMITED
since it is rtsp, try square pixels at the encoder instead. 854x480 out instead of anamorphic 640x480, QGC has nothing extra to honour there.
I tried that before. On Ubuntu gst refuses to take that. And USB Camera app on Android does not have manual input of resolution option.
Hi Alexander,
Thanks for opening the issue and documenting the behavior across Ubuntu and Android.
I also checked the QGroundControl source code and found a relevant detail in VideoStreamController::aspectRatio().
The current implementation prioritizes the decoded video dimensions over the user-configured aspect ratio. The manual setting is used only as a fallback when neither decoded video dimensions nor stream information is available.
This would explain why changing the configured aspect ratio has no visible effect for an active 640×480 RTSP stream.
I haven’t yet verified the exact implementation in the v5.1.5 release, but this gives us a concrete code path to investigate.
The next step would be a targeted regression test and a fix that preserves the automatic aspect ratio behavior while allowing an explicitly configured override.
Thanks again for providing the reproducible report.
Best regards,
Yiğitcan Öztürk
PAMILANGA LIMITED