Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-74024

QMediaRecorder does not work with gst pipelines

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • P3: Somewhat important
    • None
    • 5.12.0, 5.12.1
    • Multimedia
    • None
    • Linux/X11

    Description

      I did a simple program to record gstreamer pipelines with QMediaRecorder, and it justs crashs when I do some function calls.
      Also, it does not record the rtsp video : )

      Player::Player() :
          QMediaPlayer()
      {
          const QMediaContent media({"rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov"});
          setMedia(media);
          play();
      
          connect(this, &QMediaPlayer::stateChanged, this, [](auto state){
              qDebug() << "state" << state;
          });
      
          QMediaRecorder mediaRecorder(this);
      
          connect(&mediaRecorder, &QMediaRecorder::stateChanged, this, [](auto state){
              qDebug() << "state media" << state;
          });
      
          connect(&mediaRecorder, &QMediaRecorder::statusChanged, this, [](auto status){
              qDebug() << "status media" << status;
          });
      
          QVideoEncoderSettings videoSettings;
          videoSettings.setCodec("video/mp4");
          videoSettings.setResolution(640, 480);
          mediaRecorder.setVideoSettings(videoSettings);
          mediaRecorder.setOutputLocation(QUrl::fromLocalFile("/tmp/video.mp4"));
          mediaRecorder.record();
      
          QTimer::singleShot(2000, [&mediaRecorder]{
              QList<QPair<QString, QVariant>> list = {
                  {"location", mediaRecorder.actualLocation()},
                  {"status", mediaRecorder.status()},
                  {"availability", mediaRecorder.availability()},
                  {"availableMetaData", mediaRecorder.availableMetaData()},
                  {"containerFormat", mediaRecorder.containerFormat()},
                  {"duration", mediaRecorder.duration()},
                  {"error", mediaRecorder.error()},
                  {"errorString", mediaRecorder.errorString()},
                  {"isAvailable", mediaRecorder.isAvailable()},
                  {"isMetaDataAvailable", mediaRecorder.isMetaDataAvailable()},
                  {"isMuted", mediaRecorder.isMuted()},
                  {"state", mediaRecorder.state()},
                  //{"videoSettings", mediaRecorder.videoSettings()},
              };
              for(const auto item : list) {
                  qDebug() << item.first << item.second;
              }
              mediaRecorder.stop();
          });
      }
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            valentyn.doroshchuk Valentyn Doroshchuk
            patrickelectric Patrick Pereira
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes