|
发表于 2021-11-18 15:02:51
浏览:6233
|
回复:2
打印
只看该作者
[复制链接]
楼主
你好,
用示例例程测试vdec功能,创建通道时直接报-33错误,麻烦看下,谢谢
- int main(int argc, char *argv[])
- {
- int ret=0;
-
- signal(SIGINT, sigterm_handler);
-
- RK_MPI_SYS_Init();//初始化 MPI 系统
- //设置decode属性
- VDEC_CHN_ATTR_S stVdecAttr;
- stVdecAttr.enCodecType = RK_CODEC_TYPE_H264;
- stVdecAttr.enMode = VIDEO_MODE_STREAM;
- stVdecAttr.enDecodecMode = VIDEO_DECODEC_HADRWARE;
- ret = RK_MPI_VDEC_CreateChn(0, &stVdecAttr);
- if (ret) {
- printf("Create Vdec[0] failed! ret=%d\n", ret);
- return -1;
- }
- //设置decode有数据时 回调
- MPP_CHN_S VdecChn; //定义模块设备通道结构体。
- VdecChn.enModId = RK_ID_VDEC;
- VdecChn.s32DevId = 0;
- VdecChn.s32ChnId = 0;
- ret = RK_MPI_SYS_RegisterOutCb(&VdecChn, vdec_packet_cb); //注册数据输出回调。
- if (ret) {
- printf("ERROR: register output callback for Vdec[0] error! ret=%d\n", ret);
- return 0;
- }
- // H264 编码.
- VENC_CHN_ATTR_S venc_chn_attr;
- memset(&venc_chn_attr, 0, sizeof(venc_chn_attr));
- venc_chn_attr.stVencAttr.enType = RK_CODEC_TYPE_H264;
- venc_chn_attr.stVencAttr.imageType = IMAGE_TYPE_NV12;
- venc_chn_attr.stVencAttr.u32PicWidth = 1920;
- venc_chn_attr.stVencAttr.u32PicHeight = 1080;
- venc_chn_attr.stVencAttr.u32VirWidth = 1920;
- venc_chn_attr.stVencAttr.u32VirHeight = 1080+8;
- venc_chn_attr.stVencAttr.u32Profile = 77; //支持66,77,100三个等级
- venc_chn_attr.stRcAttr.enRcMode = VENC_RC_MODE_H264CBR;
- venc_chn_attr.stRcAttr.stH264Cbr.u32Gop = 25;
- venc_chn_attr.stRcAttr.stH264Cbr.u32BitRate =
- 1920 * 1080 * 25 ;
- venc_chn_attr.stRcAttr.stH264Cbr.fr32DstFrameRateDen = 1;
- venc_chn_attr.stRcAttr.stH264Cbr.fr32DstFrameRateNum = 25;
- venc_chn_attr.stRcAttr.stH264Cbr.u32SrcFrameRateDen = 1;
- venc_chn_attr.stRcAttr.stH264Cbr.u32SrcFrameRateNum = 25;
- ret = RK_MPI_VENC_CreateChn(0, &venc_chn_attr);
- if (ret) {
- printf("Create Venc(H265) failed! ret=%d\n", ret);
- return -1;
- }
复制代码
错误log如下:
media get entity by name: rkcif-lvds-subdev is null
media get entity by name: rkisp-mpfbc-subdev is null
media get entity by name: rkisp_dmapath is null
media get entity by name: rkisp-mpfbc-subdev is null
media get entity by name: rkisp_dmapath is null
media get entity by name: rockchip-mipi-dphy-rx is null
librga:RGA_GET_VERSION:3.02,3.020000
ctx=0x2b980,ctx->rgaFd=3
Rga built version:2.0.0
Rga built version:2.0.0
##RKMEDIA Log level: 2
[RKMEDIA][SYS][Info]:text is all=2
[RKMEDIA][SYS][Info]:module is all, log_level is 2
[RKMEDIA][SYS][Info]:RK_MPI_VDEC_CreateChn: Enable VDEC[0] Start...
mpp[1830]: mpp_info: mpp version: unknown mpp version for missing VCS info
[RKMEDIA][VDEC][Info]:mpi control MPP_DEC_SET_PARSER_SPLIT_MODE ret = 0
mpp[1830]: mpp_rt: NOT found ion allocator
mpp[1830]: mpp_rt: found drm allocator
mpp[1830]: mpp_log: got the /dev/mpp_service
[RKMEDIA][VDEC][Info]:mpi set group limit = 16
[RKMEDIA][SYS][Info]:RK_MPI_VDEC_CreateChn: Enable VDEC[0] End!
main 1
[RKMEDIA][SYS][Info]:RK_MPI_VENC_CreateChn: Enable VENC[0], Type:6 Start...
mpp[1830]: mpp_info: mpp version: unknown mpp version for missing VCS info
mpp[1830]: mpp_log: got the /dev/mpp_service
[RKMEDIA][VENC][Info]:MPP Encoder: MPPConfig: cfg init sucess!
[RKMEDIA][VENC][Info]:MPP Encoder: qpMaxi use default value:48
[RKMEDIA][VENC][Info]:MPP Encoder: qpMini use default value:8
[RKMEDIA][VENC][Info]:MPP Encoder: qpMax use default value:48
[RKMEDIA][VENC][Info]:MPP Encoder: qpMin use default value:8
[RKMEDIA][VENC][Info]:MPP Encoder: qpInit use default value:-1
[RKMEDIA][VENC][Info]:MPP Encoder: qpStep use default value:2
[RKMEDIA][VENC][Info]:MPP Encoder: rotaion = 0
[RKMEDIA][VENC][Info]:MPP Encoder: automatically calculate bsp with bps_target
[RKMEDIA][VENC][Info]:MPP Encoder: Set output block mode.
[RKMEDIA][VENC][Info]:MPP Encoder: Set input block mode.
mpp[1830]: mpp_enc_cfg: mpp_enc_cfg_set_s32 failed to set rc:qp_init to -1
mpp[1830]: mpp_enc_cfg: mpp_enc_cfg_set_s32 failed to set rc:qp_max to 48
mpp[1830]: mpp_enc_cfg: mpp_enc_cfg_set_s32 failed to set rc:qp_min to 8
mpp[1830]: mpp_enc_cfg: mpp_enc_cfg_set_s32 failed to set rc:qp_max_i to 48
mpp[1830]: mpp_enc_cfg: mpp_enc_cfg_set_s32 failed to set rc:qp_min_i to 8
[RKMEDIA][VENC][Info]:MPP Encoder: bps:[2304000,2073600,1843200] fps: [25/1]->[25/1], gop:25 qpInit:-1, qpMin:8, qpMax:48, qpMinI:8, qpMaxI:48.
[RKMEDIA][VENC][Info]:MPP Encoder: AVC: encode profile 77 level 0
[RKMEDIA][VENC][Error]:MPP Encoder: cfg set s32 failed ret -1
[RKMEDIA][VENC][Info]:Fail to init config, rkmpp
[RKMEDIA][VENC][Info]:MPP Encoder: MPPConfig: cfg deinit done!
[RKMEDIA][SYS][Info]:mpp destroy ctx done
Create Venc(H264) failed! ret=-33
mpp[1830]: mpp_meta: Assertion list_empty(&mlist_meta) failed at ~MppMetaService:112
mpp[1830]: mpp_buffer: ~MppBufferService cleaning leaked group
mpp[1830]: mpp_buffer: ~MppBufferService cleaning leaked buffer
free(): invalid pointer
Aborted (core dumped) |
|