linux - 使用命令行工具从 ID3 标签获取特定字段?

标签 linux shell mp3 id3

我正在寻找一种方法,让我从 mp3 文件的 ID3 标签中获取特定字段。

到目前为止,我发现的所有工具都会返回所有 字段,并且它们还会对它们进行格式化以便“更容易阅读”。我只需要一些字段,并且格式不同 (artist\talbum\ttitle\n) 以用于报告目的。

有这样的工具吗?我喜欢可以让我分别输出 ID3v1 和 ID3v2 值的工具。

最佳答案

id3v2 -R 听起来就像您想要的那样。 Debian 包名称是 id3v2,上游是 http://id3v2.sourceforge.net/

来自手册页:

   -R, --list-rfc822
          Lists using an rfc822-style format for output

例子:

$ id3v2 -R 365-Days-Project-04-26-sprinkle-leland-w-the-great-stalacpipe-organ.mp3 

Filename: 365-Days-Project-04-26-sprinkle-leland-w-the-great-stalacpipe-organ.mp3
TALB: Released independently through Luray Caverns
TPE1: Leland W. Sprinkle
TIT2: The Great Stalacpipe Organ
COMM: ()[eng]: � 2004, Copyright resides with the artist, The 365 Days Project,  and UbuWeb (http://ubu.com) / PennSound (http://www.writing.upenn.edu/pennsound/). All materials at UbuWeb / PennSound are available for free exchange for noncommerical purposes.
365-Days-Project-04-26-sprinkle-leland-w-the-great-stalacpipe-organ.mp3: No ID3v1 tag

关于linux - 使用命令行工具从 ID3 标签获取特定字段?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4539026/

相关文章:

c - 打印输出时如何保持stdin和stdout分开?

分配了哈希值的 bash 变量

.net - 在.NET CF上播放PCM音频流

java - 从 mp3 文件中读取标签

linux - 将多个 gif 转换为单个 eps

c++ - g++命令中 ".map"文件有什么用?

linux - 如何使用共享内存来共享程序中的数据

linux - 实现 bash shell getops 代码

objective-c - 你如何使用 cocoa/objective c 读取/写入/更新 m4u 和 mp3 文件元数据?

c++ - 系统调用在 rsync 完成之前返回