You are on page 1of 2

java - Xuggler video capturing?

- Stack Overflow

http://stackoverflow.com/questions/6094232/xuggler...

Welcome to Q&A for professional and enthusiast programmers check out the FAQ!

Xuggler video capturing?

I am struggling to capture a live stream from an IP camera to a file. When using Xuggler objects, every thing works fine with the extraction of video and audio streams, the problem happens when I try to write headers to the out container which is the file the video is saved to. I have added the source, Any suggestions? // Create a Xuggler container object IContainer container = IContainer.make(); IContainer outContainer = IContainer.make(); IStreamCoder outVideoCoder = null; IStreamCoder outAudioCoder = null; IStream audioOutStream = null; IStream videoOutStream = null;

// Open up the container if (container.open(filename, IContainer.Type.READ, null) < 0) throw new IllegalArgumentException("could not open file: " + filename); int retval = outContainer.open(toFile, IContainer.Type.WRITE, null); // query how many streams the call to open found int numStreams = container.getNumStreams(); // and iterate through the streams to find the first audio stream int videoStreamId = -1; IStreamCoder videoCoder = null; int audioStreamId = -1; IStreamCoder audioCoder = null; for(int i = 0; i < numStreams; i++) { // Find the stream object IStream stream = container.getStream(i); // Get the pre-configured decoder that can decode this stream; IStreamCoder coder = stream.getStreamCoder(); if (videoStreamId == -1 && coder.getCodecType() == ICodec.Type.CODEC_TYPE_VIDEO { videoStreamId = i;
java file video xuggle

asked May 23 at 7:40 user536875 6 2 feedback

Know someone who can answer? Share a link to this question via email, twitter, facebook, or linkedin. Browse other questions tagged java file video xuggle or ask your own question.

1 of 2

13/08/11 16:25

java - Xuggler video capturing? - Stack Overflow

http://stackoverflow.com/questions/6094232/xuggler...

Welcome to Q&A for professional and enthusiast programmers check out the FAQ!

2 of 2

13/08/11 16:25

You might also like