Xuggler错误:无法打开

时间:2011-12-01 08:36:57

标签: java ffmpeg xuggle video-conversion xuggler

我正在使用xuggler API将视频从一种格式转码为另一种格式。

按照

提供的示例

http://wiki.xuggle.com/MediaTool_Introduction& http://www.javacodegeeks.com/2011/02/xuggler-tutorial-transcoding-media.html

public void convertVideo(){

     String sourceUrl=getResourceDirectory()+"/in/AV36_1.AVI";
     String destUrl=getResourceDirectory()+"/out/output.mp4";

     IMediaReader reader = ToolFactory.makeReader(sourceUrl);

        // add a viewer to the reader, to see progress as the media is
        // transcoded
        reader.addListener(ToolFactory.makeViewer(true));

     // create a writer which receives the decoded media from
     // reader, encodes it and writes it out to the specified file
     IMediaWriter writer = ToolFactory.makeWriter(destUrl, reader);

     // add a debug listener to the writer to see media writer events
     writer.addListener(ToolFactory.makeDebugListener());


////
////        // create the media writer
        reader.addListener(ToolFactory.makeWriter(destUrl, reader));

        // read packets from the source file, which dispatch events to the
        // writer, this will continue until 


        while (reader.readPacket() == null)
          do {} while(false);
    }

提供无法打开的例外:

  Exception in thread "main" java.lang.RuntimeException: could not open: D:\Malhar\project_works\VideoConvertter/resources/in/AV36_1.AVI
    at com.xuggle.mediatool.MediaReader.open(MediaReader.java:637)
    at com.xuggle.mediatool.MediaReader.readPacket(MediaReader.java:434)
    at util.VideoEncoder.convertVideo(VideoEncoder.java:38)
    at ConvertVideo.main(ConvertVideo.java:12)

尝试了不同的文件..但是,结果是一样的。

2 个答案:

答案 0 :(得分:0)

您是否注意到您在同一网址中使用了unix /和windows \?

答案 1 :(得分:0)

问题是您的Windows版本32或64位和xuggle版本。 如果是windows 64并且make java 64并尝试查找xuggle 64但是如果你执行java 32 xuggle 32那么你仍会遇到同样的错误。
Xuggle说我不能在amd64中使用这个dll