dm8107多通道编码

我在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,说明始终只有一个通道,请问如何才能获得多路码流?

3 个回复