Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Changing metadata of a .mp3 file using QMediaPlayer?
Forum Updated to NodeBB v4.3 + New Features

Changing metadata of a .mp3 file using QMediaPlayer?

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 4 Posters 627 Views 2 Watching
  • 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.
  • MarKSM Offline
    MarKSM Offline
    MarKS
    wrote on last edited by MarKS
    #1

    I have a simple app where I load .mp3 file and display its metadata in a QTableView. I see it works pretty well. This is how I get the metadata and its value

    QStringList metadataList = m_player->availableMetaData();
    QVariant value = m_player->metaData(data);
    

    What I want now is to edit the metadata value in my table view column and save it back in the .mp3.

    QMediaObject has a metadata changed signal but I am not sure when and how it is emitted.

    Did I miss any setMetadata(QString value) in QMediaPlayer?

    Is it even possible to edit and save the metadata back to .mp3? If yes, how?

    Pl45m4P 1 Reply Last reply
    0
    • MarKSM MarKS

      I have a simple app where I load .mp3 file and display its metadata in a QTableView. I see it works pretty well. This is how I get the metadata and its value

      QStringList metadataList = m_player->availableMetaData();
      QVariant value = m_player->metaData(data);
      

      What I want now is to edit the metadata value in my table view column and save it back in the .mp3.

      QMediaObject has a metadata changed signal but I am not sure when and how it is emitted.

      Did I miss any setMetadata(QString value) in QMediaPlayer?

      Is it even possible to edit and save the metadata back to .mp3? If yes, how?

      Pl45m4P Offline
      Pl45m4P Offline
      Pl45m4
      wrote on last edited by
      #2

      @MarKS

      Have a look at QMetaDataWriterControl. It has setMetaData.

      • https://doc.qt.io/qt-5/qmetadatawritercontrol.html#setMetaData
      • https://doc.qt.io/qt-5/qmetadatawritercontrol.html

      This whole class is deprecated, but it shows, that it's definitely possible to do in Qt... but I can't say what to use instead.


      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      MarKSM 1 Reply Last reply
      2
      • Pl45m4P Pl45m4

        @MarKS

        Have a look at QMetaDataWriterControl. It has setMetaData.

        • https://doc.qt.io/qt-5/qmetadatawritercontrol.html#setMetaData
        • https://doc.qt.io/qt-5/qmetadatawritercontrol.html

        This whole class is deprecated, but it shows, that it's definitely possible to do in Qt... but I can't say what to use instead.

        MarKSM Offline
        MarKSM Offline
        MarKS
        wrote on last edited by
        #3

        @Pl45m4 thanks! This is a good find. The documentation states it is obsolete but didn't mention any alternatives. Does it mean they removed this feature from QtMultimedia?

        Pl45m4P 1 Reply Last reply
        0
        • MarKSM MarKS

          @Pl45m4 thanks! This is a good find. The documentation states it is obsolete but didn't mention any alternatives. Does it mean they removed this feature from QtMultimedia?

          Pl45m4P Offline
          Pl45m4P Offline
          Pl45m4
          wrote on last edited by
          #4

          @MarKS

          Don't know :)
          Haven't used it myself, so I can't say more.

          Can't imagine that they remove features completely. There might be another class that does something similar or there are other workarounds.

          Unfortunately the Qt Documentation doesn't always tell what to use instead when there is an obsolete class.


          If debugging is the process of removing software bugs, then programming must be the process of putting them in.

          ~E. W. Dijkstra

          1 Reply Last reply
          0
          • B Offline
            B Offline
            Bonnie
            wrote on last edited by Bonnie
            #5

            As you can see from the doc, QMetaDataWriterControl is an abstract class, most of its functions are virtual.
            It is just an interface class and the functions need to be implemented by the media plugins.
            And from Qt Multimedia Backends you can see that "MetaData writer" is not a feature of media player, but recording. And it is only supported by the GStreamer plugin on Unix platform.
            There's QMediaRecorder::setMetaData(...) which would probably try to use this interface internally. So it's not for QMediaPlayer I think.

            1 Reply Last reply
            3
            • G Offline
              G Offline
              Grisa
              Banned
              wrote last edited by
              #6
              This post is deleted!
              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