I am using the following code to adjust the number of P frames between each I frame. I have noticed no change in the output of the encoder. It is always outputting NAL unit types in the following pattern: 27, 28, 25, 21, 21, ...
I expected to see some NAL units with type 25 but I never see any. How can I configure the encoder to periodically output I frames?
OMX_VIDEO_CONFIG_AVCINTRAPERIOD config;
OMX_INIT_PARAM( &config );
config.nPortIndex = OMX_VIDENC_OUTPUT_PORT;
eError = OMX_GetConfig( pHandle, OMX_IndexConfigVideoAVCIntraPeriod, (OMX_PTR)&config );
if (eError != OMX_ErrorNone)
{
printf( "IL_ClientSetEncodeParams: OMX_GetConfig failed. %s\n", IL_ClientErrorToStr(eError) );
return eError;
}
else
{
printf( "OMX_IndexConfigVideoAVCIntraPeriod nPFrames = %u, nIDRPeriod = %u\n", config.nPFrames, config.nIDRPeriod );
}
config.nPFrames = 29;
eError = OMX_SetConfig( pHandle, OMX_IndexConfigVideoAVCIntraPeriod, (OMX_PTR)&config );
if (eError != OMX_ErrorNone)
{
printf( "IL_ClientSetEncodeParams: OMX_SetConfig failed. %s\n", IL_ClientErrorToStr(eError) );
return eError;
}
else
{
printf( "OMX_IndexConfigVideoAVCIntraPeriod nPFrames = %u, nIDRPeriod = %u\n", config.nPFrames, config.nIDRPeriod );
}