Class StreamUtils


  • public class StreamUtils
    extends Object
    • Constructor Detail

      • StreamUtils

        public StreamUtils()
    • Method Detail

      • getStreamLength

        public static double getStreamLength​(IMediaStream stream)
        Get the duration of a media file in seconds. This will work correctly with all RandomAccessReaders and caching technology
        Parameters:
        stream - stream
        Returns:
        duration in seconds
      • getStreamBitrate

        public static double getStreamBitrate​(IMediaStream stream)
        Get the approximate bitrate of a media file in bits/per-second. This will work correctly with all RandomAccessReaders and caching technology.
        Parameters:
        stream - stream
        Returns:
        bitrate in bits/per-second
      • getStreamLength

        public static double getStreamLength​(IApplicationInstance appInstance,
                                             String streamName)
        Get the duration of a media file in seconds. This will work correctly with all RandomAccessReaders and caching technology
        Parameters:
        appInstance - application instance
        streamName - stream name
        Returns:
        duration in seconds
      • getStreamBitrate

        public static double getStreamBitrate​(IApplicationInstance appInstance,
                                              String streamName)
      • directOutput

        public static int directOutput​(byte[] dataBuffer,
                                       int[] headerValues,
                                       boolean isAbsTimecode,
                                       int src,
                                       java.io.OutputStream out,
                                       AMFObj wmsObj,
                                       byte[] workBuffer,
                                       int chunkSize)
        Direct output, Internal use.
        Parameters:
        dataBuffer -
        headerValues -
        isAbsTimecode -
        src -
        out -
        wmsObj -
        workBuffer -
        chunkSize -
        Returns:
        c
      • packetOutput

        public static int packetOutput​(java.io.OutputStream out,
                                       IMediaStream stream,
                                       AMFPacket packet,
                                       long timecode,
                                       AMFObj wmsObj,
                                       byte[] workBuffer,
                                       int chunkSize)
        Packet output. Internal use.
        Parameters:
        out -
        stream -
        packet -
        timecode -
        wmsObj -
        workBuffer -
        chunkSize -
        Returns:
        bytes
      • packetOutput

        public static int packetOutput​(java.io.OutputStream out,
                                       IMediaStream stream,
                                       AMFPacket packet,
                                       long timecode,
                                       AMFObj wmsObj,
                                       byte[] workBuffer,
                                       int chunkSize,
                                       boolean referenceWrite)
        Packet output. Internal use.
        Parameters:
        out -
        stream -
        packet -
        timecode -
        wmsObj -
        workBuffer -
        chunkSize -
        referenceWrite -
        Returns:
        bytes
      • loadConfigFile

        public static boolean loadConfigFile​(StreamList streamDefs,
                                             String fileURL)
        Load Strreams.xml, Internal use.
        Parameters:
        streamDefs -
        fileURL -