1

我正在使用sub4me上的MediaInfo.java类 从各种视频文件格式中提取元数据。但是我在运行时收到上述错误。

这是我的代码的摘录,异常被抛出MediaInfo info = new MediaInfo()

String fileName = "file:///homes/sa303/NetBeansProjects/MoviePlayer1/src/Trailer/IronMan3.mp4";
File file1 = new File(fileName);
System.out.println(file1.getPath());

MediaInfo info = new MediaInfo();
info.open(file1);

String format = info.get(MediaInfo2.StreamKind.Video, 1, "Format", MediaInfo2.InfoKind.Text, MediaInfo2.InfoKind.Name);
String bitRate = info.get(MediaInfo2.StreamKind.Video, 1, "BitRate", MediaInfo2.InfoKind.Text, MediaInfo2.InfoKind.Name);
String frameRate = info.get(MediaInfo2.StreamKind.Video, 1, "FrameRate", MediaInfo2.InfoKind.Text, MediaInfo2.InfoKind.Name);
String width = info.get(MediaInfo2.StreamKind.Video, 1, "Width", MediaInfo2.InfoKind.Text, MediaInfo2.InfoKind.Name);

String audioBitrate = info.get(MediaInfo2.StreamKind.Audio, 1, "BitRate", MediaInfo2.InfoKind.Text, MediaInfo2.InfoKind.Name);
String audioChannels = info.get(MediaInfo2.StreamKind.Audio, 1, "Channels", MediaInfo2.InfoKind.Text, MediaInfo2.InfoKind.Name); 
4

1 回答 1

0

根据这个答案,该类MediaInfo只是 JNI 包装器,因此您需要将MediaInfo分发下载到相应的平台并将这些本机库文件添加到项目的类路径中。

于 2013-02-06T19:44:47.370 回答