2016-04-07 45 views
1

我在做this,我遇到了問題。openIMAJ缺失類或錯誤的庫

這裏是我的代碼

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(); 
    } 
} 

,當我運行它,我gettig

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(長,所以我救了它引擎收錄)。 openIMAJ的不同部分有很多依賴關係,因爲我失去了跟蹤哪些內容。我試着下載以下this庫,但是當我添加任何其他比核心,我越來越對提供最後一個網站

Missing artifact org.openimaj:video:jar:1.0.6-SNAPSHOT 

利布斯比Maven的中央倉庫不同。 所以,我的問題是,在哪裏可以找到期望的類的庫(或MCR中的哪一個可以提供幫助)?或者libs與openIMAJ網站上的教程兼容。

感謝任何幫助

回答

0

爲什麼你定義<sourceDirectory>src</sourceDirectory>?這不使用Maven被廣泛接受的默認值${project.basedir}/src/main/java

OpenIMAJ Wiki page的最新更新是從Sep 2012。我會去與latest release version 1.3.1 from Sep 2014 on Maven Central

如果你真的想使用快照:版本1.0.6-SNAPSHOT core是從2013年。有一個1.4-SNAPSHOT,這是一個月大。這可能也適用於other core-... libs。我建議使用最新的。

+0

謝謝,我稍後再試,看看它是否有效。關於,在Eclipse中生成的pom wast並且我從不需要更改它,但是請求 – korek