问题描述
我一直在研究 ID3V2 标签和视频格式,例如 MP4 和 WMV.编辑 ID3V2 标签的两个顶级库似乎是:
I have been doing some research on ID3V2 tags and Video Formats such as MP4 and WMV. The two top libraries for editing ID3V2 tags seem to be:
Entagged 和 Jaudiotagger
Entagged and Jaudiotagger
这两种格式都只支持音频格式.(他们支持 M4A 和 WMA 但不支持 MP4 和 WMV)我猜首先这是为什么?那么他们有没有其他选择.
Both of these support only audio formats. ( They support M4A and WMA but not MP4 and WMV ) I guess first off why is this? Then are they any alternatives.
推荐答案
看来 JID3 可以解决问题.它对扩展没有任何限制.
It appears JID3 will do the trick. It doesn't have any restrictions on extension.
http://jid3.blinkenlights.org/
现在希望有人发现这个开源项目是一个设计师!
Now hopefully someone finds this open-source project a designer!
以下是将其用于多种不同文件格式的示例:
Here is an example of using it with several different file formats:
public class JITExample {
private static MediaFile audioFile;
public static void main(String... megaThrustersAreGo) {
//File file = new File("/home/rhigdon/Desktop/project-voltron/test-files/video.mp4");
//File file = new File("/home/rhigdon/Desktop/project-voltron/test-files/movGetOutTheWay_iPhone_Cellular_1.3gp");
File file = new File("/home/rhigdon/Desktop/project-voltron/test-files/movGetOutTheWay_HD_WMV_720p_1.wmv");
//Entagged Soltuion
audioFile = new MP3File(file);
try {
ID3V2_3_0Tag tag = new ID3V2_3_0Tag();
tag.setArtist("Ryan Higdon");
tag.setAlbum("Ryan's Funky Beats");
audioFile.setID3Tag(tag);
audioFile.sync();
for (ID3Tag eachTag : audioFile.getTags()) {
System.out.println(eachTag.toString());
}
} catch (ID3Exception e) {
e.printStackTrace();
System.out.println("something bad happened");
}
}
}
这篇关于你如何在 Java 中编辑视频 ID3v2 标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!