Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QMediaPlayer video playback issue
Forum Updated to NodeBB v4.3 + New Features

QMediaPlayer video playback issue

Scheduled Pinned Locked Moved Mobile and Embedded
5 Posts 1 Posters 5.4k Views 1 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.
  • ? This user is from outside of this forum
    ? This user is from outside of this forum
    Guest
    wrote on last edited by
    #1

    I'm currently investigating an odd problem whereby an application that uses QMediaPlayer to playback video files is experiencing intermittent playback problems.

    When the problem occurs, no video frames are rendered, but the video's audio track is played correctly.

    At no time is an error reported and all player state and media status changes are valid and sensible, suggesting the media is opened, buffered and played correctly.

    I've checked system RAM, application heap and used GOOM to verify that no low memory events are being generated by the GPU. So this doesn't seem to be an OOM or GOOM issue.

    I'm trying to build a debug version of Qt Mobility (or QtMultimediaKit) to allow me to investigate what is happening within QMediaPlayer, but so far I am unable to build the code. (If I build QtMobility, there are missing directories and headers, if I just build QtMultimediaKit there are problems with symbols missing from the Elf file!)

    Currently building with Qt SDK 1.1.1 / Qt 4.7.3 for Symbian^3 / Qt Mobility 1.1.3.

    The problem is completely intermittent and only affects some individual C7 and N8 handsets (not whole phone models).

    Has anyone else experienced this sort of difficulty with QMediaPlayer? Any hints as to what I should look at next?

    Thanks in advance!

    1 Reply Last reply
    0
    • L Offline
      L Offline
      leon.anavi
      wrote on last edited by
      #2

      Could you please share your source code?

      There is example usage of "QMediaPlayer at the official documentation of Qt Mobility 1.1":http://doc.qt.nokia.com/qtmobility/qmediaplayer.html Have you already looked at it?

      http://anavi.org/

      1 Reply Last reply
      0
      • ? This user is from outside of this forum
        ? This user is from outside of this forum
        Guest
        wrote on last edited by
        #3

        Naturally I have examined the official documentation. As I say, the problem is completely intermittent and only affects some handsets. And even on the affected handsets sometimes the videos work and sometimes they don't! I strongly suspected some OOM issue, but that seems not to be the case.

        Here's the code:
        @CVideoView::CVideoView(const QString &videoName, QWidget *parent):
        CMyAppBaseView(parent)
        {
        mPlayer = new QMediaPlayer();
        mPlayer->setMedia(QUrl::fromLocalFile(videoName));

            connect(mPlayer, SIGNAL(stateChanged(QMediaPlayer::State)), this, SLOT(onMediaPlayerStateChanged(QMediaPlayer::State)));
            connect(mPlayer, SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus)),
                    this, SLOT(onMediaStatusChanged(QMediaPlayer::MediaStatus)));
        
            mVideoWidget = new QVideoWidget(this);
            mVideoWidget->setGeometry(0,0,640,360);
            mVideoWidget->setFullScreen(true);
            mVideoWidget->show();
        
            mPlayer->setVideoOutput(mVideoWidget);
            qDebug()<<this<<"Calling play() on mPlayer.";
            mPlayer->setVolume(50);
            mPlayer->play();
        

        }

        CVideoView::~CVideoView()
        {
        if (mPlayer)
        {
        mPlayer->stop();
        delete mPlayer;
        delete mVideoWidget;
        }
        }

        void CVideoView::onMediaPlayerStateChanged(QMediaPlayer::State state)
        {
        qDebug() << this << "QMediaPlayer::State = "<<state;

        if (QMediaPlayer::StoppedState == state)
        {
        

        // ...
        // Code to switch back to parent view
        // ...
        }
        }

        void CVideoView::onMediaStatusChanged(QMediaPlayer::MediaStatus state)
        {
        qDebug()<<this<<"Media status = "<< state;
        }@

        1 Reply Last reply
        0
        • L Offline
          L Offline
          leon.anavi
          wrote on last edited by
          #4

          Thanks for sharing the source code. It looks pretty standard. Btw I found a similar "thread at Forum Nokia":http://discussion.forum.nokia.com/forum/showthread.php?211738-QVideoWidget-Sound-is-available-but-no-video

          [quote author="GavinM" date="1308043014"]As I say, the problem is completely intermittent and only affects some handsets. [/quote]

          Do you use the "smart installer":http://developer.qt.nokia.com/wiki/Nokia_Smart_Installer_for_Symbian to verify that all dependency are up to date when you install the app? The different behavior on different devices of a same model might be caused by this.

          http://anavi.org/

          1 Reply Last reply
          0
          • ? This user is from outside of this forum
            ? This user is from outside of this forum
            Guest
            wrote on last edited by
            #5

            I don't use the smart installer during development. But that's not the problem - the issue is intermittent on some devices; it's not that videos refuse to play on particular devices. Sometimes they play, sometimes they don't.

            Further investigation seems to suggest that setting Media and VideoOutput on QMediaPlayer and then calling play, as shown in the documentation and all sample code is not sufficient.
            Having prepared the QMediaPlayer instance, I now defer calling play until I've received a signal to tell me the media has been loaded. Calling play prior to confirmation the media has loaded seems quite unreliable.

            However, even that isn't sufficient. I still have a problem whereby the first attempted play of a video clip in my application still only plays the audio track. Subsequent plays of the same or other video clips from that point on work, playing both video and audio.

            My assumption is that there is some plugin that needs to be loaded, which isn't being loaded before my application calls play, but that is available the next time I try to play a video.
            Is that correct? If so, how do I guarantee that my QMediaPlayer object is fully ready to play my video clip? How can I force all necessary components / plugins to be loaded?

            Thanks in advance!

            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