public final class VideoCodec
extends java.lang.Object
VideoCodec
- supported video codecs enumerations.Modifier and Type | Field and Description |
---|---|
static int |
H261
H261 - H.261 codec. |
static int |
H262
H262 - H.262 (or MPEG2 Part 2) codec. |
static int |
H263
H263 - H.263 codec. |
static int |
H263_SORENSON
H263_SORENSON - H.263 Sorenson codec. |
static int |
H264
H264 - H.264 codec. |
static int |
H265
H265 - H.265 codec. |
static int |
MJPEG
MJPEG - MJPEG codec. |
static int |
MPEG1
MPEG1 - MPEG1 codec. |
static int |
MPEG2
MPEG2 - MPEG2 codec (similar to H262). |
static int |
MPEG4
MPEG4 - MPEG4 codec. |
static int |
MRLE
MRLE - Microsoft RLE codec. |
static int |
QRLE
QRLE - QuickTime RLE codec. |
static int |
SCREEN_VIDEO_1
SCREEN_VIDEO_1 - Flash Screen Video I codec. |
static int |
SCREEN_VIDEO_2
SCREEN_VIDEO_2 - Flash Screen Video II codec. |
static int |
TSCC
TSCC - TechSmith Screen Capture Codec. |
static int |
UNKNOWN
UNKNOWN - unknown codec. |
static int |
VP6
VP6 - VP6. |
static int |
VP8
VP8 - VP8. |
static int |
VP9
VP9 - VP9. |
static int |
YCBCR
YCBCR - YCbCr codec. |
Modifier and Type | Method and Description |
---|---|
static int |
getH263SorensonInfo(byte[] codecConfig)
Returns H.263 Sorenson video info.
|
static int |
getH263SorensonInfo(ByteArray codecConfig)
Returns H.263 Sorenson video info.
|
static byte[] |
getH264CodecConfig(ByteArray[] sps,
ByteArray[] pps)
Returns H.264 codec configuration.
|
static byte[] |
getH264CodecConfig(ByteArray sps,
ByteArray pps)
Returns H.264 codec configuration.
|
static byte[] |
getH264CodecConfigNals(byte[] codecConfig)
Returns H.264 codec configuration NALs (with NAL-size 4 byte prefixes).
|
static byte[] |
getH264CodecConfigNals(ByteArray codecConfig)
Returns H.264 codec configuration NALs (with NAL-size 4 byte prefixes).
|
static int |
getH264Info(byte[] codecConfig)
Returns H.264 video info.
|
static int |
getH264Info(byte[] codecConfig,
int[] frameCropOffset)
Returns H.264 video info.
|
static int |
getH264Info(ByteArray codecConfig)
Returns H.264 video info.
|
static int |
getH264Info(ByteArray codecConfig,
int[] frameCropOffset)
Returns H.264 video info.
|
static ByteArray[] |
getH264Nals(ByteArray frame)
Returns H.264 NALs from
frame . |
static ByteArray |
getH264Pps(byte[] codecConfig)
Returns H.264 PPS (Picture Parameter Set) bytes from the
codecConfig . |
static ByteArray |
getH264Pps(ByteArray codecConfig)
Returns H.264 PPS (Picture Parameter Set) bytes from the
codecConfig . |
static ByteArray |
getH264Sps(byte[] codecConfig)
Returns H.264 SPS (Sequence Parameter Set) bytes from the
codecConfig . |
static ByteArray |
getH264Sps(ByteArray codecConfig)
Returns H.264 SPS (Sequence Parameter Set) bytes from the
codecConfig . |
static byte[] |
getH265CodecConfig(ByteArray vps,
ByteArray sps,
ByteArray pps)
Returns H.265 codec configuration.
|
static int |
getH265Info(byte[] codecConfig)
Returns H.265 video info.
|
static int |
getH265Info(ByteArray codecConfig)
Returns H.265 video info.
|
static int |
getH265Info(ByteArray codecConfig,
int[] frameCropOffset)
Returns H.265 video info.
|
static ByteArray[] |
getH265Nals(ByteArray frame)
Returns H.265 NALs from
frame . |
static ByteArray |
getH265Pps(byte[] codecConfig)
Returns H.265 PPS (Picture Parameter Set) bytes from the
codecConfig . |
static ByteArray |
getH265Pps(ByteArray codecConfig)
Returns H.265 PPS (Picture Parameter Set) bytes from the
codecConfig . |
static ByteArray |
getH265Sps(byte[] codecConfig)
Returns H.265 SPS (Sequence Parameter Set) bytes from the
codecConfig . |
static ByteArray |
getH265Sps(ByteArray codecConfig)
Returns H.265 SPS (Sequence Parameter Set) bytes from the
codecConfig . |
static ByteArray |
getH265Vps(byte[] codecConfig)
Returns H.265 VPS (Video Parameter Set) bytes from the
codecConfig . |
static ByteArray |
getH265Vps(ByteArray codecConfig)
Returns H.265 VPS (Video Parameter Set) bytes from the
codecConfig . |
static java.lang.String |
getInfo(int info)
Returns string representation of the video info.
|
static int |
getVideoHeight(int info)
Returns frame height from
info int. |
static int |
getVideoWidth(int info)
Returns video frame width from
info int. |
static int |
getVp8Info(byte[] codecConfig)
Returns VP8 video info.
|
static int |
getVp8Info(ByteArray codecConfig)
Returns VP8 video info.
|
static int |
getVp9Info(byte[] codecConfig)
Returns VP9 video info.
|
static int |
getVp9Info(ByteArray codecConfig)
Returns VP9 video info.
|
static boolean |
isVideoKeyFrame(int codec,
ByteArray frame)
Checks if
frame is a key frame. |
static ByteArray |
replaceH26400000001WithNalSize(ByteArray frame) |
static ByteArray |
replaceH264NalSizeWith00000001(ByteArray frame) |
static ByteArray |
replaceH26500000001WithNalSize(ByteArray frame) |
static ByteArray |
replaceH265NalSizeWith00000001(ByteArray frame) |
public static final int UNKNOWN
UNKNOWN
- unknown codec.public static final int H261
H261
- H.261 codec.public static final int H262
H262
- H.262 (or MPEG2 Part 2) codec.public static final int H263
H263
- H.263 codec.public static final int H263_SORENSON
H263_SORENSON
- H.263 Sorenson codec.public static final int H264
H264
- H.264 codec.public static final int H265
H265
- H.265 codec.public static final int MJPEG
MJPEG
- MJPEG codec.public static final int MPEG1
MPEG1
- MPEG1 codec.public static final int MPEG2
MPEG2
- MPEG2 codec (similar to H262).public static final int MPEG4
MPEG4
- MPEG4 codec.public static final int MRLE
MRLE
- Microsoft RLE codec.public static final int QRLE
QRLE
- QuickTime RLE codec.public static final int SCREEN_VIDEO_1
SCREEN_VIDEO_1
- Flash Screen Video I codec.public static final int SCREEN_VIDEO_2
SCREEN_VIDEO_2
- Flash Screen Video II codec.public static final int TSCC
TSCC
- TechSmith Screen Capture Codec.public static final int VP6
VP6
- VP6.public static final int VP8
VP8
- VP8.
Note:
- Codec configuration is defined by the initial 10 bytes of the key frame
that contains frame width and height.
public static final int VP9
VP9
- VP9.public static final int YCBCR
YCBCR
- YCbCr codec.public static java.lang.String getInfo(int info)
info
- public static int getVideoWidth(int info)
info
int.info
- video info integerpublic static int getVideoHeight(int info)
info
int.info
- frame info integerpublic static boolean isVideoKeyFrame(int codec, ByteArray frame)
frame
is a key frame.codec
- frame
- true
if video key frame; otherwise false
public static int getH263SorensonInfo(byte[] codecConfig)
codecConfig
- public static int getH263SorensonInfo(ByteArray codecConfig)
codecConfig
- public static byte[] getH264CodecConfigNals(byte[] codecConfig)
codecConfig
- 'avcC' config bytespublic static byte[] getH264CodecConfigNals(ByteArray codecConfig)
codecConfig
- 'avcC' config bytespublic static byte[] getH264CodecConfig(ByteArray sps, ByteArray pps)
sps
- Sequence Parameter Set bytes (without NAL-size or '00000001' prefix)pps
- Picture Parameter Set bytes (without NAL-size or '00000001' prefix)public static byte[] getH264CodecConfig(ByteArray[] sps, ByteArray[] pps)
sps
- Sequence Parameter Set bytes (without NAL-size or '00000001' prefix)pps
- Picture Parameter Set bytes (without NAL-size or '00000001' prefix)public static ByteArray getH264Sps(byte[] codecConfig)
codecConfig
.codecConfig
- 'avcC' config bytespublic static ByteArray getH264Sps(ByteArray codecConfig)
codecConfig
.codecConfig
- 'avcC' config bytespublic static ByteArray getH264Pps(byte[] codecConfig)
codecConfig
.codecConfig
- 'avcC' config bytespublic static ByteArray getH264Pps(ByteArray codecConfig)
codecConfig
.codecConfig
- 'avcC' config bytespublic static int getH264Info(byte[] codecConfig)
codecConfig
- 'avcC' config bytespublic static int getH264Info(byte[] codecConfig, int[] frameCropOffset)
codecConfig
- 'avcC' config bytesframeCropOffset
- frame crop offset (top, left, bottom, right)public static int getH264Info(ByteArray codecConfig)
codecConfig
- 'avcC' config bytespublic static int getH264Info(ByteArray codecConfig, int[] frameCropOffset)
codecConfig
- 'avcC' config bytesframeCropOffset
- frame crop offset (top, left, bottom, right)public static ByteArray[] getH264Nals(ByteArray frame)
frame
.frame
- public static ByteArray replaceH264NalSizeWith00000001(ByteArray frame)
frame
- encoded H.264 framepublic static ByteArray replaceH26400000001WithNalSize(ByteArray frame)
frame
- encoded H.264 framepublic static byte[] getH265CodecConfig(ByteArray vps, ByteArray sps, ByteArray pps)
vps
- Video Parameter Set bytes (without NAL-size or '00000001' prefix)sps
- Sequence Parameter Set bytes (without NAL-size or '00000001' prefix)pps
- Picture Parameter Set bytes (without NAL-size or '00000001' prefix)public static ByteArray getH265Vps(byte[] codecConfig)
codecConfig
.codecConfig
- 'hevC' config bytespublic static ByteArray getH265Vps(ByteArray codecConfig)
codecConfig
.codecConfig
- 'hevC' config bytespublic static ByteArray getH265Sps(byte[] codecConfig)
codecConfig
.codecConfig
- 'hevC' config bytespublic static ByteArray getH265Sps(ByteArray codecConfig)
codecConfig
.codecConfig
- 'hevC' config bytespublic static ByteArray getH265Pps(byte[] codecConfig)
codecConfig
.codecConfig
- 'hevC' config bytespublic static ByteArray getH265Pps(ByteArray codecConfig)
codecConfig
.codecConfig
- 'hevC' config bytespublic static int getH265Info(byte[] codecConfig)
codecConfig
- 'hevC' config bytespublic static int getH265Info(ByteArray codecConfig)
codecConfig
- 'hevC' config bytespublic static int getH265Info(ByteArray codecConfig, int[] frameCropOffset)
codecConfig
- 'hevC' config bytesframeCropOffset
- frame crop offset (top, left, bottom, right)public static ByteArray[] getH265Nals(ByteArray frame)
frame
.frame
- public static ByteArray replaceH265NalSizeWith00000001(ByteArray frame)
frame
- encoded H.265 framepublic static ByteArray replaceH26500000001WithNalSize(ByteArray frame)
frame
- encoded H.265 framepublic static int getVp8Info(byte[] codecConfig)
codecConfig
- public static int getVp8Info(ByteArray codecConfig)
codecConfig
- public static int getVp9Info(byte[] codecConfig)
codecConfig
- public static int getVp9Info(ByteArray codecConfig)
codecConfig
-