跳到主要内容

hi_vdec_stream

hi_vdec_chn_param

说明

定义解码通道高级参数。

定义

hi_vdec_chn_param = {"type": hi_payload_type , # RW; video type to be decoded
"display_frame_num": display_frame_num, # RW, Range: [0, 16]; display frame num
"video_param": hi_vdec_video_param} # structure with video ( h265/h264/VP9)

hi_vdec_chn_param = {"type": hi_payload_type , # RW; video type to be decoded
"display_frame_num": display_frame_num, # RW, Range: [0, 16]; display frame num
"pic_param": hi_vdec_param_picture } # structure with picture (jpeg)

成员

成员名称描述
type整型,解码协议。
display_frame_num整型,解码缓存图像的最小帧数。 取值范围:[0, 16]。 Default:2。
video_param字典,视频(H.264/H.265)解码高级参数。
pic_param字典,图片(JPEG)解码高级参数。

父主题: 视频/图像解码

hi_vdec_dec_err

说明

定义解码错误信息字典。

定义

hi_vdec_dec_err = {"set_pic_size_err": set_pic_size_err, # R; Picture width or height is larger than channel width or height.
"set_protocol_num_err": set_protocol_num_err, # R; Protocol num is not enough. eg: slice, pps, sps.
"set_ref_num_err": set_ref_num_err, # R; Reference num is not enough.
"set_pic_buf_size_err": set_pic_buf_size_err, # R; The buffer size of picture is not enough.
"format_err": format_err, # R; Format error. eg: do not support filed.
"stream_unsupport": stream_unsupport, # R; Unsupported the stream specification.
"pack_err": pack_err # R; Stream package error.
"stream_size_over": stream_size_over, # R; the stream size is too big and force discard stream
"stream_not_release": stream_not_release } # R; the stream not released for too long time

成员

成员描述
set_pic_size_err整型,图像的宽(或高)比通道的宽(或高)大,预留参数。
set_protocol_num_err整型,设置的协议参数个数不足。比如:Slice/Pps/Sps个数。此参数仅对H.264/H.265解码有效。
set_ref_num_err整型,设置的参考帧个数不足。此参数仅对H.264/H.265解码有效。
set_pic_buf_size_err整型,图像buffer内存大小不足。
format_err整型,不支持的格式。JPEG的Progressive码流。
stream_unsupport整型,不支持的规格(码流规格与昇腾AI处理器宣称支持的规格不一致)。
pack_err整型,码流存在错误。
stream_size_over整型,在一帧中的码流过大,当整个SCDbuffer都装不下一帧码流时,强制清空SCDbuffer。 此参数仅对H.264/H.265解码有效。
stream_not_release整型,VFMW (video firmware)内部管理码流错误,出现长时间不释放码流的情况,预留参数。

父主题: 视频/图像解码

hi_vdec_chn_status

说明

定义通道状态字典。

定义

hi_vdec_chn_status = {"type": hi_payload_type, # R; video type to be decoded
"left_stream_bytes": left_stream_bytes, # R; left stream bytes waiting for decode
"left_stream_frames": left_stream_frames, # R; left frames waiting for decode,only valid for HI_VDEC_SEND_MODE_FRAME
"left_decoded_frames": left_decoded_frames, # R; pics waiting for output.
"is_started": is_started, # R; had started recv stream?
"recv_stream_frames": recv_stream_frames, # R; how many frames of stream has been received. valid when send by frame.
"dec_stream_frames": dec_stream_frames, # R; how many frames of stream has been decoded. valid when send by frame.
"dec_err": hi_vdec_dec_err, # R; information about decode error.
"width": width,
"height": height,
"latest_frame_pts": latest_frame_pts }

成员

成员名称描述
type整型,解码协议。
left_stream_bytes整型,码流buffer中待解码的byte数,包括正在解码的当前帧中未解码的byte数。
left_stream_frames整型,码流buffer中待解码的帧数,不包括正在解码的当前帧。-1表示无效。仅按帧发送时有效。
left_decoded_frames整型,图像 buffer 中剩余的 pic 数目。
is_started整型,解码器是否已经启动接收码流。
recv_stream_frames整型,码流 buffer 中已接收码流帧数。-1 表示无效。仅按帧发送时有效。
dec_stream_frames整型,码流 buffer 中已解码帧数。仅按帧发送时有效。
dec_err字典,解码错误信息。
width整型,解码后输出图片的宽。
height整型,解码后输出图片的高。
latest_frame_pts最新解码图像的时间戳。预留参数,暂不支持。

