openIMAJ 缺少 class 或错误的库
openIMAJ missing class or wrong library
我正在做 this,但我遇到了问题。
这是我的代码
package vid;
import java.io.File;
import org.apache.log4j.BasicConfigurator;
import org.openimaj.image.MBFImage;
import org.openimaj.video.Video;
import org.openimaj.video.xuggle.XuggleVideo;
public class Movie{
public static void main(String[] args){
BasicConfigurator.configure();
Video<MBFImage> video;
video = new XuggleVideo(new File("in.flv"));
for (MBFImage mbfImage : video) {
//something
}
video.close();
}
}
当我 运行 它时,我很兴奋
21:18:51.520 [main] DEBUG com.xuggle.xuggler - Could not open output url: file:/D:/Workspace/openIMAJ/in.flv (../../../../../../../csrc/com/xuggle/xuggler/Container.cpp:436)
1 [main] INFO org.openimaj.video.xuggle.XuggleVideo - URL file:/D:/Workspace/openIMAJ/in.flv could not be opened by ffmpeg. Trying to open a stream to the URL instead.
Exception in thread "main" java.lang.NoClassDefFoundError: org/openimaj/io/InputStreamObjectReader
at org.openimaj.video.xuggle.XuggleVideo$MBFImageConverter.toImage(XuggleVideo.java:264)
at com.xuggle.mediatool.MediaReader.dispatchVideoPicture(MediaReader.java:600)
at com.xuggle.mediatool.MediaReader.decodeVideo(MediaReader.java:519)
at com.xuggle.mediatool.MediaReader.readPacket(MediaReader.java:475)
at org.openimaj.video.xuggle.XuggleVideo.readFrame(XuggleVideo.java:482)
at org.openimaj.video.xuggle.XuggleVideo.hasNextFrame(XuggleVideo.java:577)
at org.openimaj.video.VideoIterator.hasNext(VideoIterator.java:59)
at vid.Movie.main(Movie.java:17)
Caused by: java.lang.ClassNotFoundException: org.openimaj.io.InputStreamObjectReader
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 8 more
还有我的 pom.xml (long, so I saved it on pastebin). There is a lot on dependencies to different parts of openIMAJ because I've lost track which does what. I've tried to download libs following this,但是当我添加除核心以外的任何内容时,我得到
Missing artifact org.openimaj:video:jar:1.0.6-SNAPSHOT
上一个站点提供的库与 Maven 中央存储库中的库不同。
所以,我的问题是,我在哪里可以找到所需 class 的库(或者 MCR 中的哪一个可以提供帮助)?或者与 openIMAJ 网站上的教程兼容的库。
感谢您的帮助
为什么定义<sourceDirectory>src</sourceDirectory>
?这样不使用 Maven 广泛接受的默认值 ${project.basedir}/src/main/java
.
OpenIMAJ Wiki page's latest update is from Sep 2012. I'd go with the latest release version 1.3.1 from Sep 2014 on Maven Central.
如果你真的想使用快照:core
的 1.0.6-SNAPSHOT 版本是 2013 年的。还有一个 1.4-SNAPSHOT which is just about one month old. This probably applies to other core-...
libs。我建议使用最新的。
我正在做 this,但我遇到了问题。
这是我的代码
package vid;
import java.io.File;
import org.apache.log4j.BasicConfigurator;
import org.openimaj.image.MBFImage;
import org.openimaj.video.Video;
import org.openimaj.video.xuggle.XuggleVideo;
public class Movie{
public static void main(String[] args){
BasicConfigurator.configure();
Video<MBFImage> video;
video = new XuggleVideo(new File("in.flv"));
for (MBFImage mbfImage : video) {
//something
}
video.close();
}
}
当我 运行 它时,我很兴奋
21:18:51.520 [main] DEBUG com.xuggle.xuggler - Could not open output url: file:/D:/Workspace/openIMAJ/in.flv (../../../../../../../csrc/com/xuggle/xuggler/Container.cpp:436)
1 [main] INFO org.openimaj.video.xuggle.XuggleVideo - URL file:/D:/Workspace/openIMAJ/in.flv could not be opened by ffmpeg. Trying to open a stream to the URL instead.
Exception in thread "main" java.lang.NoClassDefFoundError: org/openimaj/io/InputStreamObjectReader
at org.openimaj.video.xuggle.XuggleVideo$MBFImageConverter.toImage(XuggleVideo.java:264)
at com.xuggle.mediatool.MediaReader.dispatchVideoPicture(MediaReader.java:600)
at com.xuggle.mediatool.MediaReader.decodeVideo(MediaReader.java:519)
at com.xuggle.mediatool.MediaReader.readPacket(MediaReader.java:475)
at org.openimaj.video.xuggle.XuggleVideo.readFrame(XuggleVideo.java:482)
at org.openimaj.video.xuggle.XuggleVideo.hasNextFrame(XuggleVideo.java:577)
at org.openimaj.video.VideoIterator.hasNext(VideoIterator.java:59)
at vid.Movie.main(Movie.java:17)
Caused by: java.lang.ClassNotFoundException: org.openimaj.io.InputStreamObjectReader
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 8 more
还有我的 pom.xml (long, so I saved it on pastebin). There is a lot on dependencies to different parts of openIMAJ because I've lost track which does what. I've tried to download libs following this,但是当我添加除核心以外的任何内容时,我得到
Missing artifact org.openimaj:video:jar:1.0.6-SNAPSHOT
上一个站点提供的库与 Maven 中央存储库中的库不同。 所以,我的问题是,我在哪里可以找到所需 class 的库(或者 MCR 中的哪一个可以提供帮助)?或者与 openIMAJ 网站上的教程兼容的库。
感谢您的帮助
为什么定义<sourceDirectory>src</sourceDirectory>
?这样不使用 Maven 广泛接受的默认值 ${project.basedir}/src/main/java
.
OpenIMAJ Wiki page's latest update is from Sep 2012. I'd go with the latest release version 1.3.1 from Sep 2014 on Maven Central.
如果你真的想使用快照:core
的 1.0.6-SNAPSHOT 版本是 2013 年的。还有一个 1.4-SNAPSHOT which is just about one month old. This probably applies to other core-...
libs。我建议使用最新的。