How to Extract Cover Art from M4A with FFmpeg

Extracting embedded album artwork from M4A audio files is a quick and straightforward process when using the powerful command-line tool FFmpeg. This guide provides the exact command needed to isolate and save the high-quality cover art image from any M4A file without re-encoding the image.

The Basic Extraction Command

To extract the embedded cover art from an M4A file, open your terminal or command prompt and run the following command:

ffmpeg -i input.m4a -an -c:v copy cover.jpg

How the Command Works

Handling JPEG vs. PNG Formats

Most M4A files use JPEG format for embedded artwork, but some may contain PNG files. If you want to verify the exact image format before extracting, you can inspect the file using ffprobe:

ffprobe input.m4a

Look at the video stream details in the terminal output. If the stream is listed as png, change your output filename in the extraction command to cover.png:

ffmpeg -i input.m4a -an -c:v copy cover.png