An attached picture is an image that comes with something else, such as a photo in an email. In an audio or video file, an attached picture is an image stored inside the file itself. A typical example is the cover art of an album or a single.
Attached Pic is the field that marks such a picture in a metadata report. The name comes from ffprobe, the file reader of the FFmpeg project, which writes it as attached_pic.
FFmpeg lists each part of a file as a separate stream. It gives every stream a set of flags, called the disposition. Each flag is either on or off, and Attached Pic is one of these flags.
What the values look like
The -show_streams option of the ffprobe reader prints the flag for every stream, even in files without an attached picture. The flag has 2 values in that output:
0: the stream is not an attached picture, for example an ordinary audio or video stream1: the stream holds an attached picture, such as the cover of an album
The short overview that FFmpeg prints for a file shows the same flag as (attached pic). FFmpeg prints this label only when the flag is on.
Which files carry it
FFmpeg treats an attached picture as a video stream with a single image. So a song with cover art can report 2 streams: one for the sound and one for the picture. The codec type of the picture stream is video, although the picture never moves.
FFmpeg reads the picture from a different place in each format:
- MP3: an APIC frame in the ID3v2 tag, which the ID3v2 standard calls Attached picture
- M4A and MP4: the
covritem, which ExifTool callsCoverArt - FLAC: a picture block, and one file can hold several of these blocks
- MKV: an attachment with an image type, such as a file named
cover.jpgorcover.png
Photos and e-books keep their pictures in other fields. A JPEG photo can store a small preview in its Thumbnail Image field. An EPUB e-book marks at most one image file as its cover.
Where the value comes from
The file itself does not contain a field called Attached Pic. FFmpeg turns the flag on when it finds a picture frame, a picture block, or an image attachment.
For MP3 and FLAC files, FFmpeg also copies the picture description into the title tag. It copies the picture type into the comment tag.
The picture type is a number from 0 to 20 that says what the picture shows. FFmpeg writes the type as text, for example:
- Type 0,
Other: a picture that fits none of the other types - Type 3,
Cover (front): the front cover, which many players show during playback - Type 4: the back cover
- Type 6: the media itself, for example the label side of a CD
FFmpeg can write an embedded picture into only some of the formats it supports. For the picture itself, the ID3v2 standard and the Matroska specification both recommend JPEG and PNG.
Why it matters
The flag tells software that the stream is a picture and not a moving video. In FFmpeg commands, the stream selector V picks only video streams that are not attached pictures.
The picture data sits inside the file, so a large cover makes the whole file larger. A picture can also show more than a cover, such as the performer or the recording location.
A picture frame or a picture block can also hold a link to an image outside the file. For FLAC files, the specification says a program must ask you before it loads that image over a network.