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. How to record video as soon as application started?
Forum Updated to NodeBB v4.3 + New Features

How to record video as soon as application started?

Scheduled Pinned Locked Moved Solved General and Desktop
16 Posts 4 Posters 1.4k Views
  • 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.
  • H hix_boz

    @jsulm I have added the error handling like before,

    connect(mediaRecorder, QOverload<QMediaRecorder::Error>::of(&QMediaRecorder::error),this, &MainWindow::displayRecorderError);
    
    void MainWindow::displayRecorderError()
    {
        QMessageBox::warning(this, tr("Capture Error"), mediaRecorder->errorString());
    }
    

    I got an error like "no template named 'QOverLoad'" . I have checked camera example of qt which records video and capture images application and I did almost same thing. I suspect the version incompatibility. Do you think version differences cause this issue?

    jsulmJ Offline
    jsulmJ Offline
    jsulm
    Lifetime Qt Champion
    wrote on last edited by
    #6

    @hix_boz said in How to record video as soon as application started?:

    Do you think version differences cause this issue?

    What Qt version do you use?

    https://forum.qt.io/topic/113070/qt-code-of-conduct

    H 1 Reply Last reply
    0
    • jsulmJ jsulm

      @hix_boz said in How to record video as soon as application started?:

      Do you think version differences cause this issue?

      What Qt version do you use?

      H Offline
      H Offline
      hix_boz
      wrote on last edited by
      #7

      @jsulm

      Qt Creator 4.13.1
      Based on Qt 5.15.1 (GCC 5.3.1 20160406 (Red Hat 5.3.1-6), 64 bit)

      1 Reply Last reply
      0
      • H hix_boz

        @jsulm I have added the error handling like before,

        connect(mediaRecorder, QOverload<QMediaRecorder::Error>::of(&QMediaRecorder::error),this, &MainWindow::displayRecorderError);
        
        void MainWindow::displayRecorderError()
        {
            QMessageBox::warning(this, tr("Capture Error"), mediaRecorder->errorString());
        }
        

        I got an error like "no template named 'QOverLoad'" . I have checked camera example of qt which records video and capture images application and I did almost same thing. I suspect the version incompatibility. Do you think version differences cause this issue?

        Christian EhrlicherC Offline
        Christian EhrlicherC Offline
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on last edited by
        #8

        @hix_boz said in How to record video as soon as application started?:

        QOverload

        I got an error like "no template named 'QOverLoad'"

        QOverload != QOverLoad - please post the real code and the real error message.

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        H 1 Reply Last reply
        1
        • Christian EhrlicherC Christian Ehrlicher

          @hix_boz said in How to record video as soon as application started?:

          QOverload

          I got an error like "no template named 'QOverLoad'"

          QOverload != QOverLoad - please post the real code and the real error message.

          H Offline
          H Offline
          hix_boz
          wrote on last edited by hix_boz
          #9

          @Christian-Ehrlicher
          Do you ask to share all prject files when you say real code? Here the errors I got.

          Screenshot from 2022-02-17 10-27-22.png

          Additionaly, I took the error handler connect snippet from Qt camera example which is working with my Qt version.

          jsulmJ 1 Reply Last reply
          0
          • H hix_boz

            @Christian-Ehrlicher
            Do you ask to share all prject files when you say real code? Here the errors I got.

            Screenshot from 2022-02-17 10-27-22.png

            Additionaly, I took the error handler connect snippet from Qt camera example which is working with my Qt version.

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #10

            @hix_boz said in How to record video as soon as application started?:

            Do you ask to share all prject files when you say real code?

            No, your connect statement.
            As @Christian-Ehrlicher pointed out it is QOverload NOT QOverLoad...

            And the version you posted only says something about Qt version used to build QtCreator, not Qt version you're using...

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            H 1 Reply Last reply
            0
            • jsulmJ jsulm

              @hix_boz said in How to record video as soon as application started?:

              Do you ask to share all prject files when you say real code?

              No, your connect statement.
              As @Christian-Ehrlicher pointed out it is QOverload NOT QOverLoad...

              And the version you posted only says something about Qt version used to build QtCreator, not Qt version you're using...

              H Offline
              H Offline
              hix_boz
              wrote on last edited by
              #11

              @jsulm

              After commanding "qmake --version" from terminal, I got this one.

              QMake version 3.0
              Using Qt version 5.5.1 in /usr/lib/x86_64-linux-gnu

              I also typed "qtdiag" and the first line of response like below.

              Qt 5.5.1 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 5.4.0 20160609) on "xcb"

              I tried either QOverLoad and QOverload and still got an error. As I said before, I took the connect part from camera example which has worked and I did not change anything. They used "QOverload" in connect line.

              jsulmJ Christian EhrlicherC 2 Replies Last reply
              0
              • H hix_boz

                @jsulm

                After commanding "qmake --version" from terminal, I got this one.

                QMake version 3.0
                Using Qt version 5.5.1 in /usr/lib/x86_64-linux-gnu

                I also typed "qtdiag" and the first line of response like below.

                Qt 5.5.1 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 5.4.0 20160609) on "xcb"

                I tried either QOverLoad and QOverload and still got an error. As I said before, I took the connect part from camera example which has worked and I did not change anything. They used "QOverload" in connect line.

                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on last edited by
                #12

                @hix_boz According to Qt5.5 documentation (https://doc.qt.io/archives/qt-5.5/qmediarecorder.html#error-1):

                connect(mediaRecorder, static_cast<void(QMediaRecorder::*)(QMediaRecorder::Error)>(&QMediaRecorder::error),
                    [=](QMediaRecorder::Error error){ /* ... */ });
                

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                H 1 Reply Last reply
                0
                • H hix_boz

                  @jsulm

                  After commanding "qmake --version" from terminal, I got this one.

                  QMake version 3.0
                  Using Qt version 5.5.1 in /usr/lib/x86_64-linux-gnu

                  I also typed "qtdiag" and the first line of response like below.

                  Qt 5.5.1 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 5.4.0 20160609) on "xcb"

                  I tried either QOverLoad and QOverload and still got an error. As I said before, I took the connect part from camera example which has worked and I did not change anything. They used "QOverload" in connect line.

                  Christian EhrlicherC Offline
                  Christian EhrlicherC Offline
                  Christian Ehrlicher
                  Lifetime Qt Champion
                  wrote on last edited by
                  #13

                  @hix_boz said in How to record video as soon as application started?:

                  I tried either QOverLoad and QOverload and still got an error

                  No - there must be at least another error message, please post the error message when you use the correct function QOverload

                  Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                  Visit the Qt Academy at https://academy.qt.io/catalog

                  1 Reply Last reply
                  1
                  • jsulmJ jsulm

                    @hix_boz According to Qt5.5 documentation (https://doc.qt.io/archives/qt-5.5/qmediarecorder.html#error-1):

                    connect(mediaRecorder, static_cast<void(QMediaRecorder::*)(QMediaRecorder::Error)>(&QMediaRecorder::error),
                        [=](QMediaRecorder::Error error){ /* ... */ });
                    
                    H Offline
                    H Offline
                    hix_boz
                    wrote on last edited by
                    #14

                    @jsulm

                    It worked like this,

                    connect(mediaRecorder, static_cast<void(QMediaRecorder::*)(QMediaRecorder::Error)>(&QMediaRecorder::error),
                             [=](QMediaRecorder::Error error){  qDebug() << mediaRecorder->errorString(); });
                    

                    The error I got ,
                    "Service has not been started" .

                    Also the below message I keep getting.
                    (videoPlayer:9057): GStreamer-CRITICAL **: gst_mini_object_unref: assertion 'mini_object != NULL' failed

                    1 Reply Last reply
                    0
                    • B Offline
                      B Offline
                      Bonnie
                      wrote on last edited by Bonnie
                      #15

                      I think you should connect to the QCamera::statusChanged signal, and start the recorder after the status becomes QCamera::ActiveStatus (maybe also stop it when it is non-active).

                      H 1 Reply Last reply
                      2
                      • B Bonnie

                        I think you should connect to the QCamera::statusChanged signal, and start the recorder after the status becomes QCamera::ActiveStatus (maybe also stop it when it is non-active).

                        H Offline
                        H Offline
                        hix_boz
                        wrote on last edited by
                        #16

                        @Bonnie
                        It works, thanks you so 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