Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-140183

[QVideoFrame] The setMirrored and setRotation methods on QVideoFrame aren’t working as expected.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 6.8.3, 6.10.0 Beta2
    • Multimedia
    • None
    • macOS, Windows

      In Qt 6.8.3, the setMirrored() and setRotation() methods in QVideoFrame don’t work as expected.

      • setRotation() only rotates the canvas (the display area), but doesn’t actually rotate the original video data.
      • setMirrored() does nothing at all — no mirror effect is applied.

       
      These features worked fine in Qt 6.5.3.

      I tested this using Qt’s Camera example, and the issue still persists,The difference is clearly visible in the attached screenshots.

      To verify this issue, you can replace the line
      {{}}

      m_captureSession.setVideoOutput(ui->viewfinder)

      {{}}
      in the Camera example’s setCamera() method with the following code:

       

      auto videoSink = ui->viewfinder->videoSink();
      if (videoSink) {
          connect(videoSink, &QVideoSink::videoFrameChanged, [=](const QVideoFrame& videoFrame) {
              auto frame = videoFrame;
              frame.setMirrored(true);  
      #if QT_VERSION >= QT_VERSION_CHECK(6, 8, 3)
              frame.setRotation(QtVideo::Rotation::Clockwise90);
      #else
              frame.setRotationAngle(QVideoFrame::Rotation90);  
      #endif
              videoSink->setVideoFrame(frame);
          });
          m_captureSession.setVideoSink(videoSink);
      }
      // m_captureSession.setVideoOutput(ui->viewfinder);
      

       

        1. 6.5.3.png
          6.5.3.png
          207 kB
        2. 6.8.3.png
          6.8.3.png
          241 kB
        3. origin.png
          origin.png
          141 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            qtmultimediateam Qt Multimedia Team
            box zhang weihai
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes