Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use correct aspectRation for gst video #12032

Merged
merged 1 commit into from
Oct 25, 2024

Conversation

gillamkid
Copy link
Contributor

Fixes #11896

Description

The wrong ratio was being used for GST video (if the video stream aspect ratio did not match the operator provided aspect ratio). This made so thinngs like grid lines weren't properly placed and also made track point setting inaccurate.

Sponsor

This contribution was sponsored by Firestorm
654d4f9476ff2a38f37e9ab9_firestorm-homepage-share-img-2

Before

Note how the grid lines are not accurately placed and the video does not fill the width of the screen even though it is in "Fit Width" mode.
bad-ratio
I generated the sample image using the following command

gst-launch-1.0 videotestsrc ! openh264enc ! rtph264pay config-interval=10 pt=96 ! udpsink host=127.0.0.1 port=5600

My QGC settings were "Fit Width" in video settings and I made video streaming enabled for h264 port 5600

After

Note how the grid lines are accurately placed and the video does fill the width of the screen as expected when in "Fit Width" mode.
good-ratio

@HTRamsey
Copy link
Collaborator

HTRamsey commented Oct 24, 2024

Nice, I don't know if you're interested in helping look into it, but that entire file actually needs to be reworked, and really most of the video QML stuff. The loader actually doesn't work as expected (videoDisabled isn't even used, and should control the enabled property), and the thermal video should be in a loader. Also, ideally this would be combined with the UVC file somehow and just have the video source or video background changed

@gillamkid
Copy link
Contributor Author

I can't commit to reworking the entire file. I did have the same idea about combining with the UVC file, so it's nice to know that is a welcomed change if I ever decide to take a stab at it.

For now I mostly just make fixes that cause pains when flying the vehicle my company is developing. The messed up GST aspect ratio was giving us grief when setting tracks.

@HTRamsey HTRamsey merged commit 34cdb6b into mavlink:master Oct 25, 2024
7 checks passed
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.

aspectRatioChanged signal does not get emitted when the aspect ratio changes
2 participants