Freeze video in QMediaPlayer



  • 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)?


  • Lifetime Qt Champion

    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 ?


Log in to reply
 

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