containerFormat_live.setOutputFormat("flv", url + fileName, null); container.setInputBufferLength(0); int retVal = container.open(url + fileName, IContainer.Type.WRITE, containerFormat_live); if (retVal < 0) { System.err.println("Could not open output container for live stream");
IContainer containerAudio = IContainer.make(); if (containerVideo.open(filenamevideo, IContainer.Type.READ, null) < 0) throw new IllegalArgumentException("Cant find " + filenamevideo); if (containerAudio.open(filenameaudio, IContainer.Type.READ, null) < 0) throw new IllegalArgumentException("Cant find " + filenameaudio);
IContainer iContainer = IContainer.make(); if (iContainer.open(inputStream, IContainer.Type.READ, format) >= 0) { IMediaReader mediaReader = ToolFactory.makeReader(iContainer); ... }
IContainer container = IContainer.make(); // open the video container.open("myvideo.flv", IContainer.Type.READ, null);
public static void main(String[] args) { String filename = "http://techslides.com/demos/sample-videos/small.mp4"; // Let's make sure that we can actually convert video pixel formats. if (!IVideoResampler.isSupported(IVideoResampler.Feature.FEATURE_COLORSPACECONVERSION)) { throw new RuntimeException("you must install the GPL version of Xuggler (with IVideoResampler support) for this demo to work"); } // Create a Xuggler container object IContainer container = IContainer.make(); // Open up the container if (container.open("http://techslides.com/demos/sample-videos/small.mp4", IContainer.Type.READ, null) < 0) { throw new IllegalArgumentException("could not open file: " + filename); }
RandomAccessFile f = new RandomAccessFile("C:/MyMovie.mov", "r"); IContainer container = IContainer.make(); IContainerFormat format = IContainerFormat.make(); if (format.setInputFormat("mov") < 0) System.out.println("Error setting format"); int result = container.open(f, IContainer.Type.READ, format);
private static final String filename = "c:/myvideo.mp4"; IContainer container = IContainer.make(); int result = container.open(filename, IContainer.Type.READ, null); long duration = container.getDuration(); long fileSize = container.getFileSize();
IContainer container = IContainer.make(); if (container.open(movie, IContainer.Type.READ, null) < 0) { throw new RuntimeException("Cannot open '" + movie + "'"); } logger.info("# Duration (ms): " + ((container.getDuration() == Global.NO_PTS) ? "unknown" : "" + container.getDuration() / 100)); logger.info("# File size (bytes): " + container.getFileSize()); logger.info("# Bit rate: " + container.getBitRate());
/** * Create the necessary reader */ synchronized private void create(InputStream stream) { setupReader(); // Check whether the string we have is a valid URI final IContainer container = IContainer.make(); final int openResult = container.open(stream, null, true, true); if (openResult < 0) { logger.error("Error opening container. Error " + openResult + " (" + IError.errorNumberToType(openResult).toString() + ")"); return; } setupReader(container); }
/** * Create the necessary reader */ synchronized private void create(DataInput input) { setupReader(); // Check whether the string we have is a valid URI final IContainer container = IContainer.make(); final int openResult = container.open(input, null, true, true); if (openResult < 0) { logger.error("Error opening container. Error " + openResult + " (" + IError.errorNumberToType(openResult).toString() + ")"); return; } setupReader(container); }
/** * Create the necessary reader */ synchronized private void create(DataInput input) { setupReader(); // Check whether the string we have is a valid URI final IContainer container = IContainer.make(); final int openResult = container.open(input, null, true, true); if (openResult < 0) { logger.error("Error opening container. Error " + openResult + " (" + IError.errorNumberToType(openResult).toString() + ")"); return; } setupReader(container); }
/** * Create the necessary reader */ synchronized private void create(InputStream stream) { setupReader(); // Check whether the string we have is a valid URI final IContainer container = IContainer.make(); final int openResult = container.open(stream, null, true, true); if (openResult < 0) { logger.error("Error opening container. Error " + openResult + " (" + IError.errorNumberToType(openResult).toString() + ")"); return; } setupReader(container); }
if (container.open("/path/to/video.avi", IContainer.Type.READ, null) < 0) throw new IllegalArgumentException("could not open file: " + filename);
// create a Xuggler container object IContainer container = IContainer.make(); if(container.open(file.getPath(),IContainer.Type.READ,null) < 0) { return false; } // query how many streams the call to open found boolean isH264 = false; boolean isAAC = false; int numStreams = container.getNumStreams(); 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 (coder.getCodecID() == ID.CODEC_ID_H264) { isH264 = true; } if (coder.getCodecID() == ID.CODEC_ID_AAC) { isAAC = true; } } if (container !=null) { container.close(); container = null; } return isH264 && isAAC;
protected boolean setupVideo() { if (videoListener != null) { return true; } IContainer container = IContainer.make(); IContainerFormat format = IContainerFormat.make(); int ret = format.setInputFormat("vfwcap"); if (ret < 0) { container.close(); format.delete(); log.error(String.format("USB Cam: cannot open WebCam ('vfwcap' device)")); return false; } ret = container.open("0", IContainer.Type.READ, format); if (ret < 0) { container.close(); format.delete(); log.error(String.format("USB Cam: cannot open WebCam ('0')")); return false; } IMediaReader reader = ToolFactory.makeReader(container); videoListener = new VideoListener(reader, getResolutionWidth(resolution), getResolutionHeight(resolution)); reader.addListener(videoListener); return true; }
IContainer container = IContainer.make(); if (container.open(filename, IContainer.Type.READ, null) < 0) { throw new IllegalArgumentException("could not open file: " + filename);