How to Add Album Art to MP3 Using FFmpeg

Adding cover art to your MP3 files makes your music library visually appealing and compatible with modern media players. This guide provides a straightforward tutorial on how to use FFmpeg, a powerful command-line tool, to embed an album cover image directly into an MP3 audio file. You will learn the exact command-line syntax required to merge your audio and image files seamlessly without losing audio quality.

The Basic Command

To attach a JPEG or PNG image to an MP3 file as album art, open your terminal or command prompt and run the following command:

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

Command Breakdown

Understanding what each parameter does helps you customize the process:

Batch Processing Multiple Files

If you have a folder of MP3 files and want to apply the same cover.jpg to all of them, you can automate the process using a simple command-line loop.

For Windows (Command Prompt):

for %i in (*.mp3) do ffmpeg -i "%i" -i cover.jpg -map 0:a -map 1:v -c copy -id3v2_version 3 -metadata:s:v title="Album cover" -metadata:s:v comment="Cover (front)" "tagged_%i"

For macOS and Linux (Terminal):

for f in *.mp3; do ffmpeg -i "$f" -i cover.jpg -map 0:a -map 1:v -c copy -id3v2_version 3 -metadata:s:v title="Album cover" -metadata:s:v comment="Cover (front)" "tagged_$f"; done

These loops will process every MP3 file in the directory and output a new version prefixed with “tagged_”, leaving your original files untouched.