Qt 6.2.0 / Ubuntu 20.04.
I want to read the title tag from a mkv video file. So at first I'm trying to retrieve all the available tags:
QMediaPlayer p;
p.setSource(QUrl::fromLocalFile(dir.absolutePath()));
QMediaMetaData metadata = p.metaData();
QList<QMediaMetaData::Key> keys = metadata.keys();
foreach (QMediaMetaData::Key key, keys)
{
qDebug() << key;
}
The list is empty. I'm aware the docs say:
Not all identifiers are supported on all platforms
But I cannot believe no one metadata is there! The title tag is surely there because, say, VLC reads it correctly. Is my approach wrong?
Here it seems QMediaPlayer
needs some time to extract the tags. Is there a different approach that avoid this waste of time?
The goal is to extract the title
(or other info) from hundreds of video files so I cannot wait so long for each one.