MJPEGWriter icon indicating copy to clipboard operation
MJPEGWriter copied to clipboard

Screen Tearing Problem

Open AdiLakshmy opened this issue 3 years ago • 1 comments

First I converted my output QImage to Mat and then I write that converted Mat in MJPEGWriter. I observed screen tearing problem. How can I solve this problem?

AdiLakshmy avatar Aug 19 '20 13:08 AdiLakshmy

This is the below code I used for Qimage to Mat conversion Mat QImageToMat(QImage image) { cv::Mat mat; switch (image.format()) { case QImage::Format_ARGB32: case QImage::Format_RGB32: case QImage::Format_ARGB32_Premultiplied: mat = cv::Mat(image.height(), image.width(), CV_8UC4, (void*)image.constBits(), image.bytesPerLine()); break; case QImage::Format_RGB888: mat = cv::Mat(image.height(), image.width(), CV_8UC3, (void*)image.constBits(), image.bytesPerLine()); cv::cvtColor(mat, mat, CV_BGR2RGB); break; case QImage::Format_Grayscale8: mat = cv::Mat(image.height(), image.width(), CV_8UC1, (void*)image.constBits(), image.bytesPerLine()); break; } return mat; }

AdiLakshmy avatar Aug 19 '20 13:08 AdiLakshmy