2

I am using xuggler API to transcode Video from one format to another.

Following the example, provided by

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

Provides Could Not Open Exception:

  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)

Have tried with different file to.. But, the result is same.

Sergey
  • 995
  • 4
  • 14
  • 33
MalTec
  • 1,350
  • 2
  • 14
  • 33

2 Answers2

0

The problem is your windows version 32 or 64 bit and the xuggle version. If windows 64 and make java 64and try to find xuggle 64 but if you do java 32 xuggle 32 then you will still have the same error .
Xuggle said that I can't use this dll in amd64

Sumit Singh
  • 15,743
  • 6
  • 59
  • 89
Emre Karataşoğlu
  • 1,649
  • 1
  • 16
  • 25
0

Did you notice that you are using unix / and windows \ in the same URL?

hockey_dave
  • 524
  • 1
  • 7
  • 18