rahulthe great
rahulthe great

Reputation: 13

xuggler convertingh mp4 to avi

Im using xuggler to convert mp4 file to avi file.the conversion is going on well but my program is not coming out of while loop please anybody help me this is my code

IMediaReader mediaReader = ToolFactory.makeReader(inputFilename);
IMediaWriter mediaWriter = ToolFactory.makeWriter(outputFilename, mediaReader);
mediaReader.addListener(mediaWriter);
IMediaViewer mediaViewer = ToolFactory.makeViewer(true);
mediaReader.addListener(mediaViewer);
while (mediaReader.readPacket() == null);

thanks in advace

Upvotes: 1

Views: 1771

Answers (2)

Tomas Narros
Tomas Narros

Reputation: 13468

Have you tried adding a Debug Listener to find out what's wrong?

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

Upvotes: 1

bluefoot
bluefoot

Reputation: 10580

According to the documentation, here , the method that is called as the while condition returns:

null if there are more packets to read, otherwise return an IError instance.

maybe you are not waiting enough for the app to come out of the while?

Upvotes: 0

Related Questions