MetadataTags
Represents descriptive (non-technical) metadata about a media file, such as title, author, date, cover art, or other attached files. Common tags are normalized by Mediabunny into a uniform format, while theraw field can be used to directly read or write the underlying metadata tags (which differ by format).
Common Fields
string
Title of the media (e.g., “Gangnam Style”, “Titanic”).
string
Short description or subtitle of the media.
string
Primary artist(s) or creator(s) of the work.
string
Album, collection, or compilation the media belongs to.
string
Main credited artist for the album/collection as a whole.
number
Position of this track within its album or collection (1-based).
number
Total number of tracks in the album or collection.
number
Disc index if the release spans multiple discs (1-based).
number
Total number of discs in the release.
string
Genre or category describing the media’s style or content (e.g., “Metal”, “Horror”).
Date
Release, recording or creation date of the media.
string
Full text lyrics or transcript associated with the media.
string
Freeform notes, remarks or commentary about the media.
AttachedImage[]
Embedded images such as cover art, booklet scans, artwork or preview frames.
Raw Format-Specific Metadata
Record<string, string | Uint8Array | RichImageData | AttachedFile | null>
The raw, underlying metadata tags. This field can be used for both reading and writing.The format of these tags differs per format:
- MP4/QuickTime: Keys refer to atom names in the
'ilst'atom, or keys from the'keys'atom - WebM/Matroska:
SimpleTagelements with target 50 (MOVIE) - MP3/ADTS: ID3v2 tags
- Ogg: Vorbis-style comment header key-value pairs
- WAVE: Individual chunks within the RIFF INFO chunk
- FLAC: Vorbis-style comment block key-value pairs
- MPEG-TS: Not supported
AttachedImage
An embedded image such as cover art, booklet scan, artwork or preview frame.Uint8Array
The raw image data.
string
An RFC 6838 MIME type (e.g.,
'image/jpeg', 'image/png').'coverFront' | 'coverBack' | 'unknown'
The kind or purpose of the image.
string
The name of the image file.
string
A description of the image.
RichImageData
Image data with additional metadata. Used in raw metadata fields.Uint8Array
required
The raw image data.
string
required
An RFC 6838 MIME type (e.g.,
'image/jpeg', 'image/png').AttachedFile
A file attached to a media file (e.g., fonts, subtitle files).Uint8Array
required
The raw file data.
string
An RFC 6838 MIME type (e.g.,
'font/ttf', 'application/x-subrip').string
The name of the file.
string
A description of the file.
TrackDisposition
Specifies a track’s disposition, i.e. information about its intended usage.boolean
Indicates that this track is eligible for automatic selection by a player; that it is the main track among other, non-default tracks of the same type.
boolean
Indicates that players should always display this track by default, even if it goes against the user’s default preferences. For example, a subtitle track only containing translations of foreign-language audio.
boolean
Indicates that this track is in the content’s original language.
boolean
Indicates that this track contains commentary.
boolean
Indicates that this track is intended for hearing-impaired users.
boolean
Indicates that this track is intended for visually-impaired users.
Examples
Reading metadata
Writing metadata
Format-specific raw metadata
See also
- Reading metadata guide - Complete guide to working with metadata
- Input.getMetadataTags() - Read metadata from files
- Output.setMetadataTags() - Write metadata to files