2

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)

別のファイルで試してみました..しかし、結果は同じです。

4

2 に答える 2

0

同じ URL で unix / と windows \ を使用していることに気付きましたか?

于 2012-04-02T13:58:58.623 に答える
0

問題は、Windows のバージョン 32 または 64 ビットと xuggle のバージョンです。Windows 64 で Java 64 を作成して xuggle 64 を見つけようとしても、Java 32 xuggle 32 を実行すると、同じエラーが発生します。
Xuggle は、amd64 ではこの dll を使用できないと言いました

于 2012-09-10T13:45:44.403 に答える