Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. MediaPlayer often does not play video
Forum Updated to NodeBB v4.3 + New Features

MediaPlayer often does not play video

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
5 Posts 3 Posters 532 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.
  • M Offline
    M Offline
    Mark81
    wrote on last edited by
    #1

    I have this simple code:

    ApplicationWindow {
        width: 1920;  height: 1080
        visible: true
        visibility: "FullScreen"
    
        MediaPlayer {
            id: mediaPlayer
            videoOutput: videoOutput
            source: "file:///home/user/test.mov"
    
            onMediaStatusChanged: {
                if (mediaPlayer.mediaStatus == MediaPlayer.LoadedMedia) play();
            }
    
            onErrorOccurred: { console.log(mediaPlayer.errorString) }
            onPlaybackStateChanged: { console.log(mediaPlayer.playbackState) }
        }
    
        VideoOutput {
            id: videoOutput
            anchors.fill: parent
        }
    }
    

    Usually it works, but sometimes (or often...) it does not play the video. I always get 1 as playbackState and never get an error.
    When it happens, it does not play the video for several consecutive runs. Then, it come back and works as expected....

    How to understand why it does not play the video?
    Qt 6.2.0 and Ubuntu 20.04.

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

      Hi,

      Is it always the same video that triggers this ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      M 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        Is it always the same video that triggers this ?

        M Offline
        M Offline
        Mark81
        wrote on last edited by
        #3

        @SGaist No, I tried with different videos with different codes and formats. Same behavior. It's unreliable.

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

          I would first update to 6.2.1 next, are these files stored in a specific location ?

          Do you have the same issue if you play them with GStreamer directly ?

          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
          • M Mark81

            @SGaist No, I tried with different videos with different codes and formats. Same behavior. It's unreliable.

            JoeCFDJ Offline
            JoeCFDJ Offline
            JoeCFD
            wrote on last edited by JoeCFD
            #5

            @Mark81 Multimedia is reworked in Qt 6.2 from the recent talk of Lars Knoll and could have a lot of issues. I would not use it now. I do not use it and still apply gstreamer for playing videos.

            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