Skip to main content
Mediabunny allows you to read and write descriptive metadata tags about media files, such as title, author, date, cover art, and other attached files. Common tags are normalized into a uniform format across different container formats.

Reading metadata tags

You can retrieve metadata tags from an input file:

Available metadata fields

Basic information

Track and disc numbers

Images and cover art

Raw metadata

The raw field contains the underlying metadata tags, which differ by format:
This is useful for:
  • Accessing format-specific metadata that Mediabunny doesn’t normalize
  • Preserving all original metadata when converting files
  • Writing custom metadata tags

Writing metadata tags

You can write metadata tags when creating an output file:
Metadata tags must be set before calling output.start().

Adding cover art

To add cover art or other images to a media file:

Metadata in conversions

When converting files, you can control how metadata is handled:
By default, metadata is copied from input to output:

Format-specific metadata

Metadata is stored differently in each container format:
  • Metadata in 'moov'-level 'udta' and 'meta' atoms
  • raw field contains atom names as keys
  • Values derived from 'data' atom content

Example: Display all metadata

Example: Add metadata to a new file