FFmpeg 中有哪些命令可用于用我自己的数据填充 MP3 元数据?
例如,目前我正在使用 ffmpeg 将音频文件从 MP3 (320k) 编码为 MP3 (128k)。
这些是我的元数据命令:
commandList.add("-i");
commandList.add(coverPath);
commandList.add("-c");
commandList.add("copy");
commandList.add("-map");
commandList.add("0");
commandList.add("-map");
commandList.add("1");
commandList.add("-id3v2_version");
commandList.add("3");
commandList.add("-write_id3v1");
commandList.add("1");
commandList.add("-metadata:s:v");
commandList.add("title=\"Album cover\"");
commandList.add("-metadata:s:v");
commandList.add("comment=\"Cover (Front)\"");
我的问题是:
现在我想补充一点:
-metadata [Encoder] && [Encoded by] && [Published by]
但我不知道正确的命令。我在哪里可以找到它们?我似乎无法在FFmpeg 文档。
答案1
根据MP3 元数据部分在多媒体维基上:
FFmpeg 的 MP3 复用器会创建与 v2.3 或 v2.4 兼容的 ID3v2 标签。复用器会遵循以下元数据键。
以下是列表;我稍微重新格式化了一下以适应此 Stack Exchange 网站上的格式:
+---------------------+-----------+
| FFmpeg metadata tag | ID3v2 tag |
+---------------------+-----------+
| "album" | TALB |
| "composer" | TCOM |
| "genre" | TCON |
| "copyright" | TCOP |
| "encoded_by" | TENC |
| "title" | TIT2 |
| "language" | TLAN |
| "artist" | TPE1 |
| "album_artist" | TPE2 |
| "performer" | TPE3 |
| "disc" | TPOS |
| "publisher" | TPUB |
| "track" | TRCK |
| "encoder" | TSSE |
| "lyrics" | TSLT |
+---------------------+-----------+
此外,查看这个 GitHub 镜像的FFmpeg 官方源代码存储库。我挖掘了一下,发现这些与 ID3 相关的项目/地图可能对您的目的有用:
const AVMetadataConv ff_id3v2_34_metadata_conv[] = {
{ "TALB", "album" },
{ "TCOM", "composer" },
{ "TCON", "genre" },
{ "TCOP", "copyright" },
{ "TENC", "encoded_by" },
{ "TIT2", "title" },
{ "TLAN", "language" },
{ "TPE1", "artist" },
{ "TPE2", "album_artist" },
{ "TPE3", "performer" },
{ "TPOS", "disc" },
{ "TPUB", "publisher" },
{ "TRCK", "track" },
{ "TSSE", "encoder" },
{ "USLT", "lyrics" },
{ 0 }
};
const AVMetadataConv ff_id3v2_4_metadata_conv[] = {
{ "TCMP", "compilation" },
{ "TDRC", "date" },
{ "TDRL", "date" },
{ "TDEN", "creation_time" },
{ "TSOA", "album-sort" },
{ "TSOP", "artist-sort" },
{ "TSOT", "title-sort" },
{ 0 }
};
static const AVMetadataConv id3v2_2_metadata_conv[] = {
{ "TAL", "album" },
{ "TCO", "genre" },
{ "TCP", "compilation" },
{ "TT2", "title" },
{ "TEN", "encoded_by" },
{ "TP1", "artist" },
{ "TP2", "album_artist" },
{ "TP3", "performer" },
{ "TRK", "track" },
{ 0 }
};