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. QML video failing to appear intermittently
Forum Updated to NodeBB v4.3 + New Features

QML video failing to appear intermittently

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
4 Posts 2 Posters 501 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.
  • C Offline
    C Offline
    carlyh
    wrote on last edited by
    #1

    I'm seeing some strange behavior with the QML video component -- the video fails to appear intermittently, about 5% of the time.

    Video {
        property int zeroPositionCounts: 0
        id: video
        width: 1080
        height: 1920
        fillMode: VideoOutput.PreserveAspectCrop
        autoPlay: true
        autoLoad: true
        source: videoPath
    
        notifyInterval: 50
        onPositionChanged: {
            console.log("Video::video position: " + position);
            if (position === 0){
                zeroPositionCounts++;
                console.log("Video::video zeroPositionCounts: " + zeroPositionCounts);
            }
            if (zeroPositionCounts > 5){
                console.log("Video:: position is stuck, resetting...");
                zeroPositionCounts = 0;
                video.stop();
                video.play();
            }
        }
    

    The position logic is to insure the video doesn't get stuck on the first frame, which I was also seeing happening occasionally. That seems to have solved the issue.

    I've been printing out all the standard video status to try to debug this, but haven't found any obvious issues:
    -The video position changes as expected.
    -The "status" is 6 (QMediaPlayer::BufferedMedia)
    -the size, position, and opacity are all unchanged -- I've added a child Rect with just a border color to the video component, and that appears consistently.

    I've tried swapping out the video files with no success.

    Has anyone dealt with a similar issue, or has advice on how to debug this further?

    raven-worxR 1 Reply Last reply
    0
    • C carlyh

      I'm seeing some strange behavior with the QML video component -- the video fails to appear intermittently, about 5% of the time.

      Video {
          property int zeroPositionCounts: 0
          id: video
          width: 1080
          height: 1920
          fillMode: VideoOutput.PreserveAspectCrop
          autoPlay: true
          autoLoad: true
          source: videoPath
      
          notifyInterval: 50
          onPositionChanged: {
              console.log("Video::video position: " + position);
              if (position === 0){
                  zeroPositionCounts++;
                  console.log("Video::video zeroPositionCounts: " + zeroPositionCounts);
              }
              if (zeroPositionCounts > 5){
                  console.log("Video:: position is stuck, resetting...");
                  zeroPositionCounts = 0;
                  video.stop();
                  video.play();
              }
          }
      

      The position logic is to insure the video doesn't get stuck on the first frame, which I was also seeing happening occasionally. That seems to have solved the issue.

      I've been printing out all the standard video status to try to debug this, but haven't found any obvious issues:
      -The video position changes as expected.
      -The "status" is 6 (QMediaPlayer::BufferedMedia)
      -the size, position, and opacity are all unchanged -- I've added a child Rect with just a border color to the video component, and that appears consistently.

      I've tried swapping out the video files with no success.

      Has anyone dealt with a similar issue, or has advice on how to debug this further?

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by raven-worx
      #2

      @carlyh
      on what platform and what media backend?
      Any output in the application/debug console?

      What about other properties of the Video element like availability, bufferProgress, error, ...

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • C Offline
        C Offline
        carlyh
        wrote on last edited by
        #3

        @raven-worx
        -Windows 10
        -Qt 5.11.1
        -mp4 files, H.264

        during the error:
        -availability prints as QMultimedia::Available
        -error prints as QMultimedia::Available
        -bufferProgress is 0 (I see the same thing when the error is not present)

        raven-worxR 1 Reply Last reply
        0
        • C carlyh

          @raven-worx
          -Windows 10
          -Qt 5.11.1
          -mp4 files, H.264

          during the error:
          -availability prints as QMultimedia::Available
          -error prints as QMultimedia::Available
          -bufferProgress is 0 (I see the same thing when the error is not present)

          raven-worxR Offline
          raven-worxR Offline
          raven-worx
          Moderators
          wrote on last edited by
          #4

          @carlyh said in QML video failing to appear intermittently:

          -error prints as QMultimedia::Available

          thats not a value of the error property?

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          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