EncodedVideoFrameInfo
外部编码视频帧的信息。
public class EncodedVideoFrameInfo { public int codecType; public int width; public int height; public int framesPerSecond; public int frameType; public int rotation; public int trackId; public long captureTimeMs; public int uid; public int streamType; public EncodedVideoFrameInfo() { codecType = Constants.VIDEO_CODEC_H264; width = 0; height = 0; framesPerSecond = 0; frameType = Constants.VIDEO_FRAME_TYPE_BLANK_FRAME; rotation = Constants.VIDEO_ORIENTATION_0; trackId = 0; captureTimeMs = 0; uid = 0; streamType = Constants.VIDEO_STREAM_HIGH; } @CalledByNative public EncodedVideoFrameInfo(int codecType, int width, int height, int framesPerSecond, int frameType, int rotation, int trackId, long captureTimeMs, int uid, int streamType) { this.codecType = codecType; this.width = width; this.height = height; this.framesPerSecond = framesPerSecond; this.frameType = frameType; this.rotation = rotation; this.trackId = trackId; this.captureTimeMs = captureTimeMs; this.uid = uid; this.streamType = streamType; } @CalledByNative public int getCodecType() { return codecType; } @CalledByNative public int getWidth() { return width; } @CalledByNative public int getHeight() { return height; } @CalledByNative public int getFramesPerSecond() { return framesPerSecond; } @CalledByNative public int getFrameType() { return frameType; } @CalledByNative public int getRotation() { return rotation; } @CalledByNative public int getTrackId() { return trackId; } @CalledByNative public long getCaptureTimeMs() { return captureTimeMs; } @CalledByNative public int getUid() { return uid; } @CalledByNative public int getStreamType() { return streamType; } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("codecType=").append(codecType); sb.append(" width=").append(width); sb.append(" height=").append(height); sb.append(" framesPerSecond=").append(framesPerSecond); sb.append(" frameType=").append(frameType); sb.append(" rotation=").append(rotation); sb.append(" trackId=").append(trackId); sb.append(" captureTimeMs=").append(captureTimeMs); sb.append(" uid=").append(uid); sb.append(" streamType=").append(streamType); return sb.toString(); } }
属性
- codecType
- 视频编解码类型:
- VIDEO_CODEC_VP8 (1): VP8。
- VIDEO_CODEC_H264 (2):(默认值)H.264。
- VIDEO_CODEC_H265 (3): H.265。
- width
- 视频帧的宽度 (px)。
- height
- 视频帧的高度 (px)。
- framesPerSecond
-
每秒的视频帧数。
当该参数不为
0
时,你可以用它计算外部编码视频帧的 Unix 时间戳。 - frameType
- 视频帧的类型:
- 0:(默认)VIDEO_FRAME_TYPE_BLANK_FRAME,空白帧。
- 3:VIDEO_FRAME_TYPE_KEY_FRAME,关键帧。
- 4:VIDEO_FRAME_TYPE_DELTA_FRAME,Delta 帧。
- 5:VIDEO_FRAME_TYPE_B_FRAME,B 帧。
- 6:VIDEO_FRAME_TYPE_UNKNOW,未知。
- rotation
- 视频帧的旋转信息,取值如下:
- 0:(默认)不旋转。
- 90:顺时针旋转 90 度。
- 180:顺时针旋转 180 度。
- 270:顺时针旋转 270 度。
- trackId
- 预留参数。
- captureTimeMs
- 采集外部编码视频帧的 Unix 时间戳 (ms)。
- uid
- 推送外部编码视频帧的用户 ID。
- streamType
- 视频流类型。