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 can i find the file saved by Qmediarecorder

how can i find the file saved by Qmediarecorder

Scheduled Pinned Locked Moved Solved General and Desktop
10 Posts 2 Posters 1.6k 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.
  • FlameF Offline
    FlameF Offline
    Flame
    wrote on last edited by
    #1

    all codes are following,I want to know how to find the video 1.mp4, hope your answers,because the qt example can't press the vidio menu,it is disabled!

    viewFinder = new QCameraViewfinder();
        camera = new QCamera;
        recorder = new QMediaRecorder(camera);
        camera->setCaptureMode(QCamera::CaptureVideo);
        camera->setViewfinder(viewFinder);
        camera->start();
        viewFinder->show();
        QAudioEncoderSettings audioSettings;
        audioSettings.setCodec("audio/amr");
        audioSettings.setQuality(QMultimedia::HighQuality);
        recorder->setAudioSettings(audioSettings);
        QVideoEncoderSettings videoSettings;
        videoSettings.setCodec("video/mpeg2");
        videoSettings.setResolution(640, 480);
        recorder->setVideoSettings(videoSettings);
        recorder->setOutputLocation(QUrl::fromLocalFile("1.mp4"));
        recorder->record();
    

    the example picture:0_1557496457716_批注 2019-05-10 215405.png

    e-mail:547453159@qq.com

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

      @Flame said in how can i find the file saved by Qmediarecorder:

      setOutputLocation

      Try to look in your build folder.

      FlameF 1 Reply Last reply
      0
      • FlameF Offline
        FlameF Offline
        Flame
        wrote on last edited by
        #3

        i can't find the video file in the file include exe file,do i need use the other function to execute the save command ?
        this is the file tree:
        0_1557498070590_批注 2019-05-10 222027.png

        e-mail:547453159@qq.com

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

          Hi
          That seems like a deplyment folder and not so much a build folder.
          However, i assume you mean when you just run it then.
          Maybe the tab is grey as it cant save the video.
          You should check the sample code under what condition, it won't allow the tab.
          You could also try with path in setOutputLocation

          1 Reply Last reply
          0
          • mrjjM mrjj

            @Flame said in how can i find the file saved by Qmediarecorder:

            setOutputLocation

            Try to look in your build folder.

            FlameF Offline
            FlameF Offline
            Flame
            wrote on last edited by
            #5

            @mrjj sorry sir, I think I may let you misunderstand,i do this don't use qt example,all codes show as following;

            viewFinder = new QCameraViewfinder();
                camera = new QCamera;
                recorder = new QMediaRecorder(camera);
                camera->setCaptureMode(QCamera::CaptureVideo);
                camera->setViewfinder(viewFinder);
                camera->start();
                viewFinder->show();
                QAudioEncoderSettings audioSettings;
                audioSettings.setCodec("audio/amr");
                audioSettings.setQuality(QMultimedia::HighQuality);
                recorder->setAudioSettings(audioSettings);
                QVideoEncoderSettings videoSettings;
                videoSettings.setCodec("video/mpeg2");
                videoSettings.setResolution(640, 480);
                recorder->setVideoSettings(videoSettings);
                recorder->setOutputLocation(QUrl::fromLocalFile("1.mp4"));
                recorder->record();
            

            i want these codes will have the function which can save the video from camera,i mean “Are there any missing steps”

            e-mail:547453159@qq.com

            1 Reply Last reply
            1
            • mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Hi
              It looks ok, but you should hook up the error handling signals to catch any errors.
              void QMediaRecorder::error(QMediaRecorder::Error error)

              FlameF 1 Reply Last reply
              1
              • mrjjM mrjj

                Hi
                It looks ok, but you should hook up the error handling signals to catch any errors.
                void QMediaRecorder::error(QMediaRecorder::Error error)

                FlameF Offline
                FlameF Offline
                Flame
                wrote on last edited by
                #7

                @mrjj thank you very much for your advise, but sorry , i think i will bother you again,today i try to obtain the signal error,i find there is not error signal emited,but i find the state and status is : QMediaRecorder::StoppedState and QMediaRecorder::UnavailableStatus ,after i using the "record" function,i don't konw how to handle this problem,hope your advise

                e-mail:547453159@qq.com

                1 Reply Last reply
                1
                • mrjjM Offline
                  mrjjM Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on last edited by mrjj
                  #8

                  Hi
                  Can you try to qDebug() << camera->isCaptureModeSupported(QCamera::CaptureVideo);.

                  I got this feeling recording is not supported.
                  https://doc.qt.io/qt-5/qtmultimedia-windows.html
                  "Video recording is currently not supported. "

                  FlameF 1 Reply Last reply
                  0
                  • mrjjM mrjj

                    Hi
                    Can you try to qDebug() << camera->isCaptureModeSupported(QCamera::CaptureVideo);.

                    I got this feeling recording is not supported.
                    https://doc.qt.io/qt-5/qtmultimedia-windows.html
                    "Video recording is currently not supported. "

                    FlameF Offline
                    FlameF Offline
                    Flame
                    wrote on last edited by
                    #9

                    @mrjj sorry sir,i can't reply you immediately,because i am a new member
                    , i find isCaptureModeSupported(QCamera::CaptureVideo) is false, you are right,I do use Windows platforms, thank you ,It seems that I can only use other methods.

                    e-mail:547453159@qq.com

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

                      Hi
                      Yes it seems on windows, recording is not really supported. still.

                      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