If I run the code preview_drm.py (down loaded from the ‘Picamera2Library’ examples, see below), the preview is displayed in 16:9 format but is significantly cropped to the size of the black rectangle in the attached image.
I have tried a variety of variations to the parameters in the preview definitions but cannot get the preview from the Python program to display the full image.
Could someone suggest what variations to the Python code are required to present the full image in preview?
Thanks, Fred
preview_drm.py
#!/usr/bin/python3
For use from the login console, when not running X Windows.
This failed to execute, referencing the above line of code with the final message
Value Error: drmModeAddFB2 failed: Invalid argument
I halved the width and height values to 2304 and 1296 and tried again, but with the same result.
I again halved the width and height values to 1152 and 648 and tried again. This executed successfully, but the preview was cropped as per my original post.
Do you have any further suggestions? I have been able to capture still images in RAW format at a resolution of 4608 x 2592, so it would seem logical that there must be someway to have an uncropped preview of the same image.
As explained in the response from JetForMe Sat Apr 13, 2024 9:49 pm the correct ‘mode’ has to be set to get an uncropped preview. By running their suggested code where mode is set to 2 I get an uncropped preview.
Regards,