线程“main”中的异常java.lang.UnsatisfiedLinkError:无法加载库'mediainfo':找不到指定的模块

时间:2013-02-06 19:32:29

标签: java video java-native-interface metadata mediainfo

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

这是我的代码的摘录,异常在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); 

1 个答案:

答案 0 :(得分:0)

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