QML video failing to appear intermittently



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


  • Moderators

    @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, ...



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


  • Moderators

    @carlyh said in QML video failing to appear intermittently:

    -error prints as QMultimedia::Available

    thats not a value of the error property?


Log in to reply
 

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