From 61f6b6d773fe18cb39554bae0b0f4d619bfb20a3 Mon Sep 17 00:00:00 2001 From: Maksim Shabunin Date: Wed, 21 Aug 2024 18:57:50 +0300 Subject: [PATCH] videoio: fix V4L backend with NV12 input format --- modules/videoio/src/cap_v4l.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/videoio/src/cap_v4l.cpp b/modules/videoio/src/cap_v4l.cpp index 531af03d1a..9baa9983de 100644 --- a/modules/videoio/src/cap_v4l.cpp +++ b/modules/videoio/src/cap_v4l.cpp @@ -1538,11 +1538,11 @@ void CvCaptureCAM_V4L::convertToRgb(const Buffer ¤tBuffer) return; case V4L2_PIX_FMT_NV12: cv::cvtColor(cv::Mat(imageSize.height * 3 / 2, imageSize.width, CV_8U, start), destination, - COLOR_YUV2RGB_NV12); + COLOR_YUV2BGR_NV12); return; case V4L2_PIX_FMT_NV21: cv::cvtColor(cv::Mat(imageSize.height * 3 / 2, imageSize.width, CV_8U, start), destination, - COLOR_YUV2RGB_NV21); + COLOR_YUV2BGR_NV21); return; #ifdef HAVE_JPEG case V4L2_PIX_FMT_MJPEG: