class QMediaMetaData

Provides meta-data for media files. More

Added in version 6.1.

Synopsis

Methods

Static functions

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

Detailed Description

Note

Not all identifiers are supported on all platforms.

Common attributes

Value

Description

Type

Title

The title of the media.

QString

Author

The authors of the media.

QStringList

Comment

A user comment about the media.

QString

Description

A description of the media.

QString

Genre

The genre of the media.

QStringList

Date

The date of the media.

QDateTime.

Language

The language of media.

QLocale::Language

Publisher

The publisher of the media.

QString

Copyright

The media’s copyright notice.

QString

Url

A Url pointing to the origin of the media.

QUrl

Media attributes

MediaType

The type of the media (audio, video, etc).

QString

FileFormat

The file format of the media.

FileFormat

Duration

The duration in milliseconds of the media.

qint64

Audio attributes

AudioBitRate

The bit rate of the media’s audio stream in bits per second.

int

AudioCodec

The codec of the media’s audio stream.

AudioCodec

Video attributes

VideoFrameRate

The frame rate of the media’s video stream.

qreal

VideoBitRate

The bit rate of the media’s video stream in bits per second.

int

VideoCodec

The codec of the media’s video stream.

VideoCodec

HasHdrContent

True if video is intended for HDR display (FFmpeg and Darwin media backends only).

bool

Music attributes

AlbumTitle

The title of the album the media belongs to.

QString

AlbumArtist

The principal artist of the album the media belongs to.

QString

ContributingArtist

The artists contributing to the media.

QStringList

TrackNumber

The track number of the media.

int

Composer

The composer of the media.

QStringList

LeadPerformer

The lead performer in the media.

QStringList

ThumbnailImage

An embedded thumbnail image if present in metadata.

QImage

CoverArtImage

An embedded cover art image.

QImage

Image and video attributes

Orientation

The rotation angle of an image or video.

int

Resolution

The dimensions of an image or video.

QSize

class Key

The following meta data keys can be used:

Constant

Description

QMediaMetaData.Title

Media title

QMediaMetaData.Author

Media author

QMediaMetaData.Comment

Comment

QMediaMetaData.Description

Brief desripttion

QMediaMetaData.Genre

Genre the media belongs to

QMediaMetaData.Date

Creation date

QMediaMetaData.Language

Media language

QMediaMetaData.Publisher

Media publisher info.

QMediaMetaData.Copyright

Media copyright info.

QMediaMetaData.Url

Publisher’s website URL

QMediaMetaData.Duration

Media playback duration

QMediaMetaData.MediaType

Type of the media

QMediaMetaData.FileFormat

File format

QMediaMetaData.AudioBitRate

QMediaMetaData.AudioCodec

QMediaMetaData.VideoBitRate

QMediaMetaData.VideoCodec

QMediaMetaData.VideoFrameRate

QMediaMetaData.AlbumTitle

Album’s title

QMediaMetaData.AlbumArtist

Artist’s info.

QMediaMetaData.ContributingArtist

QMediaMetaData.TrackNumber

QMediaMetaData.Composer

Media composer’s info.

QMediaMetaData.LeadPerformer

QMediaMetaData.ThumbnailImage

Media thumbnail image (if embedded in metadata)

QMediaMetaData.CoverArtImage

Media cover art

QMediaMetaData.Orientation

QMediaMetaData.Resolution

QMediaMetaData.HasHdrContent

Video may have HDR content (read only, FFmpeg and Darwin media backends only)

PySide6.QtMultimedia.QMediaMetaData.NumMetaData
PySide6.QtMultimedia.QMediaMetaData.data
clear()

Removes all data from the meta data object.

insert(k, value)
Parameters:
  • kKey

  • value – object

Inserts a value into a Key: k.

isEmpty()
Return type:

bool

Returns true if the meta data contains no items: otherwise returns false.

static keyType(key)
Parameters:

keyKey

Return type:

QMetaType

Returns the meta type used to store data for Key key.

keys()
Return type:

.list of QMediaMetaData.Key

Returns a QList of QMediaMetaData::Keys.

static metaDataKeyToString(k)
Parameters:

kKey

Return type:

str

returns a string representation of key that can be used when presenting meta data to users.

__ne__(b)
Parameters:

bQMediaMetaData

Return type:

bool

Compares two meta data objects a and b, and returns false if they are identical or true if they differ.

__eq__(b)
Parameters:

bQMediaMetaData

Return type:

bool

Compares two meta data objects a and b, and returns true if they are identical or false if they differ.

operator(k)
Parameters:

kKey

Return type:

object

Returns data stored at the Key k.

QMediaMetaData rockBallad1;
rockBalad[QMediaMetaData::Genre]="Rock"
remove(k)
Parameters:

kKey

Removes meta data from a Key: k.

stringValue(k)
Parameters:

kKey

Return type:

str

Returns the meta data for key key as a QString.

This is mainly meant to simplify presenting the meta data to a user.

value(k)
Parameters:

kKey

Return type:

object

Returns the meta data value for Key key, or a null QVariant if no meta data for the key is available.