我正在使用 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);