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

MediaPlayer not reading video orientation metadata

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.5, 6.6
    • 6.5.0
    • Multimedia
    • None
    • Windows
    • 336156b3f (dev), 2042bf03d (6.6), 1615332fc (6.5)

    Description

      When using the following QML code to play a video with Qt6.5.0 or Qt6.6.0, the orientation metadata is not read correctly:

       

      Item { 
         MediaPlayer {
            id: mediaplayer 
            videoOutput: videooutput 
            audioOutput: AudioOutput {}
            onMetaDataChanged: { 
               console.log("METADATA!!!") 
               for (const v of metaData.keys()) { 
                  console.log(metaData.metaDataKeyToString(v) + " = " + metaData.value(v)) 
               }
            }
         }
         VideoOutput { 
            id: videooutput 
            anchors.fill: parent
         }
      } 

       
       
      When playing a video recorded upside down (i.e., with an orientation of 180 in the metadata), the video is correctly oriented with Qt6.4.2, but not with Qt6.5.0 or Qt6.6.0. With Qt6.4.2, the orientation metadata is read correctly, as shown by the following console output:

       

          2023-05-08T14:28:31 debug: qml expression for onMetaDataChanged: Video frame rate = 29.97
          2023-05-08T14:28:31 debug: qml expression for onMetaDataChanged: Video codec = 3
          2023-05-08T14:28:31 debug: qml expression for onMetaDataChanged: Resolution = QSize(3840, 2160)
          2023-05-08T14:28:31 debug: qml expression for onMetaDataChanged: Orientation = 180
          2023-05-08T14:28:31 debug: qml expression for onMetaDataChanged: Date = Tue Apr 12 15:07:06 2022 GMT+0200
          2023-05-08T14:28:31 debug: qml expression for onMetaDataChanged: Video bit rate = 92925544
          2023-05-08T14:28:31 debug: qml expression for onMetaDataChanged: Duration = 15049

       

      However, with Qt6.5.0 and Qt6.6.0, the orientation metadata is missing, as shown by the following console output:

       

      2023-05-09T08:51:12 debug: qml expression for onMetaDataChanged: Duration = 15048
      2023-05-09T08:51:12 debug: qml expression for onMetaDataChanged: Comment = 
      2023-05-09T08:51:12 debug: qml expression for onMetaDataChanged: Video frame rate = 29.97002997002997
      2023-05-09T08:51:12 debug: qml expression for onMetaDataChanged: Video codec = 3
      2023-05-09T08:51:12 debug: qml expression for onMetaDataChanged: Resolution = QSize(3840, 2160)
      2023-05-09T08:51:12 debug: qml expression for onMetaDataChanged: Date = Tue Apr 12 15:07:06 2022 GMT+0200
      2023-05-09T08:51:12 debug: qml expression for onMetaDataChanged: Video bit rate = 92626876
      2023-05-09T08:51:12 debug: qml expression for onMetaDataChanged: Container Format = 3

       

      Attachments

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

        Activity

          People

            lars.sutterud Lars Sutterud
            loiczimm Loic Zimmermann
            Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes