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. QMediaPlayer frame rate
Forum Updated to NodeBB v4.3 + New Features

QMediaPlayer frame rate

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 2.0k Views 2 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.
  • G Offline
    G Offline
    gmparker2000
    wrote on last edited by
    #1

    Looking for a reliable way to get video frame rate from QMediaPlayer. I hooked into the mediaStatusChanged signal and iterated through the availableMetaData.

    void VideoWidget::onMediaStatusChanged(QMediaPlayer::MediaStatus) {
        QStringList metadatalist = _mediaPlayer->availableMetaData();
        int list_size = metadatalist.size();
        QString metadata_key;
        QVariant var_data;
    
        for (int indx = 0; indx < list_size; indx++)
        {
            metadata_key = metadatalist.at(indx);
            var_data = _mediaPlayer->metaData(metadata_key);
            qDebug() << metadata_key << var_data.toString();
        }
    }
    

    This prints out some information but not frame rate. I need to do some calculations based on frame rate. Can this be obtained reliably from QMediaPlayer some other way? Is there another library I could use?

    G 1 Reply Last reply
    0
    • G gmparker2000

      Looking for a reliable way to get video frame rate from QMediaPlayer. I hooked into the mediaStatusChanged signal and iterated through the availableMetaData.

      void VideoWidget::onMediaStatusChanged(QMediaPlayer::MediaStatus) {
          QStringList metadatalist = _mediaPlayer->availableMetaData();
          int list_size = metadatalist.size();
          QString metadata_key;
          QVariant var_data;
      
          for (int indx = 0; indx < list_size; indx++)
          {
              metadata_key = metadatalist.at(indx);
              var_data = _mediaPlayer->metaData(metadata_key);
              qDebug() << metadata_key << var_data.toString();
          }
      }
      

      This prints out some information but not frame rate. I need to do some calculations based on frame rate. Can this be obtained reliably from QMediaPlayer some other way? Is there another library I could use?

      G Offline
      G Offline
      gmparker2000
      wrote on last edited by
      #2

      I'm guessing from lack of replies that this is either not possible or not guaranteed to be in the meta data.

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

        You might also be loading a video which has a variable frame rate.

        You might be interested by MediaInfo.

        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
        1
        • G Offline
          G Offline
          gmparker2000
          wrote on last edited by
          #4

          MediaInfo seems to work. Thanks.

          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