父主题: 视频/图像解码

hi_vdec_stream

说明

定义视频/图像解码的码流字典。

定义

hi_vdec_stream = {"end_of_frame": end_of_frame, # W; is the end of a frame.
"end_of_stream": end_of_stream, # W; is the end of all stream.
"need_display": need_display, # W; is the current frame displayed. only valid by HI_VDEC_SEND_MODE_FRAME.
"pts": pts, # W; time stamp
"private_data": private_data, # W; private data,reserved
"len": len, # W; length of stream
"addr": addr} # W; stream address

成员

成员描述
end_of_frame整型,当前帧是否结束(此值目前暂无效)。
end_of_stream整型,是否发完所有码流。
need_display整型,当前帧是否输出显示。
- 0:不显示,设置为0,输出Buffer无解码结果,且不显示帧按照显示序或解码序输出。
- 1:显示,设置为1,才能输出解码结果,且显示帧按照显示序或解码序输出。
如果解码码流中同时存在不显示帧、显示帧,则系统不保证不显示帧与显示帧之间按照显示序或解码序输出。
pts整型,码流包的时间戳,以us为单位。仅按帧发送时有效。
private_data私有数据。预留参数,暂不支持。
len整型,码流包的长度,以Byte为单位。
addr整型,码流包的地址。

注意事项

  • 按帧发送时,解码图像的时间戳等于码流包中的时间戳。
  • 按流发送时,解码图像的时间戳等于 0。
  • 当发完所有码流后,把end_of_stream设置为1,表示码流文件结束,这时解码器会解完发送下来的所有码流并输出所有图像。如果发完所有码流后把end_of_stream设置为0,解码器内部可能残余大于等于一帧的图像未解码输出,因为解码器必须等到下一帧码流到来才能知道当前帧已经结束,送入解码。
  • VDEC支持发送一包end_of_stream为1的空码流包(地址为空或长度为 0)。

父主题: 视频/图像解码

hi_vdec_supplement_info

说明

定义输出帧补充信息, 暂不支持。

定义

hi_vdec_supplement_info = {"type": hi_payload_type , # RW; Video type to be decoded.
"video_supplement_info": hi_vdec_video_supplement_info} # Structure with video (h265/h264)

父主题: 视频/图像解码

hi_vdec_video_supplement_info

说明

定义输出视频帧补充信息, 暂不支持。

定义

hi_vdec_video_supplement_info = {"frame_type": hi_vdec_frame_type,
"err_rate": err_rate,
"poc": poc}

成员

成员名称描述
frame_type整型,解码帧类型。预留参数,暂未支持。
err_rate整型,错误率。预留参数,暂未支持。
poc整型,poc值。预留参数,暂未支持。

父主题: 视频/图像解码

hi_jpegd_precision_mode

说明

定义JPEGD解码输出图片的宽、高对齐模式。

定义

YUVOUT_ALIGN_DOWN = 0
YUVOUT_ALIGN_UP = 1
YUVOUT_ALIGN_DOWN_COMPAT = 2
成员名称描述
YUVOUT_ALIGN_DOWN默认值。
- 解码后的输出图片格式为YUV420SP时,若源图的宽、高为奇数时,将输出图片的宽、高向下2对齐。
- 解码后的输出图片格式为YUV422SP时,若源图的宽为奇数时,将输出图片的宽向下2对齐。
- 解码后的输出图片格式为YUV440SP时,若源图的高为奇数时,将输出图片高向下2对齐。
YUVOUT_ALIGN_UP- 解码后的输出图片格式为YUV420SP时,若源图的宽、高为奇数时,将输出图片的宽、高向上2对齐。
- 解码后的输出图片格式为YUV422SP时,若源图的宽为奇数时,将输出图片的宽向上2对齐。
- 解码后的输出图片格式为YUV440SP时,若源图的高为奇数时,将输出图片高向上2对齐。
YUVOUT_ALIGN_DOWN_COMPAT兼容旧版本,解码后的输出图片格式为YUV420SP/YUV422SP/YUV440SP时,若源图的宽、高为奇数时,将输出图片的宽、高向下2对齐。

父主题: 视频/图像解码

在线提单