feat: Add video scaling via --video-scale CLI arg and gsmenu slider#103
feat: Add video scaling via --video-scale CLI arg and gsmenu slider#103henkwiedig merged 4 commits intoOpenIPC:masterfrom
Conversation
|
Fixes: #74 I like it, one thought: Why limiting to max 1 ? Maybe someone wants to zoom in because of frame in the image. |
Thanks Henk! hmm, honestly, I haven't thought about that, but it's resonable. I have doubts that the current implementation might cause unexpected behavior when scaling up; an experiment is needed. I'll try increasing the allowable coefficient and get back to you with the results. If everything goes well, it would probably make sense to change this coefficient from 0.5 to 1.5, with a default value of 1. |
Unfortunately, the experiment was unsuccessful. I increased the possibility to set the coefficient to 1.5 and got an error. If I interpreted it correctly, the DRM rejected the attempt to set the CRTC_W and CRTC_H to a size exceeding the physical capabilities of the display or the plane. This seems to be a limitation at the GPU level, and it might already be necessary to use the RGA, as in your feature with screen rotation. |
src/main.cpp
Outdated
| uint32_t video_plane_id_override = 0; | ||
| uint32_t osd_plane_id_override = 0; | ||
|
|
||
| float video_scale_factor = 1.0; |
There was a problem hiding this comment.
looks like this variable is only used to pass as an argument to modeset_prepare. Can you please define it as a local variable in the main() function?
There was a problem hiding this comment.
tnx! Moved to main().
This PR adds the ability to scale the video output size via a new
--video-scalepixelpilot command-line argument.It also integrates this setting into the gsmenu system, allowing users to adjust the scale via a slider in the 'system' menu.
--video-scale <factor>CLI option topixelpilot.drm.cto use the scale factor when settingCRTC_WandCRTC_H.get/sethandlers ingsmenu.sh.gs_system.cto control the value via the menu./config/setup.txt.This feature is particularly beneficial for users of binocular FPV goggles, where the native video resolution may exceed the effective display area of the lenses. By reducing the output size, users can avoid image distortion, cropping, or edge stretching — enabling a more natural, immersive, and fully visible visual experience across a wider range of headset models and lens configurations.
The slider range is 0.5 to 1.0


discuss in telegram https://t.me/c/1809358416/138076/268251
my setup.txt
tested on pnp 2.0.0 debian 11 image