@@ -444,12 +444,16 @@ PipelineHandlerIPU3::generateConfiguration(Camera *camera, std::span<const Strea
case StreamRole::VideoRecording: {
/*
* Default viewfinder and videorecording to 1280x720,
- * capped to the maximum sensor resolution and aligned
- * to the ImgU output constraints.
+ * capped to the sensor resolution minus the ImgU output
+ * margins that validate() applies, and aligned to the
+ * ImgU output constraints.
*/
- size = sensorResolution.boundedTo(kViewfinderSize)
- .alignedDownTo(ImgUDevice::kOutputAlignWidth,
- ImgUDevice::kOutputAlignHeight);
+ size = sensorResolution.shrunkBy({ 1, 1 })
+ .alignedDownTo(ImgUDevice::kOutputMarginWidth,
+ ImgUDevice::kOutputMarginHeight)
+ .boundedTo(kViewfinderSize)
+ .alignedDownTo(ImgUDevice::kOutputAlignWidth,
+ ImgUDevice::kOutputAlignHeight);
pixelFormat = formats::NV12;
bufferCount = IPU3CameraConfiguration::kBufferCount;
streamFormats[pixelFormat] = { { ImgUDevice::kOutputMinSize, size } };
For the Viewfinder and VideoRecording roles, generateConfiguration() caps the default size and the advertised maximum size to the sensor resolution and to 1280x720. validate() is stricter: it makes the output strictly smaller than the CIO2 output and aligns it down to 64 pixels horizontally and 32 lines vertically. For sensors whose resolution is close to 1280x720 the two disagree. The OmniVision OV9734 has a resolution of 1296x734, so generateConfiguration() offers 1280x720 and validate() adjusts it to 1280x704. Applications that use the advertised sizes then pick a size the pipeline cannot produce. With PipeWire 1.6.2, the libcamera SPA plugin offers 1280x720 to clients, GNOME Snapshot selects it, and the frames it displays have a green band at the bottom. Apply the same margins as validate(), and as the StillCapture role already does, before capping to 1280x720. Sensors with a resolution of at least 1281x737 keep the 1280x720 default. The change and this description were drafted with an AI coding assistant (Claude Code, model Claude Opus 5.5). The author reviewed them and tested them on a Microsoft Surface Laptop 1. Signed-off-by: Afonso Figuinha <afonso.figuinha@gmail.com> --- src/libcamera/pipeline/ipu3/ipu3.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)