Dear all:
I am using DVRRDK3.0 with DM8168EVM.
I create a chain, src->sclr->nsf->ipcOutVpss->ipcInVideo->enc->ipcBitsOutVideo->ipcBitsInHost.
I set the sclr link out resolution = 720*576, inputFrameRate = 30, outputFrameRate = 30,and I have the stream save to a file, when I play this file ,I found the framerate is 25. I want to know why the framerate is not 30?
the following is the my code:
srcPrm.outQueParams.nextLink = sclrId;
if (isProgressive)
{
srcPrm.timerPeriod = 30;
}
else
{
srcPrm.timerPeriod = 15;
}
srcPrm.inputInfo.numCh = SRC_NUM_CH;
for(i = 0; i < srcPrm.inputInfo.numCh; i++)
{
System_LinkChInfo *pChInfo;
pChInfo = &srcPrm.inputInfo.chInfo[i];
pChInfo->dataFormat = SYSTEM_DF_YUV420SP_UV;
pChInfo->memType = SYSTEM_MT_TILEDMEM;
pChInfo->width = 1920;
if (isProgressive)
{
pChInfo->height = 1080;
pChInfo->scanFormat = SYSTEM_SF_PROGRESSIVE;
}
else
{
pChInfo->height = 480/2;
pChInfo->scanFormat = SYSTEM_SF_INTERLACED;
}
pChInfo->pitch[0] = SystemUtils_align(pChInfo->width+pChInfo->startX,
SYSTEM_BUFFER_ALIGNMENT);
pChInfo->pitch[1] = pChInfo->pitch[0];
pChInfo->pitch[2] = 0;
}
SclrLink_CreateParams_Init(&sclrPrm);
sclrPrm.inQueParams.prevLinkId = srcId;
sclrPrm.inQueParams.prevLinkQueId = 0;
sclrPrm.outQueParams.nextLink = nsfId;
sclrPrm.tilerEnable = FALSE;
sclrPrm.enableLineSkipSc = FALSE;
sclrPrm.inputFrameRate = 30;
sclrPrm.outputFrameRate = 30;
sclrPrm.scaleMode = SCLR_SCALE_MODE_ABSOLUTE;
sclrPrm.outScaleFactor.absoluteResolution.outWidth = 720;
sclrPrm.outScaleFactor.absoluteResolution.outHeight = 576;
NsfLink_CreateParams_Init(&nsfPrm);
nsfPrm.bypassNsf = TRUE;
nsfPrm.tilerEnable = FALSE;
nsfPrm.inQueParams.prevLinkId = sclrId;
nsfPrm.inQueParams.prevLinkQueId = 0;
nsfPrm.numOutQue = 1;
nsfPrm.numBufsPerCh = 0;
nsfPrm.inputFrameRate = 30;
nsfPrm.outputFrameRate = 30;
nsfPrm.outQueParams[0].nextLink = ipcOutVpssId;
ipcOutVpssPrm.inQueParams.prevLinkId = nsfId;
ipcOutVpssPrm.inQueParams.prevLinkQueId = 0;
ipcOutVpssPrm.numOutQue = 1;
ipcOutVpssPrm.outQueParams[0].nextLink = ipcInVideoId;
ipcOutVpssPrm.notifyNextLink = TRUE;
ipcOutVpssPrm.notifyPrevLink = TRUE;
ipcOutVpssPrm.noNotifyMode = FALSE;
ipcInVideoPrm.inQueParams.prevLinkId = ipcOutVpssId;
ipcInVideoPrm.inQueParams.prevLinkQueId = 0;
ipcInVideoPrm.numOutQue = 1;
ipcInVideoPrm.outQueParams[0].nextLink = encId;
ipcInVideoPrm.notifyNextLink = TRUE;
ipcInVideoPrm.notifyPrevLink = TRUE;
ipcInVideoPrm.noNotifyMode = FALSE;
for (i = 0; i < SRC_NUM_CH; i++)
{
encPrm.chCreateParams[i].format = IVIDEO_H264HP;
encPrm.chCreateParams[i].profile = IH264_HIGH_PROFILE;
encPrm.chCreateParams[i].dataLayout = IVIDEO_FIELD_SEPARATED;
if (isProgressive)
encPrm.chCreateParams[i].fieldMergeEncodeEnable = FALSE;
else
encPrm.chCreateParams[i].fieldMergeEncodeEnable = TRUE;
encPrm.chCreateParams[i].maxBitRate = -1;
encPrm.chCreateParams[i].encodingPreset = 3;
encPrm.chCreateParams[i].rateControlPreset = 0;
encPrm.chCreateParams[i].enableHighSpeed = 0;
encPrm.chCreateParams[i].encodingPreset = XDM_DEFAULT;
encPrm.chCreateParams[i].enableAnalyticinfo = 0;
encPrm.chCreateParams[i].enableWaterMarking = 0;
encPrm.chCreateParams[i].rateControlPreset = IVIDEO_STORAGE;
encPrm.chCreateParams[i].defaultDynamicParams.intraFrameInterval = 30;
encPrm.chCreateParams[i].defaultDynamicParams.targetBitRate = (2 * 1000 * 1000);
encPrm.chCreateParams[i].defaultDynamicParams.interFrameInterval = 1;
encPrm.chCreateParams[i].defaultDynamicParams.mvAccuracy = IVIDENC2_MOTIONVECTOR_QUARTERPEL;
encPrm.chCreateParams[i].defaultDynamicParams.rcAlg = 0 ;
encPrm.chCreateParams[i].defaultDynamicParams.qpMin = 10;
encPrm.chCreateParams[i].defaultDynamicParams.qpMax = 40;
encPrm.chCreateParams[i].defaultDynamicParams.qpInit = -1;
encPrm.chCreateParams[i].defaultDynamicParams.vbrDuration = 8;
encPrm.chCreateParams[i].defaultDynamicParams.vbrSensitivity = 0;
encPrm.chCreateParams[i].defaultDynamicParams.inputFrameRate = 30;
encPrm.chCreateParams[i].defaultDynamicParams.targetFrameRate = 30;
}
encPrm.inQueParams.prevLinkId = ipcInVideoId;
encPrm.inQueParams.prevLinkQueId = 0;
encPrm.outQueParams.nextLink = ipcBitsOutVideoId;
encPrm.numBufPerCh[0] = 6;
encPrm.numBufPerCh[1] = 6;
encPrm.numBufPerCh[2] = 6;
encPrm.numBufPerCh[3] = 6;
ipcBitsOutVideoPrm.baseCreateParams.inQueParams.prevLinkId = encId;
ipcBitsOutVideoPrm.baseCreateParams.inQueParams.prevLinkQueId = 0;
ipcBitsOutVideoPrm.baseCreateParams.numOutQue = 1;
ipcBitsOutVideoPrm.baseCreateParams.outQueParams[0].nextLink = ipcBitsInHostId;
Chains_ipcBitsInitCreateParams_BitsOutRTOS(&ipcBitsOutVideoPrm, TRUE);
ipcBitsInHostPrm.baseCreateParams.inQueParams.prevLinkId = ipcBitsOutVideoId;
ipcBitsInHostPrm.baseCreateParams.inQueParams.prevLinkQueId = 0; ipcBitsInHostPrm.baseCreateParams.outQueParams[0].nextLink = SYSTEM_LINK_ID_INVALID; Chains_ipcBitsInitCreateParams_BitsInHLOS(&ipcBitsInHostPrm);