Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved Freeze video in QMediaPlayer

    General and Desktop
    qt 5.5.1 qmediaplayer freeze
    2
    2
    1409
    Loading More Posts
    • 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.
    • M
      Mathias last edited by Mathias

      Hi Everyone! Beforehand sorry for my english.

      There is a code that download the video file from an Internet (https) and play it in a QMediaPlayer, at the end of the video triggered relevant slot requesting a new link to the video, and so the loop.

      void
      Shell::refreshVideoLink(QMediaPlayer::State state)
      {
          if (state == QMediaPlayer::StoppedState)
              videoNetworkManager->get(QNetworkRequest(QUrl::fromEncoded("https://there_link_returned_JSON")));
      }
      
      void
      Shell::videoLinkLoadFinished (QNetworkReply *reply)
      {
          QJsonDocument jsonDocument = QJsonDocument::fromJson(reply->readAll());
          QJsonObject jsonObject = jsonDocument.object();
       
          videoPlayer->setMedia(QUrl(jsonObject["url_mp4"].toString()));
          videoPlayer->play();
       
          reply->deleteLater();
      }
      

      and connect's from object initialization:

      connect(videoPlayer, SIGNAL(stateChanged(QMediaPlayer::State)), this, SLOT(refreshVideoLink(QMediaPlayer::State)));
      connect(videoNetworkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(videoLinkLoadFinished(QNetworkReply*)));
      

      The completely unpredictable point in time, any video anywhere can freeze! This can happen in a week, maybe an hour. All videos in HD, that is 720 pixels in height with the frame rate value 25. It is noted that when frame rate more than 25 or quality of video is more best (Full HD or higher) the frequency of the friezes increases.

      Throughput channels 200 megabits per second (local area network). Videos themselves are not very heavy (50-100 megabytes). Set handlers almost all signals QMediaPlayer, especially QMediaPlayer :: error (). Absolutely not found anything.

      Operation System: Mac OS X 10.11.4 El Capitan
      Version QT: 5.5.1

      Dear experts, what might be connected video friezes and how it can be solved? If it's because of codecs, that is, whether in Qt way to specify a particular video codec (through QVideoDeviceSelectorControl or something like that)?

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi and welcome to devnet,

        QtMultimedia uses Apple's Media Foundation for it's OS X backend so the format supported depends on what Media Foundation can support.

        Can you try the same application using the latest version of Qt ?

        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 Reply Quote 0
        • First post
          Last post