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. QVideoProbe not connecting to QMediaPlayer
Qt 6.11 is out! See what's new in the release blog

QVideoProbe not connecting to QMediaPlayer

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 1.7k 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.
  • T Offline
    T Offline
    Teermit
    wrote on last edited by
    #1

    Hello, I do everything as described in the "documentation":http://qt-project.org/doc/qt-5.0/qtmultimedia/qvideoprobe.html#details, the video plays, but the probe is not connecting

    @void MainWindow::initVideo()
    {
    QWidget videoPlaceholder = this->findChild<QWidget>("videoPlaceholder");
    QGridLayout targetLayout = videoPlaceholder->findChild<QGridLayout>("gridLayout");
    this->videoSurface = new QVideoWidget(videoPlaceholder);
    targetLayout->addWidget(this->videoSurface);
    this->player = new QMediaPlayer(this);

    QUrl videoURL = QUrl::fromLocalFile&#40;this->inputVideo&#41;;
    this->player->setMedia(videoURL);
    this->player->setVideoOutput(this->videoSurface);
    this->videoSurface->show();
    
    this->probe = new QVideoProbe(this);
    qDebug() << probe->setSource(this->player);
    qDebug() << probe->isActive();
    connect(probe,SIGNAL(videoFrameProbed(QVideoFrame)),this,SLOT(frameCaptured(QVideoFrame)));
    
    this->player->play();
    

    }

    void MainWindow::frameCaptured(const QVideoFrame &frame)
    {
    qDebug() << "get frame!"; //never called =(
    }@

    What did I do wrong?

    1 Reply Last reply
    0
    • J Offline
      J Offline
      jmimi
      wrote on last edited by
      #2

      I have the same problem.
      In my code "ctrl" is null, so according to qt code, there is no signaling.
      @bool res = videoProbe->setSource(mediRecorder);
      QMediaObject *obj = mediaRecorder->mediaObject();
      QMediaService *srv = obj->service();
      QMediaControl ctrl = srv->requestControl<QMediaVideoProbeControl>();@

      Do you find any solution?

      1 Reply Last reply
      0
      • Y Offline
        Y Offline
        youfeis
        wrote on last edited by
        #3

        Same here, using QMediaPlayer on windows, and probe->setSource(mediaplayer) simply returns false.

        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