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. Question about QCameraImageCapture

Question about QCameraImageCapture

Scheduled Pinned Locked Moved General and Desktop
15 Posts 2 Posters 4.6k Views 1 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.
  • P Offline
    P Offline
    peterlin82
    wrote on last edited by
    #1

    When I cameraImageCapture1->capture(); about two thousand times.
    Program crashes every time.
    I don't know how to solve.
    Any help would be appreciated!
    Sorry for my english.

    Information:
    Qt 5.3.1
    Ubuntu 12.04.4
    Logitech C170 webcam
    RAM:1G
    HDD:1T

    @Dialog::Dialog(QWidget *parent) : QDialog(parent),ui(new Ui::Dialog)
    {
    ui->setupUi(this);

    timer1 = new QTimer(this);
    connect(timer1, SIGNAL(timeout()), this, SLOT(Ontimer1timeout()));
    timer1->start(10000);
    camera1 = new QCamera;
    cameraImageCapture1 = new QCameraImageCapture(camera1);
    QImageEncoderSettings imageEncoderSettings1;
    imageEncoderSettings1.setResolution(320,240);
    cameraImageCapture1->setEncodingSettings(imageEncoderSettings1);
    connect(cameraImageCapture1, SIGNAL(imageCaptured(int,QImage)), this, SLOT(OncameraImageCapture1imageCaptured(int,QImage)));
    

    }

    void Dialog::Ontimer1timeout()
    {
    if((CameraSw==1)&&(cameraImageCapture1->isReadyForCapture())) cameraImageCapture1->capture();
    }

    void Dialog::OncameraImageCapture1imageCaptured(int,QImage image1)
    {
    ui->label->setPixmap(QPixmap::fromImage(image1));
    }

    void Dialog::on_toolButton_clicked()
    {
    camera1->start();
    CameraSw=1;
    }

    void Dialog::on_toolButton_2_clicked()
    {
    camera1->stop();
    CameraSw=0;
    }
    @

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      What does a run using the debugger tells you ?

      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
      • P Offline
        P Offline
        peterlin82
        wrote on last edited by
        #3

        sorry.
        Not program crashes but operating system crashes.
        so without any error message.
        The same problem in Raspberry Pi.


        抱歉。
        不是应用程式当机而是作业系统当机。
        所以并没有产生任何错误讯息。
        在树莓派中执行也有相同的错误。

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Just to be sure I understand you correctly, you get your entire OS down by taking pictures ?

          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
          • P Offline
            P Offline
            peterlin82
            wrote on last edited by
            #5

            Yes,
            After cameraImageCapture1->capture(); two thousand times.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Did you check with a memory analyzer what as going on ?

              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
              • P Offline
                P Offline
                peterlin82
                wrote on last edited by
                #7

                I try analyzer.
                like this:

                !http://sigmaccc.myweb.hinet.net/temp/20140901173.jpg(msg1)!
                !http://sigmaccc.myweb.hinet.net/temp/20140901170.jpg(msg2)!

                I still don’t know how to solve.
                Any help would be appreciated!
                thanks a lot.

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  Check with the top command the memory consumption of your application

                  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
                  • P Offline
                    P Offline
                    peterlin82
                    wrote on last edited by
                    #9

                    I try top command.
                    like this:
                    !http://sigmaccc.myweb.hinet.net/temp/20140904175.jpg(msg1)!
                    !http://sigmaccc.myweb.hinet.net/temp/20140904176.jpg(msg2)!

                    Seems to be a memory problem.
                    But,I don’t know why.

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      Don't currently know either.

                      On an unrelated note:

                      @void OncameraImageCapture1imageCaptured(int,QImage image1)@

                      should rather be

                      @void OncameraImageCapture1imageCaptured(int, const QImage& image1)@

                      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
                      • P Offline
                        P Offline
                        peterlin82
                        wrote on last edited by
                        #11

                        I try
                        (1)void OncameraImageCapture1imageCaptured(int, const QImage &image1)
                        (2)echo 3 > /proc/sys/vm/drop_caches

                         sync
                        

                        (3)The other webcam(Logitech C270 Webcam)

                        but the problem persists.

                        1 Reply Last reply
                        0
                        • SGaistS Offline
                          SGaistS Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on last edited by
                          #12

                          Since Qt 5.4 Alpha has been release, can you try with to see if you still experience this ?

                          On a side note, 1Go of RAM ?

                          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
                          • P Offline
                            P Offline
                            peterlin82
                            wrote on last edited by
                            #13

                            Yes,1 GB RAM.

                            I try Qt 5.4 Beta.
                            but the problem persists.

                            /opt/Qt5.4.0/Examples/Qt-5.4/multimediawidgets/camera
                            has the same problem too.

                            1 Reply Last reply
                            0
                            • SGaistS Offline
                              SGaistS Offline
                              SGaist
                              Lifetime Qt Champion
                              wrote on last edited by
                              #14

                              Then you should take a look at the "bug report system":http://bugreports.qt-project.org to see if it's something known

                              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
                              • P Offline
                                P Offline
                                peterlin82
                                wrote on last edited by
                                #15

                                I find this.

                                "QTBUG-41606...":https://bugreports.qt-project.org/browse/QTBUG-41606?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel

                                SGaist,thank you very much.

                                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