简体   繁体   English

如何阻止 ffmpeg 操纵 mp3 元数据?

[英]How to stop ffmpeg from manipulating mp3 metadata?

I'm using ffmpeg to change bitrate of my mp3 files.我正在使用 ffmpeg 来更改我的 mp3 文件的比特率。 It works well, but one thing is very frustrating.它运作良好,但有一件事非常令人沮丧。

ffmpeg automatically changes some of metadata fields. ffmpeg 会自动更改一些元数据字段。 Specifically it converts ID3v2.3 to ID3v2.4, and it does it incorrectly.具体来说,它将 ID3v2.3 转换为 ID3v2.4,但它做错了。 For example, it writes TYER field that actually does not exist in ID3v2.4.例如,它写入了TYER中实际不存在的 TYER 字段。 But the most frustrating thing is, it converts USLT field to lyrics-LANGCODE (like lyrics-eng ).但最令人沮丧的是,它将USLT字段转换为lyrics-LANGCODE (如lyrics-eng )。 Most of music players does not recognise this tag!大多数音乐播放器不识别此标签!

I don't want ffmpeg to mess up with metadata fields.我不希望 ffmpeg 弄乱元数据字段。 I just want it to change bitrate.我只是想让它改变比特率。 Is there anyway to tell ffmpeg that it should not touch any metadata fields?有没有告诉 ffmpeg 它不应该触及任何元数据字段?

I'm running ffmpeg 4.0.2 in windows 64bit.我在 Windows 64 位上运行 ffmpeg 4.0.2。 Options are:选项是:

ffmpeg -i input.mp3 -codec:a libmp3lame -b:a 128k output.mp3

And no, -id3v2_version 3 did not help.不, -id3v2_version 3没有帮助。 It corrected TYER problem, but not lyrics problem.它纠正了TYER问题,但不是歌词问题。

I couldn't solve the lyrics problem with ffmpeg but was able to copy lyrics from the LYRICS-ENG metadata field to the USLT field.我无法用ffmpeg解决歌词问题,但能够将歌词从LYRICS-ENG元数据字段复制到USLT字段。
I used the Mp3tag tool for batch copying of the data.我使用Mp3tag工具批量复制数据。
It has the Actions feature for batch operations.它具有用于批处理操作的操作功能。

What I did:我做了什么:

  • Actions -> Actions动作 -> 动作
  • New -> New -> Format value新建 -> 新建 -> 格式值
  • "Field": UNSYNCEDLYRICS, "Format string": %LYRICS-ENG% “字段”:UNSYNCEDLYRICS,“格式字符串”:%LYRICS-ENG%
  • Navigate to a folder with the files, select them and execute the created action导航到包含文件的文件夹,选择它们并执行创建的操作

I used a mix between ffmpeg and the first answer to this question: I first convert a full folder of files thanks to the cmd loop below (in this case converting .flac files to .mp3).我在 ffmpeg 和这个问题的第一个答案之间混合使用:由于下面的 cmd 循环,我首先转换了一个完整的文件文件夹(在这种情况下将 .flac 文件转换为 .mp3)。 Right now I am changing the bitrate of my entire iTunes library so that it takes less place, and ffmpeg does indeed change the tag of the lyrics.现在我正在改变我整个 iTunes 资料库的比特率,以减少它的位置,而 ffmpeg 确实改变了歌词的标签。 But using mp3tag and creating this action allows me to switch them back to a tag that iTunes knows.但是使用 mp3tag 并创建此操作允许我将它们切换回 iTunes 知道的标签。 This is a very quick way of doing it, and I was searching for it for a very long time !这是一种非常快速的方法,我找了很长时间!

FOR /F "tokens=*" %G IN ('dir /b *.flac') DO ffmpeg -i "%G" -ab 320k -acodec mp3 "3%~nG.mp3"

i am pretty sure i have found a way to do fix the problem with the lyrics...我很确定我已经找到了解决歌词问题的方法...

$ ffmpeg -i input.mp3 ... -metadata "lyrics-eng=" -metadata "unsyncedlyrics=eng||{lyrics}" output.mp3

the -metadata "lyrics-eng=" prevents the incorrect metadata to be set, while -metadata "unsyncedlyrics=eng||{lyrics}" sets the correct metadata, hope that helps! -metadata "lyrics-eng="防止设置不正确的元数据,而-metadata "unsyncedlyrics=eng||{lyrics}"设置正确的元数据,希望有帮助!

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

相关问题 如何使icecast从ffmpeg中继mp3 stream的元数据? - How to make icecast relay the metadata of mp3 stream from ffmpeg? 从带有专辑封面的 ffmpeg 管道传输时,mp3 中的元数据不起作用 - Metadata in mp3 not working when piping from ffmpeg with album art 如何使用 ffmpeg 从 mp3 中删除 ID3 音频标签图像(或元数据) - How to remove ID3 audio tag image (or metadata) from mp3 with ffmpeg 如何使用 FFmpeg 从 .mp3 文件中获取元数据并将其作为文本放入视频中? - How to take metadata from .mp3 file and put it to a video as a text using FFmpeg? ffmpeg如何从mp3文件中提取音频数据? - How does ffmpeg extract audio data from mp3 files? 如何使用 ffmpeg 从 MP3 文件中删除“写入库”? - How to remove "wrting library" from an MP3 file using ffmpeg? ffmpeg如何计算从webm到mp3的大小而无需转换 - ffmpeg how to calculate size from webm to mp3 without conversion 无法使用 ffmpeg 将评论元数据提供给 MP3 文件 - Can't give metadata of comment to MP3 file using ffmpeg 使用ffmpeg将.flac转换为.mp3,并保留所有元数据 - Convert .flac to .mp3 with ffmpeg, keeping all metadata FFMPEG:如何使用FFMPEG将附件图片(APIC)从源mp3文件转码为目标mp3文件? - FFMPEG : How to transcode Attached Picture (APIC) from source mp3 file to destination mp3 file using FFMPEG?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM