Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8015

Graphics, sound and multimedia • Re: Cropped Video Output (Arducam Quad-Cam 5120x800) picamera2

$
0
0
Hi,
We've reviewed the details you provided, including your code and the troubleshooting steps you've already taken. It appears you've done a thorough job in investigating this issue.

We want to confirm that the cropping you are observing in your video recordings is indeed likely due to a limitation of the Raspberry Pi 4B's hardware video encoder. The Raspberry Pi 4B's hardware video encoders (both H264 and MJPEG) are primarily designed to support a maximum encoding resolution of 1920x1080 (1080p).

Why does this cause cropping at 5120x800?


When you attempt to encode video at a resolution higher than 1920x1080, such as your desired 5120x800, the Raspberry Pi's hardware encoder may not be able to handle the full resolution directly. Instead of failing completely, it appears to be automatically cropping the input video stream to fit within its 1920x1080 encoding capability. This results in the cropped video output you are seeing.

Possible Solutions and Workarounds:

To address this, you have a few options to consider:

1. Reduce Video Resolution for Hardware Encoding: The simplest solution is to record video at a resolution that is within the Raspberry Pi's hardware encoder's capabilities. We recommend trying resolutions at or below 1920x1080. You can easily adjust the resolution variable in your picamera2 Python code to test this. While this means you won't be using the full 5120x800 resolution for video, it will allow you to utilize hardware-accelerated encoding and should eliminate the cropping issue.

2. Software Encoding (CPU-Based): If recording at 5120x800 video resolution is essential for your application, you can explore using software-based video encoding. picamera2 does offer the option to use the "null" encoder or software encoding alternatives. However, please be aware that software encoding is significantly more CPU-intensive on the Raspberry Pi 4B. This may lead to:

a. Reduced Frame Rates: You may experience a noticeable drop in achievable frame rates at 5120x800 resolution when using software encoding.
b. Higher CPU Load: The Raspberry Pi's CPU will be heavily utilized, potentially impacting other processes running on the device.
You can experiment with different software encoding settings within picamera2 to find a balance between video quality and performance.
3. Raw Video Stream Capture (No Encoding): If your application primarily needs to capture the raw video data for offline processing or analysis, you can consider capturing the raw video stream directly from the camera sensor without any real-time encoding. This will bypass the hardware encoder limitations and give you access to the full 5120x800 data. However, please note that raw video streams will generate very large files and require substantial storage and post-processing capabilities.

Statistics: Posted by Arducam_Support — Wed Feb 12, 2025 3:08 am



Viewing all articles
Browse latest Browse all 8015

Trending Articles