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

QVideoWidget does not keep aspect ratio

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.15.1
    • 5.15.0
    • Multimedia
    • None
    • Ubuntu 18.04
      GStreamer 1.14.5
      PySide 5.15.0
    • Linux/X11
    • a553c7d1b63defc963a043e363f8d75d255e9c72 (qt/qtmultimedia/dev) 13843ca8a1f33b015e9347e4955b34d8711fdbfd (qt/qtmultimedia/5.15)

    Description

      Hello,

      I'm experiencing what appears to be a bug in QVideoWidget. When I resize the window containing the video the image becomes stretched. During the resize, while the mouse is pressed, the video frame flickers between the stretched state and a state where its aspect ratio is maintained, and stays stretched when I release the mouse (see attached image).

       

      A basic version of the widget I'm using to replicate the issue is shown below (using PySide2):

      class Editor(QWidget):
      
          def __init__(self, video_filename, parent=None):
              super().__init__(parent)
              main_layout = QVBoxLayout()
      
              video = QVideoWidget()
              video.setAspectRatioMode(Qt.KeepAspectRatio)
              main_layout.addWidget(video)
      
              self.player = QMediaPlayer()
              self.player.setMedia(QUrl.fromLocalFile(video_filename))
              self.player.setVideoOutput(video)
      
              self.setLayout(main_layout)
              self.player.play()
      

       

      The system I'm running this on is Ubuntu18.04 with the X11 window system and GStreamer1.15.5

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            valentyn.doroshchuk Valentyn Doroshchuk
            neod Jason Bourne
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes