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. Freeze video in QMediaPlayer
QtWS25 Last Chance

Freeze video in QMediaPlayer

Scheduled Pinned Locked Moved Unsolved General and Desktop
qt 5.5.1qmediaplayerfreeze
2 Posts 2 Posters 1.8k 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.
  • M Offline
    M Offline
    Mathias
    wrote on 18 May 2016, 12:05 last edited by Mathias
    #1

    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
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 18 May 2016, 21:18 last edited by
      #2

      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
      0

      1/2

      18 May 2016, 12:05

      • Login

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