@@ -444,10 +444,14 @@ 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
+ * capped to the largest output strictly smaller than
+ * the sensor resolution (see validate()) and aligned
* to the ImgU output constraints.
*/
- size = sensorResolution.boundedTo(kViewfinderSize)
+ size = sensorResolution.shrunkBy({ 1, 1 })
+ .alignedDownTo(ImgUDevice::kOutputMarginWidth,
+ ImgUDevice::kOutputMarginHeight)
+ .boundedTo(kViewfinderSize)
.alignedDownTo(ImgUDevice::kOutputAlignWidth,
ImgUDevice::kOutputAlignHeight);
pixelFormat = formats::NV12;