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. QVideoWidget not working with QVideoProbe
QtWS25 Last Chance

QVideoWidget not working with QVideoProbe

Scheduled Pinned Locked Moved Unsolved General and Desktop
qvideowidgetqvideoprobe
7 Posts 2 Posters 1.0k Views
  • 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.
  • J Offline
    J Offline
    JK3WN
    wrote on 8 Mar 2021, 06:52 last edited by JK3WN 3 Aug 2021, 07:00
    #1

    So I tried out the example in https://doc.qt.io/qt-5/qvideoprobe.html.
    I set the video output to a QVideoWidget I created.
    For some reason, some videos do not show up and QVideoWidget stays as a black screen.
    If I delete the line "probe->setSource(player);", then it shows up again.
    I checked with different kind of videos, and I think mp4 videos that have a framerate of 30fps or more aren't showing up.
    Did anyone else have this problem? If so, how did you solve it?
    Yes, I did not make the slot processFrame(QVideoFrame), but I don't think that is the source of the problem.

    Qt Version 5.15.2
    MSVC2019 64bit
    Windows 10
    Using Windows Media Foundation

    mainwindow.cpp

    #include "mainwindow.h"
    #include "ui_mainwindow.h"

    MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
    {
    ui->setupUi(this);

    QMediaPlayer *player = new QMediaPlayer();
    QVideoProbe *probe = new QVideoProbe;
    
    connect(probe, SIGNAL(videoFrameProbed(QVideoFrame)), this, SLOT(processFrame(QVideoFrame)));
    
    probe->setSource(player);
    
    player->setVideoOutput(ui->widget);
    player->setMedia(QUrl::fromLocalFile("C:/Users/user/Desktop/028.mp4"));
    player->play();
    

    }

    MainWindow::~MainWindow()
    {
    delete ui;
    }

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 8 Mar 2021, 22:27 last edited by
      #2

      Hi and welcome to devnet,

      What are you doing in your processFrame slot ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • J Offline
        J Offline
        JK3WN
        wrote on 9 Mar 2021, 04:36 last edited by
        #3

        Right now, processFrame(QVideoFrame) is empty.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 9 Mar 2021, 20:37 last edited by
          #4

          Does it happen with all video files ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          J 1 Reply Last reply 10 Mar 2021, 00:30
          0
          • S SGaist
            9 Mar 2021, 20:37

            Does it happen with all video files ?

            J Offline
            J Offline
            JK3WN
            wrote on 10 Mar 2021, 00:30 last edited by JK3WN 3 Oct 2021, 05:20
            #5

            @SGaist No. It happens to only some of the files. Some files I could play with no problem, but some aren't. Most video files that had this problem had a framerate of 30. Video files with lower framerates had no problems. I don't think resolution is the problem, because I tried with small resolution videos with 30 fps and it still wasn't working.

            Edit: Tried the same example with my other computer, and it's working well. Both computers are Windows 10.

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 10 Mar 2021, 21:12 last edited by
              #6

              Different set of codecs ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              J 1 Reply Last reply 11 Mar 2021, 05:05
              0
              • S SGaist
                10 Mar 2021, 21:12

                Different set of codecs ?

                J Offline
                J Offline
                JK3WN
                wrote on 11 Mar 2021, 05:05 last edited by
                #7

                @SGaist No. Both computers have same codec set.

                1 Reply Last reply
                0

                4/7

                9 Mar 2021, 20:37

                • Login

                • Login or register to search.
                4 out of 7
                • First post
                  4/7
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved