简体   繁体   English

如何使用 ffmpeg 从 mp3 中删除 ID3 音频标签图像(或元数据)

[英]How to remove ID3 audio tag image (or metadata) from mp3 with ffmpeg

FFMPEG is really a great tool. FFMPEG 真的是一个很棒的工具。 I know it can edit ID3 tags and even remove all tags in a row :我知道它可以编辑 ID3 标签,甚至可以连续删除所有标签:

ffmpeg -i tagged.mp3 -map_metadata -1 untagged.mp3

But even after that, there's still the cover image.但即使在那之后,仍然有封面图片。

I don't know how to remove it using ffmpeg.我不知道如何使用 ffmpeg 删除它。 I know there's other soft out there that can do the job - like eyed3 - but what's the point to install it if ffmpeg can do it too, in one line, while encoding the audio ?我知道还有其他软件可以完成这项工作 - 比如 eyed3 - 但是如果 ffmpeg 也可以在一行中完成它,那么安装它有什么意义,同时编码音频?

Strip metadata tags and remove album cover image去除元数据标签并删除专辑封面图片

ffmpeg -i input.mp3 -map 0:a -c:a copy -map_metadata -1 output.mp3
  • -map 0:a Includes only audio (omits all images). -map 0:a仅包含音频(省略所有图像)。 See FFmpeg Wiki: Map for more details.有关更多详细信息,请参阅FFmpeg Wiki:地图
  • -c:a copy Enables stream copy mode so re-encoding is avoided. -c:a copy启用流复制模式以避免重新编码。
  • -map_metadata -1 Omits all metadata. -map_metadata -1所有元数据。

I've tried to use codes provided by LordNeckbeard, none of them worked for my case.我尝试使用 LordNeckbeard 提供的代码,但没有一个适用于我的案例。 But this one worked:但是这个有效:

ffmpeg -i tagged.mp3 -acodec copy -map 0 -map_metadata 0:s:0 notags.mp3

It shows now only one tag, 'TSSE' (means Encoder).它现在只显示一个标签,“TSSE”(表示编码器)。 Also, very recommend this article, if you want to manipulate ID3 tags using ffmpeg:另外,非常推荐这篇文章,如果你想使用 ffmpeg 操作 ID3 标签:

How To: Create/Write ID3 tags using ffmpeg如何:使用 ffmpeg 创建/写入 ID3 标签

I tried llogan's solution with a small castle.mp3 file and found out that its size increased from 4448 to 4797 bytes!我用一个小的Castle.mp3文件尝试了 llogan 的解决方案,发现它的大小从 4448 字节增加到 4797 字节! Further inspection in Audacity revealed that the signal has been slightly "delayed" as well - however the length of the file [ castle2.mp3 ] remained the same.在 Audacity 中进一步检查发现信号也稍微“延迟”了 - 但是文件 [ Castle2.mp3 ] 的长度保持不变。

在此处输入图片说明

After that, I used id3v2 -D castle.mp3 to delete all mp3 tags from the file, and the filesize went down to 4320 bytes, with no other noticeable (undesired) changes.之后,我使用id3v2 -D castle.mp3从文件中删除了所有 mp3 标签,文件大小下降到 4320 字节,没有其他明显(不需要的)变化。

以上都不对我有用,但以下方法对我有用:

ffmpeg -i tagged.mp3 -write_xing 0 -id3v2_version 0 untagged.mp3

I try something like : 我尝试类似的东西:

ffmpeg -i file.mp3 -ab 128k -ac 2 -ar 44100 -map 0:a -map_metadata -1 -sn -vn -y output.mp3

and have always cover on output. 并始终覆盖输出。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM