Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Qml video metaData returns undefined values
Qt 6.11 is out! See what's new in the release blog

Qml video metaData returns undefined values

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 264 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • paghsaP Offline
    paghsaP Offline
    paghsa
    wrote on last edited by
    #1

    hi guys
    lets take a look at this code

            Video {
                id: video
                anchors.fill: parent
                autoPlay: true
                source: vidPath !== "" ? ("file:" +  vidPath) : ""
                focus: true
                loops: MediaPlayer.Infinite
    
                MouseArea{
                    anchors.fill: parent
                    hoverEnabled: true
                    onEntered: {
                        console.log(video.metaData.videoBitRate)
                        console.log(video.metaData.size)
                        console.log(video.metaData.videoFrameRate)
                        console.log(video.metaData.duration)
                    }
                }
            }
    

    the problem that i have no idea to figure out is all console.log print undefined
    any help will be appreciate

    1 Reply Last reply
    0
    • G Offline
      G Offline
      Geon_Gaegar
      wrote last edited by
      #2

      Hello,
      Though it's a later response, you can try:

      console.log(video.metaData.value(key)).

      The key is a fixed number which indicates the metaData keys,like:
      video.metaData.value(0) //title
      video.metaData.value(0) //duration
      etc.

      When you load a media, the keys will be in array but in random order, you can run
      console.log(video.metaData.keys())
      to get the keys first.

      I'm not a programmer, so I'm not so surre about if it's the best way to read the MetaData, but it works on Qt6.10

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved