Is there any way to embed cover art to m4a
files?
This one works well for mp3
but doesn\'t work for m4a
ffmpeg
A little bit extended version for embedding album art with atomicparsley
. Tested on Mac OS X. It assumes there is folder.jpg
file in the current directory. AtomicParsley creates temp files with embedded media in the same folder. There is a flag --overWrite
which is supposed to change this behavior, but for some reason this doesn't work for me. So we will need to remove the original files afterwards. Note, that the script will remove all the files which do not coontain temp
in their filename. So be cautious (or modify the script). Finally, the script renames newly created files to remove -temp-
part from their filenames.
for f in *.m4a
do
atomicparsley "$f" --artwork folder.jpg
done
rm !(*temp*)
for f in *.m4a
do
g=${f//-temp*./.}
mv "$f" "$g"
done
It is possible with ffmpeg by specifying the attached_pic
attribute on the image source via the -disposition
parameter.
ffmpeg -i input.m4a -i image.jpg -map 0 -map 1 -c copy -disposition:v:1 attached_pic output.m4a
Tested with ffmpeg 4.2.2.
A similar command is also given as an example in the ffmpeg docs, however be careful that the example is for adding covers to videos but not audio files. The -disposition
parameter fails silently if the wrong stream is selected.
FFmpeg has an open issue on this functionality. In the meantime, covers can be added with the TagEditor project. To add:
tageditor -s cover=ju.jpg --max-padding 100000 -f ki.m4a
To remove:
tageditor -s cover= --max-padding 100000 -f ki.m4a
mp4art
from mp4v2
can also do this:
mp4art --add cover.jpg track.m4a
I tried mp4art, after adding the cover, the information from FFmpeg is like this:
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fce82011400] stream 0, timescale not set
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '01 - Welcome To New York.m4a':
Metadata:
major_brand : M4A
minor_version : 512
compatible_brands: isomiso2
title : Welcome To New York
artist : Taylor Swift
album : 1989 (Deluxe)
date : 2014
encoder : Lavf55.48.100
genre : Country & Folk
track : 1
disc : 1
Duration: 00:03:32.65, start: 0.046444, bitrate: 250 kb/s
Stream #0:0(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 238 kb/s (default)
Metadata:
handler_name : SoundHandler
Stream #0:1: Video: mjpeg, yuvj444p(pc, bt470bg), 1400x1400 [SAR 72:72 DAR 1:1], 90k tbr, 90k tbn, 90k tbc
Input #1, image2, from 'Album Cover.jpg':
Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
Stream #1:0: Video: mjpeg, yuvj444p(pc, bt470bg), 1400x1400 [SAR 72:72 DAR 1:1], 25 tbr, 25 tbn, 25 tbc
It seems that 1 file has 2 input formats (1 m4a, 1 image2), I think ffmpeg should be able to do the same thing by itself instead of using a separate tool to add cover image, but I haven't figure out how.