How to add Cover Art to an m4a file ?

Started by foremtehan, February 09, 2023, 07:20:27 AM

Previous topic - Next topic

foremtehan

I want to add music cover to an m4a file, I tried:

exiftool -CoverArt=/path/to/cover.jpg file.m4a

But looks like it only add cover as string, How can i embed this cover as binary ?

Thanks.

Phil Harvey

Try this:

exiftool "-CoverArt<=/path/to/cover.jpg" file.m4a

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).


foremtehan

Just one little thing, It has no description i was expecting an "Front Album Cover"

Phil Harvey

The tag is named "CoverArt" in ExifTool.  I'm not sure where you expected a different description.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

foremtehan

By the "description" i meant an title or description on the image itslef

this is an mp3 cover tag with description:

https://i.imgur.com/0v2j0CD.png

this is from above command:

https://i.imgur.com/80WBvoo.png

Phil Harvey

MP3 and M4A are two different beasts.

If you can find an M4A with a description like this, send it to me and I'll take a look to see how it is stored.  My email is philharvey66 at gmail.com

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

StarGeek

I added a cover to a file using Mp3Tag and it an option to set a cover as "Front Cover".  I tried looking for the location of that info with ffprobe and ffmpeg, but neither of them listed it.

It has to be somewhere, as when I reload the file into Mp3Tag, the file shows shows the image as the front cover.  The second image I had added to the file and set to back cover did not save that value and showed up as other.  So the back image value wasn't saved.

Phil, sending you the file I created with Mp3tag.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

Phil Harvey

Thanks StarGeek.

I definitely can't see any text that gives the name of the cover art in that file, but ID3, ASF and FLAC metadata use this lookup for the cover art type:

            0 => 'Other',
            1 => '32x32 PNG Icon',
            2 => 'Other Icon',
            3 => 'Front Cover',
            4 => 'Back Cover',
            5 => 'Leaflet',
            6 => 'Media',
            7 => 'Lead Artist',
            8 => 'Artist',
            9 => 'Conductor',
            10 => 'Band',
            11 => 'Composer',
            12 => 'Lyricist',
            13 => 'Recording Studio or Location',
            14 => 'Recording Session',
            15 => 'Performance',
            16 => 'Capture from Movie or Video',
            17 => 'Bright(ly) Colored Fish',
            18 => 'Illustration',
            19 => 'Band Logo',
            20 => 'Publisher Logo',

So all we need is a "3" stored somewhere for Front Cover.  But I don't see that anywhere either.  Both images are stored in the same QuickTime covr atom, and I see nothing different in the headers.  I'm wondering if Mp3Tag just marks the first image as Front Cover, and all others as Other?

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

StarGeek

Quote from: Phil Harvey on February 09, 2023, 12:54:37 PMI'm wondering if Mp3Tag just marks the first image as Front Cover, and all others as Other?

Yes, this appears to be the case.  I tried setting the front cover to other, closed down Mp3Tag and reopened and the first image was front cover again.

foremtehan, do you have an m4a file that shows a "front cover" and maybe "back cover"?  It may be that it just isn't an option in this case.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

Phil Harvey

You could presumably use ID3 on an M4A file, and that would give you this information, but ID3 sux and ExifTool doesn't write it.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).