How to catch frame in QT Multimedia application using QVideoFrame?



  • Hi,

    I developed application on Qt which can play video from local file location using QVideoWidget, QMediaPlayer, etc. Now I want to catch frame and show video on an application using QVideoFrame. Please help to sort out this problem, give some basic example for how to use QVideoFrame to catch frame and show video?

    Thanks


  • Lifetime Qt Champion

    Hi,

    Do you mean QVideoProbe ?



  • @SGaist : I have no idea about QVideoProbe but using QVideoFrame we can show frame on player... so I want to one example which one use QVideoFrame.
    -Thanks


  • Moderators

    Maybe you should check the link SGaist provided you?
    It even has an example with a QVideoFrame in it:

    QMediaPlayer *player = new QMediaPlayer();
    QVideoProbe *probe = new QVideoProbe;
    
    connect(probe, SIGNAL(videoFrameProbed(QVideoFrame)), this, SLOT(processFrame(QVideoFrame)));
    
    probe->setSource(player); // Returns true, hopefully.
    
    player->setVideoOutput(myVideoSurface);
    player->setMedia(QUrl::fromLocalFile("observation.mp4"));
    player->play(); // Start receiving frames as they get presented to myVideoSurface
    

Log in to reply
 

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