How to Add Album Cover to FLAC Using FFmpeg

Adding cover art to your music files makes your digital library visually appealing and ensures that media players display the correct artwork during playback. This guide provides a straightforward, step-by-step tutorial on how to use the powerful command-line tool FFmpeg to embed an album cover image (such as a JPEG or PNG) directly into a FLAC audio file without re-encoding the audio.

The Basic Command

To attach an image to a FLAC file, you need your original audio file (e.g., input.flac) and the image file (e.g., cover.jpg). Run the following command in your terminal or command prompt:

ffmpeg -i input.flac -i cover.jpg -map 0:a -map 1:v -c copy -metadata:s:v title="Album cover" -metadata:s:v comment="Cover (front)" output.flac

How the Command Works

Verifying the Output

Once the process is complete, you can verify that the image was successfully embedded by playing the output.flac file in a media player like VLC, Foobar2000, or MusicBee. Alternatively, you can use FFmpeg to inspect the metadata of the new file by running:

ffprobe output.flac

This command will list the streams inside the file, showing both the flac audio stream and a mjpeg or png video stream representing the attached cover art.