Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'mediainfo': The specified module could not be found

StackOverflow https://stackoverflow.com/questions/14737243

문제

I am using the MediaInfo.java class which can be found on sub4me to extract meta data from various video file formats. However I get the above error at run time.

This is an extract of my code, the exception is thrown at 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); 
도움이 되었습니까?

해결책

According to this answer, the class MediaInfo is just JNI wrapper, so you need to download MediaInfo distribution to according platform and add those native library files to class path of your project..

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top