我在USECASE里面的enclink中添加了一路图片编码,代码如下:
/* h264 Params */
for (i=0; i<gVencModuleContext.vencConfig.numChn-1; i++)
{
pLinkChPrm = &encPrm.chCreateParams[i];
pLinkDynPrm = &pLinkChPrm->defaultDynamicParams;
pChPrm = &gVencModuleContext.vencConfig.encChannelParams[i];
pDynPrm = &pChPrm->dynamicParam;
pLinkChPrm->format = IVIDEO_H264HP;
pLinkChPrm->profile = gVencModuleContext.vencConfig.h264Profile[i];
//LOG_WAR("pLinkChPrm->profile = %d\r\n",pLinkChPrm->profile);
pLinkChPrm->dataLayout = IVIDEO_FIELD_SEPARATED;
pLinkChPrm->fieldMergeEncodeEnable = FALSE;
pLinkChPrm->enableAnalyticinfo = pChPrm->enableAnalyticinfo;
pLinkChPrm->enableWaterMarking = pChPrm->enableWaterMarking;
pLinkChPrm->maxBitRate = pChPrm->maxBitRate;
pLinkChPrm->encodingPreset = pChPrm->encodingPreset;
pLinkChPrm->rateControlPreset = pChPrm->rcType;
pLinkChPrm->enableSVCExtensionFlag = pChPrm->enableSVCExtensionFlag;
pLinkChPrm->numTemporalLayer = pChPrm->numTemporalLayer;
pLinkDynPrm->intraFrameInterval = pDynPrm->intraFrameInterval;
pLinkDynPrm->targetBitRate = pDynPrm->targetBitRate;
pLinkDynPrm->interFrameInterval = 1;
pLinkDynPrm->mvAccuracy = IVIDENC2_MOTIONVECTOR_QUARTERPEL;
pLinkDynPrm->inputFrameRate = pDynPrm->inputFrameRate;
pLinkDynPrm->rcAlg = pDynPrm->rcAlg;
pLinkDynPrm->qpMin = pDynPrm->qpMin;
pLinkDynPrm->qpMax = pDynPrm->qpMax;
pLinkDynPrm->qpInit = pDynPrm->qpInit;
pLinkDynPrm->vbrDuration = pDynPrm->vbrDuration;
pLinkDynPrm->vbrSensitivity = pDynPrm->vbrSensitivity;
}
/* MJPEG Params */
for (i=1;i<gVencModuleContext.vencConfig.numChn; i++)
{
pLinkChPrm = &encPrm.chCreateParams[i];
pLinkDynPrm = &pLinkChPrm->defaultDynamicParams;
pChPrm = &gVencModuleContext.vencConfig.encChannelParams[i];
pDynPrm = &pChPrm->dynamicParam;
pLinkChPrm->format = IVIDEO_MJPEG;
pLinkChPrm->profile = 0;
pLinkChPrm->dataLayout = VCODEC_FIELD_SEPARATED;
pLinkChPrm->fieldMergeEncodeEnable = FALSE;
pLinkChPrm->enableAnalyticinfo = 0;
pLinkChPrm->enableWaterMarking = 0;
pLinkChPrm->maxBitRate = 0;
pLinkChPrm->encodingPreset = 0;
pLinkChPrm->rateControlPreset = 0;
pLinkChPrm->enableSVCExtensionFlag = 0;
pLinkChPrm->numTemporalLayer = 0;
pLinkDynPrm->intraFrameInterval = 0;
pLinkDynPrm->targetBitRate = 100*1000;
pLinkDynPrm->interFrameInterval = 0;
pLinkDynPrm->mvAccuracy = 0;
pLinkDynPrm->inputFrameRate = 1;
pLinkDynPrm->qpMin = 0;
pLinkDynPrm->qpMax = 0;
pLinkDynPrm->qpInit = -1;
pLinkDynPrm->vbrDuration = 0;
pLinkDynPrm->vbrSensitivity = 0;
}
但是编码后,只能得到一路码流(只有h264码流没有jpeg码流),然后我去掉h264部分,只编jpeg码流,发现可能编译出jpeg码流,
/* MJPEG Params */
for (i=0;i<gVencModuleContext.vencConfig.numChn; i++)
{
pLinkChPrm = &encPrm.chCreateParams[i];
pLinkDynPrm = &pLinkChPrm->defaultDynamicParams;
pChPrm = &gVencModuleContext.vencConfig.encChannelParams[i];
pDynPrm = &pChPrm->dynamicParam;
pLinkChPrm->format = IVIDEO_MJPEG;
pLinkChPrm->profile = 0;
pLinkChPrm->dataLayout = VCODEC_FIELD_SEPARATED;
pLinkChPrm->fieldMergeEncodeEnable = FALSE;
pLinkChPrm->enableAnalyticinfo = 0;
pLinkChPrm->enableWaterMarking = 0;
pLinkChPrm->maxBitRate = 0;
pLinkChPrm->encodingPreset = 0;
pLinkChPrm->rateControlPreset = 0;
pLinkChPrm->enableSVCExtensionFlag = 0;
pLinkChPrm->numTemporalLayer = 0;
pLinkDynPrm->intraFrameInterval = 0;
pLinkDynPrm->targetBitRate = 100*1000;
pLinkDynPrm->interFrameInterval = 0;
pLinkDynPrm->mvAccuracy = 0;
pLinkDynPrm->inputFrameRate = 1;
pLinkDynPrm->qpMin = 0;
pLinkDynPrm->qpMax = 0;
pLinkDynPrm->qpInit = -1;
pLinkDynPrm->vbrDuration = 0;
pLinkDynPrm->vbrSensitivity = 0;
}
通过调试发现pObj->inQueInfo.numCh 的值始终是1,说明始终只有一个通道,请问如何才能获得多路码流?
Chris Meng:
你好,
能否先把图像dup-》merge-》encode。不在encode link里修改。
dg q:
回复 Chris Meng:
在merge之前已经添加过了一路 dup->merge,如下:dup[2] link就是新添加的
mergePrm[0].inQueParams[0].prevLinkId= gVcapModuleContext.deiId[0];mergePrm[0].inQueParams[0].prevLinkQueId = DEI_LINK_OUT_QUE_VIP_SC;//DEI_LINK_OUT_QUE_DEI_SC;//DEI_LINK_OUT_QUE_VIP_SC;
mergePrm[0].inQueParams[1].prevLinkId= gMultiCh_VcapVencObj.dupId[2];mergePrm[0].inQueParams[1].prevLinkQueId = 0;
Chris Meng:
回复 dg q:
你好,
建议看看IPNC RDK里是如何支持抓拍的。