QVideoProbe not connecting to QMediaPlayer



  • 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?



  • 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?



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


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.