Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Transform QVideoFrame



  • Is it possible to apply transformation (QTransform) to QVideoFrame in Qt 6.2.2? I can't find any option to apply mirroring of frame to video output. I see only one option for rotation in QML VideoOutput

    
    
    orientation : int
    
    In some cases the source video stream requires a certain orientation to be correct. This includes sources like a camera viewfinder, where the displayed viewfinder should match reality, no matter what rotation the rest of the user interface has.
    This property allows you to apply a rotation (in steps of 90 degrees) to compensate for any user interface rotation, with positive values in the anti-clockwise direction.
    The orientation change will also affect the mapping of coordinates from source to viewport.
    


  • I found the solution:

        VideoOutput {
            id: view
            anchors.fill: parent
            anchors.centerIn: parent
            focus : visible
            transform: [ Scale { origin.x: appWindow.width / 2; origin.y: appWindow.height / 2;
                    xScale: frames.xScale; yScale: frames.yScale },
                Rotation { origin.x: appWindow.width / 2; origin.y: appWindow.height / 2;
                    angle: frames.angle } ]
        }
    

Log in to reply