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

Update video fit options #12037

Merged
merged 1 commit into from
Nov 6, 2024
Merged

Conversation

gillamkid
Copy link
Contributor

Description

The pre-existing video fit option "Stretch" would not fill the screen as expected. The grid lines were also not
accurately placed over the video.

"Stretch" is also not a great word to use because it hints the video may be transformed in a way were
its aspectRatio is different from the original, which is not the case.

This PR renames "Stretch" to "Fit" and fixes it so the video fills the screen when in that mode. A new mode was also added called "No Crop" which makes so the entire video is shown (no part of video goes past the bounds of the border of the screen, as would be the case in the other 3 video fit modes if the video width/height aspect ratio does not match the QGC app window width/height aspect ratio

Issue Before

Steps to reproduce

  1. Run a vehicle
cd PX4-Autopilot
make px4_sitl gazebo-classic_plane
  1. Run a GST video stream
gst-launch-1.0 videotestsrc ! openh264enc ! rtph264pay config-interval=10 pt=96 ! udpsink host=127.0.0.1 port=5600
  1. Run QGC. Select on the gear icon close the the red record button to open video settings and put the video in "Stretch" mode
    fit-select-stetch
  2. Notice how the grid lines are not properly placed over the video and that the video does not fill the screen as one might expect from the name "Stretch"
    fit-before-stretch

Update with this PR

follow the same steps in the "Steps to Reproduce" section, only select "Fit" (which is the new replacemnt for "Stretch")

As expected, the video now fills the screen and has the grid lines properly placed
fit-after-stretch

Also notice the new mode "No Crop"
fit-select-no-crop

"No Crop" makes so the entire video is shown (no part of video goes past the bounds of the border of the screen, as would be the case in the other 3 video fit modes if the video width/height aspect ratio does not match the QGC app window width/height aspect ratio

ex. "No Crop" when QGC window is very wide
fit-no-crop-wide-qgc

ex. "No Crop" when QGC window is very tall
fint-no-crop-tall-qgc

Sponsor

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

The pre-existing "Stretch" option would not fill the
screen as expected. The grid lines were also not
accurately placed over the video for the "Stretch"
option.

"Stretch" is also not a great word to use because it
hints the video may be transformed in a way were
its aspectRatio is different from the original, which
is not the case.

This commit renames "Stretch" to "Fit" and fixes it
so the video fills the screen when in that mode. A
new mode was also added called "No Crop" which
makes so the entire video is shown (no part of video
goes past the bounds of the border of the screen, as
would be the case in the other 3 video fit modes if
the video width/height aspect ratio does not match
the QGC app window width/height aspect ratio
@dagar dagar merged commit c584bdf into mavlink:master Nov 6, 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.

2 participants