Class MPEGDashUtils


  • public class MPEGDashUtils
    extends Object
    • Constructor Detail

      • MPEGDashUtils

        public MPEGDashUtils()
    • Method Detail

      • fixupVideoCodecString

        public static String fixupVideoCodecString​(String videoCodecStr,
                                                   int codecId,
                                                   com.wowza.wms.media.model.MediaCodecInfoVideo codecInfoVideo)
      • fixupAudioCodecString

        public static String fixupAudioCodecString​(String audioCodecStr,
                                                   int codecId,
                                                   com.wowza.wms.media.model.MediaCodecInfoAudio codecInfoAudio)
      • videoCodecIdToString

        public static String videoCodecIdToString​(int codecId,
                                                  com.wowza.wms.media.model.MediaCodecInfoVideo codecInfoVideo)
      • audioCodecIdToString

        public static String audioCodecIdToString​(int codecId,
                                                  com.wowza.wms.media.model.MediaCodecInfoAudio codecInfoAudio)
      • millisToDurationStr

        public static String millisToDurationStr​(long millis)
      • codecInfoAudioToCodecsStr

        public static String codecInfoAudioToCodecsStr​(com.wowza.wms.media.model.MediaCodecInfoAudio codecInfoAudio)
      • codecInfoAudioToCodecsStr

        public static String codecInfoAudioToCodecsStr​(com.wowza.wms.media.model.MediaCodecInfoAudio codecInfoAudio,
                                                       int codecStrFormatId)
      • codecInfoVideoToCodecsStr

        public static String codecInfoVideoToCodecsStr​(com.wowza.wms.media.model.MediaCodecInfoVideo codecInfoVideo,
                                                       int codecStrFormatId)
      • codecInfoVideoToCodecsStr

        public static String codecInfoVideoToCodecsStr​(com.wowza.wms.media.model.MediaCodecInfoVideo codecInfoVideo,
                                                       int codecStrFormatId,
                                                       boolean forceH264BaselineProfile)
      • filenameToManifestId

        public static int filenameToManifestId​(String filename)
      • segmentTypeIdToStr

        public static String segmentTypeIdToStr​(int id)
      • segmentTypeStrToId

        public static int segmentTypeStrToId​(String value)
      • manifestIdStrToId

        public static int manifestIdStrToId​(String value)
      • profileStrToId

        public static int profileStrToId​(String value)
      • filenameToProfile

        public static int filenameToProfile​(String filename)
      • roughAspectRatioValue

        public static double roughAspectRatioValue​(int width,
                                                   int height)
      • dimensionsToAspectRatioString

        public static String dimensionsToAspectRatioString​(int width,
                                                           int height)
      • frameRateToFrString

        public static String frameRateToFrString​(double frameRate)
      • timescaledToMsec

        public static long timescaledToMsec​(long time,
                                            long timescale)
      • msecToTimescaled

        public static long msecToTimescaled​(long time,
                                            long timescale)
      • getMajorBrandAudio

        public static String getMajorBrandAudio()
      • getMajorBrandVideo

        public static String getMajorBrandVideo()
      • getCompatibleBrandsAudio

        public static void getCompatibleBrandsAudio​(java.util.List<String> brandsList,
                                                    boolean isInit,
                                                    int audioCodec)
      • getCompatibleBrandsVideo

        public static void getCompatibleBrandsVideo​(java.util.List<String> brandsList,
                                                    boolean isInit,
                                                    int videoCodec)
      • segmentFormatToFileExt

        public static String segmentFormatToFileExt​(com.wowza.wms.httpstreamer.model.SegmentFormat segmentFormat)
      • shouldEncryptNALUnit

        public static boolean shouldEncryptNALUnit​(int codec,
                                                   int nalUnitType)
        Returns whether a NAL Unit should be encrypted or not based on Codec and NAL Unit type.
        Parameters:
        codec -
        nalUnitType -
        Returns:
      • generateVideoSAD

        public static com.wowza.wms.drm.cenc.CencSampleAuxiliaryData generateVideoSAD​(ICencEncryptor encryptor,
                                                                                      byte[] buffer,
                                                                                      int offset,
                                                                                      int size,
                                                                                      PacketFragmentList delimitedNALUnits,
                                                                                      int videoCodec,
                                                                                      int nalUnitLen)
      • encryptSubSample

        public static int encryptSubSample​(byte[] buffer,
                                           ICencEncryptor encryptor,
                                           int offset,
                                           PacketFragmentList delimitedNALUnits,
                                           int nalUnitLen,
                                           int blockSize,
                                           int minClear,
                                           int nalSize,
                                           com.wowza.wms.drm.cenc.CencSampleAuxiliaryData.CencSubSample subSample)
      • getH264AVCCBytes

        public static byte[] getH264AVCCBytes​(byte[] codecConfig)
      • parseH264CodecConfig

        public static void parseH264CodecConfig​(byte[] codecConfig,
                                                com.wowza.wms.media.mp4.fragment.MP4FragmentWriterMedia videoHolder)
      • getH265CodecHVCCBytes

        public static byte[] getH265CodecHVCCBytes​(byte[] codecConfig)
      • parseH265CodecConfig

        public static void parseH265CodecConfig​(byte[] codecConfig,
                                                com.wowza.wms.media.mp4.fragment.MP4FragmentWriterMedia videoHolder)
      • parseNalUnitLengthForCodec

        public static int parseNalUnitLengthForCodec​(int videoCodec,
                                                     byte[] codecConfig)
      • getVideoCodecNalType

        public static int getVideoCodecNalType​(int videoCodec,
                                               byte[] buffer,
                                               int offset,
                                               int nalUnitLen)