ChinaFFmpeg

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 18827|回复: 2

[Linux] mp3中加入图片信息

[复制链接]
发表于 2014-11-7 15:55:28 | 显示全部楼层 |阅读模式
研究了一下mp3加入图片信息,和大家分享一下。
(1)对mp3加入图片理论了解可以参考ID3的介绍。http://baike.baidu.com/view/66078.htm?fr=aladdin

(2)命令直接把ffmpeg官网一部分复制过来,讲的挺详细
The MP3 muxer writes a raw MP3 stream with the following optional features:
  • An ID3v2 metadata header at the beginning (enabled by default). Versions 2.3 and 2.4 are supported, the id3v2_version private option controls which one is used (3 or 4). Setting id3v2_version to 0 disables the ID3v2 header completely.
    The muxer supports writing attached pictures (APIC frames) to the ID3v2 header. The pictures are supplied to the muxer in form of a video stream with a single packet. There can be any number of those streams, each will correspond to a single APIC frame. The stream metadata tags title and comment map to APIC description and picture type respectively. See http://id3.org/id3v2.4.0-frames for allowed picture types.
    Note that the APIC frames must be written at the beginning, so the muxer will buffer the audio frames until it gets all the pictures. It is therefore advised to provide the pictures as soon as possible to avoid excessive buffering.
  • A Xing/LAME frame right after the ID3v2 header (if present). It is enabled by default, but will be written only if the output is seekable. The write_xing private option can be used to disable it. The frame contains various information that may be useful to the decoder, like the audio duration or encoder delay.
  • A legacy ID3v1 tag at the end of the file (disabled by default). It may be enabled with the write_id3v1 private option, but as its capabilities are very limited, its usage is not recommended.
Examples:
Write an mp3 with an ID3v2.3 header and an ID3v1 footer:
ffmpeg -i INPUT -id3v2_version 3 -write_id3v1 1 out.mp3
To attach a picture to an mp3 file select both the audio and the picture stream with map:
ffmpeg -i input.mp3 -i cover.png -c copy -map 0 -map 1-metadata:s:v title="Album cover" -metadata:s:v comment="Cover (Front)" out.mp3
回复

使用道具 举报

发表于 2018-1-31 17:28:25 | 显示全部楼层
墙裂顶起
回复

使用道具 举报

发表于 2018-4-10 13:22:03 | 显示全部楼层
如果是MP4怎么加啊?
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|Archiver|ChinaFFmpeg

GMT+8, 2024-12-27 12:01 , Processed in 0.050139 second(s), 14 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表