Can Xuggler read from a Network-Based Source?
Yes, but it’s a little more complex than reading from a file. The simple version of IContainer.open(String, Type, IContainerFormat) will always attempt to read meta-data from a media header, and find at least one packet of each stream in the file, before returning. This can be problematic when reading from network-based streams (as you don’t want to block). To change this behaviour, use the IContainer.open(String, Type, IContainerFormat, boolean, boolean) method, passing in “true” for the streamsCanBeAddedDynamically parameter and “false” for the queryStreamMetaData parameter. This instructs Xuggler to assume the number of streams the header of a stream communicates is not guaranteed to be complete (e.g. audio may not have shown up yet), and also tells open not to read through the stream to find a packet for each stream before it returns. The last correct step here (if you want Xuggler to be able to fill in IStreamCoder settings correctly for you when decoding) is to ask Xuggler to ICo