"Corrupt JPEG data" error while using camera
-
Hello community,
I add a widget to my application that shows the camera view.
_mediaCaptureSession = new QMediaCaptureSession(); _currentCam = new QCamera(); _currentCam->setCameraDevice(QMediaDevices::defaultVideoInput()); _mediaCaptureSession->setCamera(_currentCam); _verticalLayout = new QVBoxLayout(_container); _videoWidget = new QVideoWidget(); _mediaCaptureSession->setVideoOutput(_videoWidget); _verticalLayout->addWidget(_videoWidget); _videoWidget->setAspectRatioMode(Qt::AspectRatioMode::KeepAspectRatio); _currentCam->start();
Camera works great but constantly giving error.
qt.gui.imageio.jpeg: Corrupt JPEG data: 2 extraneous bytes before marker 0xd5 qt.gui.imageio.jpeg: Corrupt JPEG data: 2 extraneous bytes before marker 0xd2 qt.gui.imageio.jpeg: Corrupt JPEG data: 5 extraneous bytes before marker 0xd0 qt.gui.imageio.jpeg: Corrupt JPEG data: 10 extraneous bytes before marker 0xd2 qt.gui.imageio.jpeg: Corrupt JPEG data: 2 extraneous bytes before marker 0xd3 qt.gui.imageio.jpeg: Corrupt JPEG data: 4 extraneous bytes before marker 0xd5 qt.gui.imageio.jpeg: Corrupt JPEG data: 2 extraneous bytes before marker 0xd0 qt.gui.imageio.jpeg: Corrupt JPEG data: 5 extraneous bytes before marker 0xd7 qt.gui.imageio.jpeg: Corrupt JPEG data: 3 extraneous bytes before marker 0xd1
How do I solve this error? Thanks!
I am using QT 6.6.0 on Ubuntu.
-
Hi,
Did you check the exact format of the images generate by your camera ?
There might be something off there. -
@SGaist said in "Corrupt JPEG data" error while using camera:
There might be something off there.
How can i check that?
-
The camera documentation should be a good start.
-
I did not find anything about on internet but model is "Samsung C505e HD BUSINESS WEBCAM"
-
Isn't that a Logi webcam ?
-
Two things I would do:
- Save an image using Qt on disk and analyze it
- Save an image with OpenCV on disk and analyze it
Check if there's something off in each image and also compare the two.
-
I don't know if you guys found the root cause; I have almost the same erros message while load dataurl in TextArea/QML using latest qt 6.8.1, yes, no such message in qt 6.8.0, same dataurl string (static compiled in c++ part.).
24-12-05 10:02:01.456 qt.gui.imageio.jpeg <Warni> qjpeghand: 61 > Corrupt JPEG data: 66 extraneous bytes before marker 0xdb 24-12-05 10:02:01.457 qt.gui.imageio.jpeg <Warni> qjpeghand: 61 > Quantization table 0x00 was not defined 24-12-05 10:02:01.457 qt.gui.imageio.jpeg <Warni> qjpeghand: 61 > Quantization table 0x00 was not defined 24-12-05 10:02:01.458 qt.gui.imageio.jpeg <Warni> qjpeghand: 61 > Corrupt JPEG data: 66 extraneous bytes before marker 0xdb 24-12-05 10:02:01.458 qt.gui.imageio.jpeg <Warni> qjpeghand: 61 > Quantization table 0x00 was not defined 24-12-05 10:02:01.458 qt.gui.imageio.jpeg <Warni> qjpeghand: 61 > Quantization table 0x00 was not defined 24-12-05 10:02:01.459 qt.gui.imageio.jpeg <Warni> qjpeghand: 61 > Corrupt JPEG data: 66 extraneous bytes before marker 0xdb 24-12-05 10:02:01.459 qt.gui.imageio.jpeg <Warni> qjpeghand: 61 > Quantization table 0x00 was not defined 24-12-05 10:02:01.460 qt.gui.imageio.jpeg <Warni> qjpeghand: 61 > Quantization table 0x00 was not defined 24-12-05 10:02:01.554 qt.gui.imageio.jpeg <Warni> qjpeghand: 61 > Corrupt JPEG data: 66 extraneous bytes before marker 0xdb 24-12-05 10:02:01.555 qt.gui.imageio.jpeg <Warni> qjpeghand: 61 > Quantization table 0x00 was not defined 24-12-05 10:02:01.555 qt.gui.imageio.jpeg <Warni> qjpeghand: 61 > Quantization table 0x00 was not defined