Hi All,
I am using dvsdk_2_10_00_14 for DM365 developement and I am facing the issue with IDR frame generation at every 300 frame or specific time interval. I am setting the forceFrame field of dynamic parameters to "IVIDEO_IDR_FRAME" at every specifc interval of time using control API of video encoder with "XDM_SET_PARAMS" command. but still I am getting the I-Frame not an IDR-Frame.
I required the IDR frame for decoder synchronization and random access of H264 stream. Is there any way to generate IDR frame?
Please see the code snap which I am using to set the frame type to IDR frame.
if ( 0 == (nFrameNumber % 30) )
{
// Set dynamic parameters for encoder
tEncStatus.size = sizeof( VIDENC1_Status );
tEncStatus.data.buf = NULL;
pEncDynamicParams_->forceFrame = IVIDEO_IDR_FRAME;
nEncRetVal = VIDENC1_control( (*pVideoEncHandle_), XDM_SETPARAMS, pEncDynamicParams_,
&tEncStatus );
if ( VIDENC1_EOK != nEncRetVal )
{
printf( "VideoEncode_EncodeBuffer: Error in VIDENC1_control:XDM_SETPARAMS status:%d\n", ( int )nEncRetVal );
return -1; // EARLY RETURN HERE
}
}
nEncRetVal = VIDENC1_process( (*pVideoEncHandle_), &tInBufDesc, &tOutBufDesc,
&tInArgs, &tOutArgs );
if ( VIDENC1_EOK != nEncRetVal ){
printf( "VideoEncode_EncodeBuffer: Error in VIDENC1_process status:%d\n", ( int )nEncRetVal );
return -1;
}
if ( 0 == (nFrameNumber % 30) )
{
// Set dynamic parameters for encoder
tEncStatus.size = sizeof( VIDENC1_Status );
tEncStatus.data.buf = NULL;
pEncDynamicParams_->forceFrame = IVIDEO_P_FRAME;
nEncRetVal = VIDENC1_control( (*pVideoEncHandle_), XDM_SETPARAMS, pEncDynamicParams_,
&tEncStatus );
if ( VIDENC1_EOK != nEncRetVal )
{
printf( "VideoEncode_EncodeBuffer: Error in VIDENC1_control:XDM_SETPARAMS "
"status:%d\n", ( int )nEncRetVal );
return -1;
}
}
nFrameNumber++
Thanks,
Dilip