Skip to content
Novus Examples
mkv25.9 KB

Embedded Metadata — File Attachment (MKV)

A Matroska attachment: a whole file carried inside the container alongside the media, with its own filename and MIME type. In the wild this is how fonts travel with styled ASS subtitles, so that a rendering machine lacking the typeface still gets the right result. Extract it with `ffmpeg -dump_attachment:t:0 out.txt -i …`. Unlike the MP4 cover art in this group, an attachment is not a media stream — it demuxes as `codec_type=attachment` and has no frames, which is why remuxing to any container without an attachment concept discards it silently. The filename here is deliberately not `cover.jpg`. Matroska's cover-art convention is simply an attachment named `cover.*`, and FFmpeg and most players special-case that name and promote it to an `attached_pic` video stream. So the same bytes attached under two different filenames produce two different stream lists — a genuinely surprising result if you are counting streams to decide what a file contains.

Rendered preview of Embedded Metadata — File Attachment (MKV)

Rendered preview of the mkv file (25.9 KB). Download above for the original.

Specifications

Attachments
1
Attached File
attachment-notes.txt
Attached Mime
text/plain
Stream Type
attachment — not video, not audio
Storage
Matroska Attachments element
Duration
8s

Testing contract

Expected to pass
Scenario
Open the file, enumerate its streams, and extract the attachment.
Expected result
1 Matroska attachment - attachment-notes.txt, MIME text/plain - stored in the Attachments element and reported as stream type `attachment`, which is neither video nor audio. Remuxing to MP4 drops it silently, because MP4 has no attachment concept; that loss is the thing worth asserting on.

What is a .mkv file?

MKV (Matroska) is an open, codec-agnostic multimedia container that holds unlimited video, audio, subtitle, chapter, and attachment tracks in one file. Its structure is EBML, a binary tree of length-prefixed elements, and its attachments typically carry the fonts an ASS subtitle track needs. Because it constrains nothing about the streams inside, the extension says nothing about whether a player can decode them. Steve Lhomme started the project in 2002; WebM is the restricted profile of it that browsers accept.

How to use this file

Use an example MKV to test EBML parsing and multi-track demuxing, subtitle and chapter extraction, and remux pipelines, checking that per-track language and default flags survive, that font attachments are preserved, and that a remux to MP4 reports the tracks MP4 cannot carry instead of dropping them silently.

How to use this file for testing

“Embedded Metadata — File Attachment (MKV)” is a deterministic Novus Examples fixture for Media metadata, Video QA, Conversion testing. Video files with embedded chapters, full container tags, attached cover art and a SMPTE start timecode, each paired with a deliberately stripped twin, so you can tell a metadata reader that found nothing from one that was never given anything.

Documented properties for this file: 8s. Compare results against paired or grouped companions on this page when present (clean↔damaged, searchable↔scanned, or format twins) so scores stay reproducible across runs.

Download the file once, keep the path stable in CI or local scripts, and treat the spec table as the contract: dimensions, seeds, field lists, and roles are intentional. Corrupt or invalid samples are labelled as such, expect parsers to fail loudly rather than silently accept them.

Media fixtures are short and synthetic by design. Prefer waveform or transcript ground truth in the same group when measuring ASR, trim, upscale, or sync tools; do not assume broadcast-quality masters.

Code examples

<video controls preload="metadata" width="640" src="mkv-attachment.mkv"></video>

Generated by generation/video_accessibility.py. Free for any use, no attribution required, license.