京东云视频云全面支持AVS2标准
一、概述
一、概述
二、技术实现
FLV AVS2扩展说明:
sequence_header() {
uint32_t profile_id; /* profile ID, davs2_profile_id_e */
uint32_t level_id; /* level ID */
uint32_t progressive; /* progressive sequence (0: interlace, 1: progressive) */
uint32_t width; /* image width */
uint32_t height; /* image height */
uint32_t chroma_format; /* chroma format(1: 4:2:0, 2: 4:2:2) */
uint32_t aspect_ratio; /* 2: 4:3, 3: 16:9 */
uint32_t low_delay; /* low delay */
uint32_t bitrate; /* bitrate (bps) */
uint32_t internal_bit_depth; /* internal sample bit depth */
uint32_t output_bit_depth; /* output sample bit depth */
uint32_t bytes_per_sample; /* bytes per sample */
float frame_rate; /* frame rate */
uint32_t frame_rate_id; /* frame rate code, mpeg12 [1...8] */
};
FLV AVS2扩展示例
HLS AVS2扩展说明:
TS新增AVS2的stream_type=0xD2,stream_id=0xE0
AVS2码流结构:
AVS2的码流结构由包含起始码的视频序列组成,视频帧slice type包含I、P、B在内的六种类型,如下:
slice type {
AVS2_I_SLICE = 0, /* slice type: I frame */
AVS2_P_SLICE = 1, /* slice type: P frame */
AVS2_B_SLICE = 2, /* slice type: B frame */
AVS2_G_SLICE = 3, /* AVS2 type: G frame */
AVS2_F_SLICE = 4, /* slice type: F frame */
AVS2_S_SLICE = 5, /* AVS2 type: S frame */
AVS2_GB_SLICE = 6, /* AVS2 type: GB frame*/
};
start code {
SC_SEQUENCE_HEADER = 0xB0, /* sequence header start code */
SC_SEQUENCE_END = 0xB1, /* sequence end start code */
SC_USER_DATA = 0xB2, /* user data start code */
SC_INTRA_PICTURE = 0xB3, /* intra picture start code */
SC_EXTENSION = 0xB5, /* extension start code */
SC_INTER_PICTURE = 0xB6, /* inter picture start code */
SC_VIDEO_EDIT_CODE = 0xB7, /* video edit start code */
SC_SLICE_CODE_MIN = 0x00, /* min slice start code */
SC_SLICE_CODE_MAX = 0x8F /* max slice start code */
};
video_sequence() {
do {
sequence_header();
extension_and_user_data(0);
do {
if (next_bits(32) == intra_picture_start_code )
intra_picture_header()
else
inter_picture_header()
extension_and_user_date(1)
picture_data()
} while(next_bits(32) == inter_picture_start_code() || next_bits(32) == intra_picture_start_code ))
if (next_bits(32) == video_sequence_end_code)
video_sequence_end_code
if (net_bits(32) == video_edit_code)
video_edit_code
}
}
在视频点播方面,AVS2能高效提升编码效率,FFmpeg对AVS标准容器格式MKV/MP4等还不支持。目前在视频处理层面,京东云视频点播已支持AVS2相关的转码等媒体处理。
主流编码速度对比
相同的编码速率,AVS2大概比x265的编码效率高10%~30%;同样在相同的编码效率下, AVS2比x265的编码速率快3~10倍。
AVS2与HEVC平均主观质量对比
相同码率条件下,AVS2与HEVC的平均主观质量基本一致。
三、AVS2编码效果
评论