Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. "Corrupt JPEG data" error while using camera
Forum Updated to NodeBB v4.3 + New Features

"Corrupt JPEG data" error while using camera

Scheduled Pinned Locked Moved Unsolved General and Desktop
videowidgetqcamerajpegbuffer
10 Posts 3 Posters 1.1k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MrHandSOme
    wrote on 7 May 2024, 13:34 last edited by MrHandSOme 5 Jul 2024, 13:38
    #1

    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.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 7 May 2024, 14:13 last edited by
      #2

      Hi,

      Did you check the exact format of the images generate by your camera ?
      There might be something off there.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      M 1 Reply Last reply 7 May 2024, 15:09
      0
      • S SGaist
        7 May 2024, 14:13

        Hi,

        Did you check the exact format of the images generate by your camera ?
        There might be something off there.

        M Offline
        M Offline
        MrHandSOme
        wrote on 7 May 2024, 15:09 last edited by
        #3

        @SGaist said in "Corrupt JPEG data" error while using camera:

        There might be something off there.

        How can i check that?

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 7 May 2024, 15:43 last edited by
          #4

          The camera documentation should be a good start.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • M Offline
            M Offline
            MrHandSOme
            wrote on 8 May 2024, 15:03 last edited by MrHandSOme 5 Aug 2024, 15:03
            #5

            I did not find anything about on internet but model is "Samsung C505e HD BUSINESS WEBCAM"

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 8 May 2024, 19:19 last edited by
              #6

              Isn't that a Logi webcam ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              M 1 Reply Last reply 9 May 2024, 08:06
              0
              • S SGaist
                8 May 2024, 19:19

                Isn't that a Logi webcam ?

                M Offline
                M Offline
                MrHandSOme
                wrote on 9 May 2024, 08:06 last edited by
                #7

                @SGaist I am so sorry. I confused. Yes, it is Logi webcam.

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 9 May 2024, 19:19 last edited by
                  #8

                  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.

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  2
                  • L Offline
                    L Offline
                    LL L
                    wrote on 5 Dec 2024, 02:19 last edited by
                    #9

                    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
                    
                    S 1 Reply Last reply 5 Dec 2024, 16:37
                    0
                    • L LL L
                      5 Dec 2024, 02:19

                      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
                      
                      S Offline
                      S Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on 5 Dec 2024, 16:37 last edited by
                      #10

                      @LL-L hi,

                      Are you using the default backend ?

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved