Interface IDemuxer

All Superinterfaces:
java.lang.AutoCloseable, java.lang.Iterable<IDecodedPacket<?>>
All Known Implementing Classes:
VelvetVideoLib.DemuxerImpl

public interface IDemuxer
extends java.lang.AutoCloseable, java.lang.Iterable<IDecodedPacket<?>>
Demuxer - media container reader.
  • Method Details

    • streams

      java.util.List<IDecoderStream<?,​?,​?>> streams()
      Returns:
      list of container's media streams
    • videoStreams

      java.util.List<? extends IVideoDecoderStream> videoStreams()
      Returns:
      list of container's video streams
    • audioStreams

      java.util.List<? extends IAudioDecoderStream> audioStreams()
      Returns:
      list of container's audio streams
    • videoStream

      IVideoDecoderStream videoStream​(int index)
      Parameters:
      index - of the stream in the container
      Returns:
      container's video stream by index, or null if a stream with the specified index does not exist or is not video.
    • audioStream

      IAudioDecoderStream audioStream​(int index)
      Parameters:
      index - of the stream in the container
      Returns:
      container's audio stream by index, or null if a stream with the specified index does not exist or is not audio.
    • metadata

      java.util.Map<java.lang.String,​java.lang.String> metadata()
      Returns:
      stream metadata as key to value map
    • properties

      IContainerProperties properties()
      Returns:
      container properties
    • nextPacket

      IDecodedPacket<?> nextPacket()
      Decodes and returns next packet in the container.
      Returns:
      next packet or null if end of container reached
    • packetStream

      java.util.stream.Stream<IDecodedPacket<?>> packetStream()
      Returns:
      stream of packets in the container
    • iterator

      java.util.Iterator<IDecodedPacket<?>> iterator()
      Specified by:
      iterator in interface java.lang.Iterable<IDecodedPacket<?>>
      Returns:
      iterator of packets in the container
    • nextRawPacket

      IRawPacket nextRawPacket()
      Obtains next media packet from the container without decoding it.
      Returns:
      raw packet data of null if end of container reached
    • close

      void close()
      Closes the demuxer, container file or other handles and frees all the allocated resources. Calling this method is necessary after working with demuxer to avoid resource leaks.
      Specified by:
      close in interface java.lang.AutoCloseable