Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    Unsolved QMediaPlayer with QVideoProbe android

    Mobile and Embedded
    1
    1
    62
    Loading More Posts
    • 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.
    • D
      Deymos last edited by

      Hi, I have a problem with grab frames from QMediaPlayer with QVideoProbe
      Look, I have MediaPlayer in QML:

          MediaPlayer {
              id: player
              objectName: "qmlPlayer"
              source: "qrc:/imgs/ebalo.mp4"
      
          }
             VideoOutput {
                 id: output
                 source: player
                 x: 0
                 y: 0
                 anchors.fill : parent
                 width: parent.width
                 height: parent.height
      }
      

      And i'm cast this into QMediaPlayer in qt side:

          QQmlEngine * engin = QQmlEngine::contextForObject(this)->engine();
          QQmlApplicationEngine *engine = qobject_cast<QQmlApplicationEngine*>(engin);
          QObject *qmlMedia = engine->rootObjects().at(0)->findChild<QObject*>("qmlPlayer");
          player = qvariant_cast<QMediaPlayer *>(qmlMedia->property("mediaObject"));
          connect(&probe,&QVideoProbe::videoFrameProbed,this,&ClassBuilder::handleFrame);
          qDebug()<<probe.setSource(player)<<"player"<<player<<player->errorString();
          probe.setSource(player);
      

      QDebug output is: false player QMediaPlayer(0xbe1ac010) ""
      why is setSource returns false?
      Replacing the MediaPlayer with the QCamera everything works as it should, maybe grabbing frames via QVideoProbe from QMediaPlayer is not supported on android?

      1 Reply Last reply Reply Quote 0
      • First post
        Last post