Extract All Attachments from MKV Using FFmpeg
Matroska (MKV) files often contain embedded attachments such as subtitle fonts, cover art, or lyrics. This article provides a quick and direct guide on how to extract all of these attachments from an MKV file simultaneously using a single FFmpeg command line.
To extract all embedded attachments from an MKV file at once, run the following command in your terminal or command prompt:
ffmpeg -dump_attachment:t "" -i input.mkv -f null -Command Breakdown
-dump_attachment:t "": This is the core flag that tells FFmpeg to extract the attachments.- The
:tspecifier targets all attachment streams. - The empty quotes
""instruct FFmpeg to use the original filenames stored within the MKV metadata for the extracted files.
- The
-i input.mkv: Specifies your input MKV file. Replaceinput.mkvwith the actual path to your file.-f null -: Since FFmpeg typically expects an output video or audio file, this flag redirects the standard output to a “null” muxer. This allows the command to run and extract the attachments without creating an unwanted duplicate video file.
Once executed, all attachments (such as .ttf,
.otf, or .jpg files) will be saved directly
into your current working directory.