2064
- 收藏
- 点赞
- 分享
- 举报
HI3519V101 ONline 模式 VI 绑定 VENC 无输出
各位好,
小弟初从TI平台转到Hi平台,买了一个Hi3519V101的官方开发板,改了sample venc 里面的一个Demo。原有数据路径是 IMX274 -> VIN0->VPSS->VENC 是这么个绑定关心,运行也没啥问题。我想改成 IMX274 -> VIN0->VENC, 就是去掉VPSS,改完之后。程序运行无报错,但是采集不到数据了。不知道为啥?不能这么改吗?请帮忙分析一下。
HI_S32 SAMPLE_VENC_NORMALP_CLASSIC(HI_VOID)
{
PAYLOAD_TYPE_E enPayLoad[2]= {PT_H265, PT_H264};
PIC_SIZE_E enSize[2] = {PIC_UHD4K, PIC_HD1080};
VENC_GOP_ATTR_S stGopAttr;
VENC_GOP_MODE_E enGopMode[2] = {VENC_GOPMODE_NORMALP,VENC_GOPMODE_NORMALP};
HI_U32 u32Profile = 0;
VB_CONF_S stVbConf;
SAMPLE_VI_CONFIG_S stViConfig = {0};
VPSS_GRP VpssGrp;
VPSS_CHN VpssChn;
VPSS_GRP_ATTR_S stVpssGrpAttr = {0};
VPSS_CHN_ATTR_S stVpssChnAttr = {0};
VPSS_CHN_MODE_S stVpssChnMode;
VENC_CHN VencChn = 0;
VI_CHN ViChn = 0;
SAMPLE_RC_E enRcMode= SAMPLE_RC_CBR;
HI_S32 s32ChnNum=1;
HI_S32 s32Ret = HI_SUCCESS;
HI_U32 u32BlkSize;
SIZE_S stSize;
char c;
/******************************************
step 1: init sys variable
******************************************/
memset(&stVbConf,0,sizeof(VB_CONF_S));
// SAMPLE_COMM_VI_GetSizeBySensor(&enSize[0]);
stVbConf.u32MaxPoolCnt = 128;
//printf("s32ChnNum:%d,Sensor Size:%d\n",s32ChnNum,enSize[0]);
/*video buffer*/
if(s32ChnNum >= 1)
{
u32BlkSize = SAMPLE_COMM_SYS_CalcPicVbBlkSize(gs_enNorm,\
enSize[0], SAMPLE_PIXEL_FORMAT, SAMPLE_SYS_ALIGN_WIDTH);
stVbConf.astCommPool[0].u32BlkSize = u32BlkSize;
stVbConf.astCommPool[0].u32BlkCnt = 10;
}
/******************************************
step 2: mpp system init.
******************************************/
s32Ret = SAMPLE_COMM_SYS_Init(&stVbConf);
if (HI_SUCCESS != s32Ret)
{
SAMPLE_PRT("system init failed with %d!\n", s32Ret);
goto END_VENC_1080P_CLASSIC_0;
}
/******************************************
step 3: start vi dev & chn to capture
******************************************/
stViConfig.enViMode = SENSOR_TYPE;
stViConfig.enRotate = ROTATE_NONE;
stViConfig.enNorm = VIDEO_ENCODING_MODE_AUTO;
stViConfig.enViChnSet = VI_CHN_SET_NORMAL;
stViConfig.enWDRMode = WDR_MODE_NONE;
// s32Ret = SAMPLE_COMM_VI_StartVi(&stViConfig);
s32Ret = SAMPLE_COMM_VI_StartIspAndVi(&stViConfig);
if (HI_SUCCESS != s32Ret)
{
SAMPLE_PRT("start vi failed!\n");
goto END_VENC_1080P_CLASSIC_1;
}
// /******************************************
// step 4: start vpss and vi bind vpss
// ******************************************/
// s32Ret = SAMPLE_COMM_SYS_GetPicSize(gs_enNorm, enSize[0], &stSize);
// if (HI_SUCCESS != s32Ret)
// {
// SAMPLE_PRT("SAMPLE_COMM_SYS_GetPicSize failed!\n");
// goto END_VENC_1080P_CLASSIC_1;
// }
//
// if(s32ChnNum >= 1)
// {
// VpssGrp = 0;
// stVpssGrpAttr.u32MaxW = stSize.u32Width;
// stVpssGrpAttr.u32MaxH = stSize.u32Height;
// stVpssGrpAttr.bIeEn = HI_FALSE;
// stVpssGrpAttr.bNrEn = HI_TRUE;
// stVpssGrpAttr.stNrAttr.enNrType = VPSS_NR_TYPE_VIDEO;
// stVpssGrpAttr.stNrAttr.stNrVideoAttr.enNrRefSource = VPSS_NR_REF_FROM_RFR;
// stVpssGrpAttr.stNrAttr.u32RefFrameNum = 2;
// stVpssGrpAttr.bHistEn = HI_FALSE;
// stVpssGrpAttr.bDciEn = HI_FALSE;
// stVpssGrpAttr.enDieMode = VPSS_DIE_MODE_NODIE;
// stVpssGrpAttr.enPixFmt = SAMPLE_PIXEL_FORMAT;
// stVpssGrpAttr.bStitchBlendEn = HI_FALSE;
//
// s32Ret = SAMPLE_COMM_VPSS_StartGroup(VpssGrp, &stVpssGrpAttr);
// if (HI_SUCCESS != s32Ret)
// {
// SAMPLE_PRT("Start Vpss failed!\n");
// goto END_VENC_1080P_CLASSIC_2;
// }
//
// s32Ret = SAMPLE_COMM_VI_BindVpss(stViConfig.enViMode);
// if (HI_SUCCESS != s32Ret)
// {
// SAMPLE_PRT("Vi bind Vpss failed!\n");
// goto END_VENC_1080P_CLASSIC_3;
// }
//
// VpssChn = 0;
// stVpssChnMode.enChnMode = VPSS_CHN_MODE_USER;
// stVpssChnMode.bDouble = HI_FALSE;
// stVpssChnMode.enPixelFormat = SAMPLE_PIXEL_FORMAT;
// stVpssChnMode.u32Width = stSize.u32Width;
// stVpssChnMode.u32Height = stSize.u32Height;
// stVpssChnMode.enCompressMode = COMPRESS_MODE_SEG;
// memset(&stVpssChnAttr, 0, sizeof(stVpssChnAttr));
// stVpssChnAttr.s32SrcFrameRate = -1;
// stVpssChnAttr.s32DstFrameRate = -1;
// s32Ret = SAMPLE_COMM_VPSS_EnableChn(VpssGrp, VpssChn, &stVpssChnAttr, &stVpssChnMode, HI_NULL);
// if (HI_SUCCESS != s32Ret)
// {
// SAMPLE_PRT("Enable vpss chn failed!\n");
// goto END_VENC_1080P_CLASSIC_4;
// }
// }
/******************************************
step 5: start stream venc
******************************************/
enRcMode = SAMPLE_RC_CBR;
/*** enSize[0] **/
if(s32ChnNum >= 1)
{
VencChn = 0;
ViChn = 0;
s32Ret = SAMPLE_COMM_VENC_GetGopAttr(enGopMode[0],&stGopAttr,gs_enNorm);
if (HI_SUCCESS != s32Ret)
{
SAMPLE_PRT("Get GopAttr failed!\n");
goto END_VENC_1080P_CLASSIC_5;
}
VENC_CHN_ATTR_S stVencChnAttr;
VENC_ATTR_H265_S stH265Attr;
VENC_ATTR_H265_CBR_S stH265Cbr;
SIZE_S stPicSize;
stPicSize.u32Width = 3840;
stPicSize.u32Height = 2160;
stVencChnAttr.stVeAttr.enType = enPayLoad[0];
stH265Attr.u32MaxPicWidth = stPicSize.u32Width;
stH265Attr.u32MaxPicHeight = stPicSize.u32Height;
stH265Attr.u32PicWidth = stPicSize.u32Width;/*the picture width*/
stH265Attr.u32PicHeight = stPicSize.u32Height;/*the picture height*/
stH265Attr.u32BufSize = stPicSize.u32Width * stPicSize.u32Height * 2;/*stream buffer size*/
stH265Attr.u32Profile = 0;
stH265Attr.bByFrame = HI_TRUE;/*get stream mode is slice mode or frame mode?*/
stVencChnAttr.stRcAttr.enRcMode = VENC_RC_MODE_H265CBR;
stH265Cbr.u32Gop = (VIDEO_ENCODING_MODE_PAL == gs_enNorm) ? 25 : 30;
stH265Cbr.u32StatTime = 1; /* stream rate statics time(s) */
stH265Cbr.u32SrcFrmRate = (VIDEO_ENCODING_MODE_PAL == gs_enNorm) ? 25 : 30; /* input (vi) frame rate */
stH265Cbr.fr32DstFrmRate = (VIDEO_ENCODING_MODE_PAL == gs_enNorm) ? 25 : 30; /* target frame rate */
stH265Cbr.u32BitRate = 1024 * 8;
stH265Cbr.u32FluctuateLevel = 1; /* average bit rate */
memcpy(&stVencChnAttr.stVeAttr.stAttrH265e, &stH265Attr, sizeof(VENC_ATTR_H265_S));
memcpy(&stVencChnAttr.stRcAttr.stAttrH265Cbr, &stH265Cbr, sizeof(VENC_ATTR_H265_CBR_S));
memcpy(&stVencChnAttr.stGopAttr,&stGopAttr,sizeof(VENC_GOP_ATTR_S));
s32Ret = HI_MPI_VENC_CreateChn(VencChn, &stVencChnAttr);
if (HI_SUCCESS != s32Ret)
{
SAMPLE_PRT("HI_MPI_VENC_CreateChn [%d] faild with %#x! ===\n", \
VencChn, s32Ret);
return s32Ret;
}
MPP_CHN_S stSrcChn;
MPP_CHN_S stDestChn;
stSrcChn.enModId = HI_ID_VIU;
stSrcChn.s32DevId = 0;
stSrcChn.s32ChnId = ViChn;
stDestChn.enModId = HI_ID_VENC;
stDestChn.s32DevId = 0;
stDestChn.s32ChnId = VencChn;
s32Ret = HI_MPI_SYS_Bind(&stSrcChn, &stDestChn);
if (s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("failed with %#x!\n", s32Ret);
return HI_FAILURE;
}
s32Ret = HI_MPI_VENC_StartRecvPic(VencChn);
if (HI_SUCCESS != s32Ret)
{
SAMPLE_PRT("HI_MPI_VENC_StartRecvPic faild with%#x! \n", s32Ret);
return HI_FAILURE;
}
// MPP_CHN_S stSrcChn;
// MPP_CHN_S stDestChn;
// stSrcChn.enModId = HI_ID_VPSS;
// stSrcChn.s32DevId = VpssGrp;
// stSrcChn.s32ChnId = VpssChn;
// stDestChn.enModId = HI_ID_VENC;
// stDestChn.s32DevId = 0;
// stDestChn.s32ChnId = VencChn;
// s32Ret = HI_MPI_SYS_Bind(&stSrcChn, &stDestChn);
// if (s32Ret != HI_SUCCESS)
// {
// SAMPLE_PRT("failed with %#x!\n", s32Ret);
// return HI_FAILURE;
// }
}
/******************************************
step 6: stream venc process -- get stream, then save it to file.
******************************************/
s32Ret = SAMPLE_COMM_VENC_StartGetStream(s32ChnNum);
if (HI_SUCCESS != s32Ret)
{
SAMPLE_PRT("Start Venc failed!\n");
goto END_VENC_1080P_CLASSIC_5;
}
printf("please press ENTER to exit this sample\n");
getchar();
//sleep(20000);
/******************************************
step 7: exit process
******************************************/
SAMPLE_COMM_VENC_StopGetStream();
END_VENC_1080P_CLASSIC_5:
VpssGrp = 0;
switch(s32ChnNum)
{
case 2:
VpssChn = 1;
VencChn = 1;
SAMPLE_COMM_VENC_UnBindVpss(VencChn, VpssGrp, VpssChn);
SAMPLE_COMM_VENC_Stop(VencChn);
case 1:
VpssChn = 0;
VencChn = 0;
SAMPLE_COMM_VENC_UnBindVpss(VencChn, VpssGrp, VpssChn);
SAMPLE_COMM_VENC_Stop(VencChn);
break;
}
SAMPLE_COMM_VI_UnBindVpss(stViConfig.enViMode);
END_VENC_1080P_CLASSIC_4: //vpss stop
VpssGrp = 0;
switch(s32ChnNum)
{
case 2:
VpssChn = 1;
SAMPLE_COMM_VPSS_DisableChn(VpssGrp, VpssChn);
case 1:
VpssChn = 0;
SAMPLE_COMM_VPSS_DisableChn(VpssGrp, VpssChn);
break;
}
END_VENC_1080P_CLASSIC_3: //vpss stop
SAMPLE_COMM_VI_UnBindVpss(stViConfig.enViMode);
END_VENC_1080P_CLASSIC_2: //vpss stop
SAMPLE_COMM_VPSS_StopGroup(VpssGrp);
END_VENC_1080P_CLASSIC_1: //vi stop
SAMPLE_COMM_VI_StopVi(&stViConfig);
END_VENC_1080P_CLASSIC_0: //system exit
SAMPLE_COMM_SYS_Exit();
return s32Ret;
}
--------------------------------------------------------------------------------------------------------------
APP log
/home/antimax # ./sample_venc
============= MipiDev 0, SetMipiAttr enWDRMode: 0
SAMPLE_COMM_ISP_Sensor_Regiter_callback isp_dev = 0
Func: SAMPLE_COMM_ISP_Init, Line: 677, WDR Mode: 0
stPubAttr (0, 0, 3840, 2160, 30.000000)
linear mode
IMX274 4K2K_6CH_12BIT_29.97FPS init succuss!
Func: SAMPLE_COMM_ISP_Init, Line: 702 end IspDev:0.
ISP Dev 0 HI_MPI_ISP_Run
please press ENTER to exit this sample
[SAMPLE_COMM_VENC_GetVencStreamProc]-1615: get venc stream time out, exit thread
[SAMPLE_COMM_VPSS_DisableChn]-213: SAMPLE_COMM_VPSS_DisableChn failed with 0xa0078005
[SAMPLE_COMM_VPSS_StopGroup]-180: SAMPLE_COMM_VPSS_StopGroup failed with 0xa0078005
program exit normally
小弟初从TI平台转到Hi平台,买了一个Hi3519V101的官方开发板,改了sample venc 里面的一个Demo。原有数据路径是 IMX274 -> VIN0->VPSS->VENC 是这么个绑定关心,运行也没啥问题。我想改成 IMX274 -> VIN0->VENC, 就是去掉VPSS,改完之后。程序运行无报错,但是采集不到数据了。不知道为啥?不能这么改吗?请帮忙分析一下。
HI_S32 SAMPLE_VENC_NORMALP_CLASSIC(HI_VOID)
{
PAYLOAD_TYPE_E enPayLoad[2]= {PT_H265, PT_H264};
PIC_SIZE_E enSize[2] = {PIC_UHD4K, PIC_HD1080};
VENC_GOP_ATTR_S stGopAttr;
VENC_GOP_MODE_E enGopMode[2] = {VENC_GOPMODE_NORMALP,VENC_GOPMODE_NORMALP};
HI_U32 u32Profile = 0;
VB_CONF_S stVbConf;
SAMPLE_VI_CONFIG_S stViConfig = {0};
VPSS_GRP VpssGrp;
VPSS_CHN VpssChn;
VPSS_GRP_ATTR_S stVpssGrpAttr = {0};
VPSS_CHN_ATTR_S stVpssChnAttr = {0};
VPSS_CHN_MODE_S stVpssChnMode;
VENC_CHN VencChn = 0;
VI_CHN ViChn = 0;
SAMPLE_RC_E enRcMode= SAMPLE_RC_CBR;
HI_S32 s32ChnNum=1;
HI_S32 s32Ret = HI_SUCCESS;
HI_U32 u32BlkSize;
SIZE_S stSize;
char c;
/******************************************
step 1: init sys variable
******************************************/
memset(&stVbConf,0,sizeof(VB_CONF_S));
// SAMPLE_COMM_VI_GetSizeBySensor(&enSize[0]);
stVbConf.u32MaxPoolCnt = 128;
//printf("s32ChnNum:%d,Sensor Size:%d\n",s32ChnNum,enSize[0]);
/*video buffer*/
if(s32ChnNum >= 1)
{
u32BlkSize = SAMPLE_COMM_SYS_CalcPicVbBlkSize(gs_enNorm,\
enSize[0], SAMPLE_PIXEL_FORMAT, SAMPLE_SYS_ALIGN_WIDTH);
stVbConf.astCommPool[0].u32BlkSize = u32BlkSize;
stVbConf.astCommPool[0].u32BlkCnt = 10;
}
/******************************************
step 2: mpp system init.
******************************************/
s32Ret = SAMPLE_COMM_SYS_Init(&stVbConf);
if (HI_SUCCESS != s32Ret)
{
SAMPLE_PRT("system init failed with %d!\n", s32Ret);
goto END_VENC_1080P_CLASSIC_0;
}
/******************************************
step 3: start vi dev & chn to capture
******************************************/
stViConfig.enViMode = SENSOR_TYPE;
stViConfig.enRotate = ROTATE_NONE;
stViConfig.enNorm = VIDEO_ENCODING_MODE_AUTO;
stViConfig.enViChnSet = VI_CHN_SET_NORMAL;
stViConfig.enWDRMode = WDR_MODE_NONE;
// s32Ret = SAMPLE_COMM_VI_StartVi(&stViConfig);
s32Ret = SAMPLE_COMM_VI_StartIspAndVi(&stViConfig);
if (HI_SUCCESS != s32Ret)
{
SAMPLE_PRT("start vi failed!\n");
goto END_VENC_1080P_CLASSIC_1;
}
// /******************************************
// step 4: start vpss and vi bind vpss
// ******************************************/
// s32Ret = SAMPLE_COMM_SYS_GetPicSize(gs_enNorm, enSize[0], &stSize);
// if (HI_SUCCESS != s32Ret)
// {
// SAMPLE_PRT("SAMPLE_COMM_SYS_GetPicSize failed!\n");
// goto END_VENC_1080P_CLASSIC_1;
// }
//
// if(s32ChnNum >= 1)
// {
// VpssGrp = 0;
// stVpssGrpAttr.u32MaxW = stSize.u32Width;
// stVpssGrpAttr.u32MaxH = stSize.u32Height;
// stVpssGrpAttr.bIeEn = HI_FALSE;
// stVpssGrpAttr.bNrEn = HI_TRUE;
// stVpssGrpAttr.stNrAttr.enNrType = VPSS_NR_TYPE_VIDEO;
// stVpssGrpAttr.stNrAttr.stNrVideoAttr.enNrRefSource = VPSS_NR_REF_FROM_RFR;
// stVpssGrpAttr.stNrAttr.u32RefFrameNum = 2;
// stVpssGrpAttr.bHistEn = HI_FALSE;
// stVpssGrpAttr.bDciEn = HI_FALSE;
// stVpssGrpAttr.enDieMode = VPSS_DIE_MODE_NODIE;
// stVpssGrpAttr.enPixFmt = SAMPLE_PIXEL_FORMAT;
// stVpssGrpAttr.bStitchBlendEn = HI_FALSE;
//
// s32Ret = SAMPLE_COMM_VPSS_StartGroup(VpssGrp, &stVpssGrpAttr);
// if (HI_SUCCESS != s32Ret)
// {
// SAMPLE_PRT("Start Vpss failed!\n");
// goto END_VENC_1080P_CLASSIC_2;
// }
//
// s32Ret = SAMPLE_COMM_VI_BindVpss(stViConfig.enViMode);
// if (HI_SUCCESS != s32Ret)
// {
// SAMPLE_PRT("Vi bind Vpss failed!\n");
// goto END_VENC_1080P_CLASSIC_3;
// }
//
// VpssChn = 0;
// stVpssChnMode.enChnMode = VPSS_CHN_MODE_USER;
// stVpssChnMode.bDouble = HI_FALSE;
// stVpssChnMode.enPixelFormat = SAMPLE_PIXEL_FORMAT;
// stVpssChnMode.u32Width = stSize.u32Width;
// stVpssChnMode.u32Height = stSize.u32Height;
// stVpssChnMode.enCompressMode = COMPRESS_MODE_SEG;
// memset(&stVpssChnAttr, 0, sizeof(stVpssChnAttr));
// stVpssChnAttr.s32SrcFrameRate = -1;
// stVpssChnAttr.s32DstFrameRate = -1;
// s32Ret = SAMPLE_COMM_VPSS_EnableChn(VpssGrp, VpssChn, &stVpssChnAttr, &stVpssChnMode, HI_NULL);
// if (HI_SUCCESS != s32Ret)
// {
// SAMPLE_PRT("Enable vpss chn failed!\n");
// goto END_VENC_1080P_CLASSIC_4;
// }
// }
/******************************************
step 5: start stream venc
******************************************/
enRcMode = SAMPLE_RC_CBR;
/*** enSize[0] **/
if(s32ChnNum >= 1)
{
VencChn = 0;
ViChn = 0;
s32Ret = SAMPLE_COMM_VENC_GetGopAttr(enGopMode[0],&stGopAttr,gs_enNorm);
if (HI_SUCCESS != s32Ret)
{
SAMPLE_PRT("Get GopAttr failed!\n");
goto END_VENC_1080P_CLASSIC_5;
}
VENC_CHN_ATTR_S stVencChnAttr;
VENC_ATTR_H265_S stH265Attr;
VENC_ATTR_H265_CBR_S stH265Cbr;
SIZE_S stPicSize;
stPicSize.u32Width = 3840;
stPicSize.u32Height = 2160;
stVencChnAttr.stVeAttr.enType = enPayLoad[0];
stH265Attr.u32MaxPicWidth = stPicSize.u32Width;
stH265Attr.u32MaxPicHeight = stPicSize.u32Height;
stH265Attr.u32PicWidth = stPicSize.u32Width;/*the picture width*/
stH265Attr.u32PicHeight = stPicSize.u32Height;/*the picture height*/
stH265Attr.u32BufSize = stPicSize.u32Width * stPicSize.u32Height * 2;/*stream buffer size*/
stH265Attr.u32Profile = 0;
stH265Attr.bByFrame = HI_TRUE;/*get stream mode is slice mode or frame mode?*/
stVencChnAttr.stRcAttr.enRcMode = VENC_RC_MODE_H265CBR;
stH265Cbr.u32Gop = (VIDEO_ENCODING_MODE_PAL == gs_enNorm) ? 25 : 30;
stH265Cbr.u32StatTime = 1; /* stream rate statics time(s) */
stH265Cbr.u32SrcFrmRate = (VIDEO_ENCODING_MODE_PAL == gs_enNorm) ? 25 : 30; /* input (vi) frame rate */
stH265Cbr.fr32DstFrmRate = (VIDEO_ENCODING_MODE_PAL == gs_enNorm) ? 25 : 30; /* target frame rate */
stH265Cbr.u32BitRate = 1024 * 8;
stH265Cbr.u32FluctuateLevel = 1; /* average bit rate */
memcpy(&stVencChnAttr.stVeAttr.stAttrH265e, &stH265Attr, sizeof(VENC_ATTR_H265_S));
memcpy(&stVencChnAttr.stRcAttr.stAttrH265Cbr, &stH265Cbr, sizeof(VENC_ATTR_H265_CBR_S));
memcpy(&stVencChnAttr.stGopAttr,&stGopAttr,sizeof(VENC_GOP_ATTR_S));
s32Ret = HI_MPI_VENC_CreateChn(VencChn, &stVencChnAttr);
if (HI_SUCCESS != s32Ret)
{
SAMPLE_PRT("HI_MPI_VENC_CreateChn [%d] faild with %#x! ===\n", \
VencChn, s32Ret);
return s32Ret;
}
MPP_CHN_S stSrcChn;
MPP_CHN_S stDestChn;
stSrcChn.enModId = HI_ID_VIU;
stSrcChn.s32DevId = 0;
stSrcChn.s32ChnId = ViChn;
stDestChn.enModId = HI_ID_VENC;
stDestChn.s32DevId = 0;
stDestChn.s32ChnId = VencChn;
s32Ret = HI_MPI_SYS_Bind(&stSrcChn, &stDestChn);
if (s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("failed with %#x!\n", s32Ret);
return HI_FAILURE;
}
s32Ret = HI_MPI_VENC_StartRecvPic(VencChn);
if (HI_SUCCESS != s32Ret)
{
SAMPLE_PRT("HI_MPI_VENC_StartRecvPic faild with%#x! \n", s32Ret);
return HI_FAILURE;
}
// MPP_CHN_S stSrcChn;
// MPP_CHN_S stDestChn;
// stSrcChn.enModId = HI_ID_VPSS;
// stSrcChn.s32DevId = VpssGrp;
// stSrcChn.s32ChnId = VpssChn;
// stDestChn.enModId = HI_ID_VENC;
// stDestChn.s32DevId = 0;
// stDestChn.s32ChnId = VencChn;
// s32Ret = HI_MPI_SYS_Bind(&stSrcChn, &stDestChn);
// if (s32Ret != HI_SUCCESS)
// {
// SAMPLE_PRT("failed with %#x!\n", s32Ret);
// return HI_FAILURE;
// }
}
/******************************************
step 6: stream venc process -- get stream, then save it to file.
******************************************/
s32Ret = SAMPLE_COMM_VENC_StartGetStream(s32ChnNum);
if (HI_SUCCESS != s32Ret)
{
SAMPLE_PRT("Start Venc failed!\n");
goto END_VENC_1080P_CLASSIC_5;
}
printf("please press ENTER to exit this sample\n");
getchar();
//sleep(20000);
/******************************************
step 7: exit process
******************************************/
SAMPLE_COMM_VENC_StopGetStream();
END_VENC_1080P_CLASSIC_5:
VpssGrp = 0;
switch(s32ChnNum)
{
case 2:
VpssChn = 1;
VencChn = 1;
SAMPLE_COMM_VENC_UnBindVpss(VencChn, VpssGrp, VpssChn);
SAMPLE_COMM_VENC_Stop(VencChn);
case 1:
VpssChn = 0;
VencChn = 0;
SAMPLE_COMM_VENC_UnBindVpss(VencChn, VpssGrp, VpssChn);
SAMPLE_COMM_VENC_Stop(VencChn);
break;
}
SAMPLE_COMM_VI_UnBindVpss(stViConfig.enViMode);
END_VENC_1080P_CLASSIC_4: //vpss stop
VpssGrp = 0;
switch(s32ChnNum)
{
case 2:
VpssChn = 1;
SAMPLE_COMM_VPSS_DisableChn(VpssGrp, VpssChn);
case 1:
VpssChn = 0;
SAMPLE_COMM_VPSS_DisableChn(VpssGrp, VpssChn);
break;
}
END_VENC_1080P_CLASSIC_3: //vpss stop
SAMPLE_COMM_VI_UnBindVpss(stViConfig.enViMode);
END_VENC_1080P_CLASSIC_2: //vpss stop
SAMPLE_COMM_VPSS_StopGroup(VpssGrp);
END_VENC_1080P_CLASSIC_1: //vi stop
SAMPLE_COMM_VI_StopVi(&stViConfig);
END_VENC_1080P_CLASSIC_0: //system exit
SAMPLE_COMM_SYS_Exit();
return s32Ret;
}
--------------------------------------------------------------------------------------------------------------
APP log
/home/antimax # ./sample_venc
============= MipiDev 0, SetMipiAttr enWDRMode: 0
SAMPLE_COMM_ISP_Sensor_Regiter_callback isp_dev = 0
Func: SAMPLE_COMM_ISP_Init, Line: 677, WDR Mode: 0
stPubAttr (0, 0, 3840, 2160, 30.000000)
linear mode
IMX274 4K2K_6CH_12BIT_29.97FPS init succuss!
Func: SAMPLE_COMM_ISP_Init, Line: 702 end IspDev:0.
ISP Dev 0 HI_MPI_ISP_Run
please press ENTER to exit this sample
[SAMPLE_COMM_VENC_GetVencStreamProc]-1615: get venc stream time out, exit thread
[SAMPLE_COMM_VPSS_DisableChn]-213: SAMPLE_COMM_VPSS_DisableChn failed with 0xa0078005
[SAMPLE_COMM_VPSS_StopGroup]-180: SAMPLE_COMM_VPSS_StopGroup failed with 0xa0078005
program exit normally
我来回答
回答1个
时间排序
认可量排序
认可0
或将文件直接拖到这里
悬赏:
E币
网盘
* 网盘链接:
* 提取码:
悬赏:
E币
Markdown 语法
- 加粗**内容**
- 斜体*内容*
- 删除线~~内容~~
- 引用> 引用内容
- 代码`代码`
- 代码块```编程语言↵代码```
- 链接[链接标题](url)
- 无序列表- 内容
- 有序列表1. 内容
- 缩进内容
- 图片![alt](url)
相关问答
-
2020-04-07 11:21:47
-
2019-04-08 15:52:41
-
2017-10-24 15:37:54
-
2017-04-27 10:07:48
-
2018-06-21 17:18:58
-
2019-06-13 20:17:32
-
2019-04-13 17:16:08
-
2017-07-20 11:07:35
-
2018-08-02 15:57:57
-
2019-04-18 15:42:12
-
2018-10-19 20:25:13
-
2018-07-31 13:59:47
-
2019-04-11 16:27:32
-
2018-08-21 16:29:27
-
2018-08-20 17:10:00
-
2019-09-19 10:44:02
-
2017-11-02 09:36:11
-
2019-04-23 18:32:16
-
2018-10-20 15:38:33
无更多相似问答 去提问
点击登录
-- 积分
-- E币
提问
—
收益
—
被采纳
—
我要提问
切换马甲
上一页
下一页
悬赏问答
-
5Hi3516CV610 如何使用SD卡升级固件
-
5cat /dev/logmpp 报错 <3>[ vi] [func]:vi_send_frame_node [line]:99 [info]:vi pic queue is full!
-
50如何获取vpss chn的图像修改后发送至vo
-
5FPGA通过Bt1120传YUV422数据过来,vi接收不到数据——3516dv500
-
50SS928 运行PQtools 拼接 推到设备里有一半画面会异常
-
53536AV100的sample_vdec输出到CVBS显示
-
10海思板子mpp怎么在vi阶段改变视频数据尺寸
-
10HI3559AV100 多摄像头同步模式
-
9海思ss928单路摄像头vio中加入opencv处理并显示
-
10EB-RV1126-BC-191板子运行自己编码的程序
举报反馈
举报类型
- 内容涉黄/赌/毒
- 内容侵权/抄袭
- 政治相关
- 涉嫌广告
- 侮辱谩骂
- 其他
详细说明
提醒
你的问题还没有最佳答案,是否结题,结题后将扣除20%的悬赏金
取消
确认
提醒
你的问题还没有最佳答案,是否结题,结题后将根据回答情况扣除相应悬赏金(1回答=1E币)
取消
确认