Skip to content

Commit 61f6b6d

Browse files
committed
videoio: fix V4L backend with NV12 input format
1 parent 766bad0 commit 61f6b6d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/videoio/src/cap_v4l.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1538,11 +1538,11 @@ void CvCaptureCAM_V4L::convertToRgb(const Buffer &currentBuffer)
15381538
return;
15391539
case V4L2_PIX_FMT_NV12:
15401540
cv::cvtColor(cv::Mat(imageSize.height * 3 / 2, imageSize.width, CV_8U, start), destination,
1541-
COLOR_YUV2RGB_NV12);
1541+
COLOR_YUV2BGR_NV12);
15421542
return;
15431543
case V4L2_PIX_FMT_NV21:
15441544
cv::cvtColor(cv::Mat(imageSize.height * 3 / 2, imageSize.width, CV_8U, start), destination,
1545-
COLOR_YUV2RGB_NV21);
1545+
COLOR_YUV2BGR_NV21);
15461546
return;
15471547
#ifdef HAVE_JPEG
15481548
case V4L2_PIX_FMT_MJPEG:

0 commit comments

Comments
 (0)