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.jpgHow the Command Works
-i input.m4a: Specifies the input M4A audio file. Replaceinput.m4awith the path to your specific file.-an: Disables the audio track. Since you only want to extract the image, this parameter tells FFmpeg to ignore the audio stream.-c:v copy: Instructs FFmpeg to copy the video stream (which holds the embedded cover art) exactly as it is, without re-encoding. This ensures the output image retains its original quality and the process completes instantly.cover.jpg: The name and format of the output image file.
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.m4aLook 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