Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
832 views
in Technique[技术] by (71.8m points)

aac - FFmpeg, how to embed cover art (image) to .m4a

Is there any way to embed cover art to m4a files?

This one works well for mp3 but doesn't work for m4a

ffmpeg -i tests/in.m4a -i cover.jpg -map 0:0 -map 1:0 -acodec copy 
  -id3v2_version 3 tests/out.m4a
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...