Hi, we are using OMX H264 encoder with DM8148/EZSDK_5_05_02_00.
Our system has multiple video inputs and need to switch between them. The resolutions of the videos are different, so we need to change the size of H.264 encoding at runtime.
I followed the samples of changing parameters dynamically, and wrote up the code below, but it doesn't work. When switching from 1280x720->640x480, the 640x480 image seems to be shrunk in half vertically in upper half of the image and the lower half is garbage.
How can I make it work?
Thanks,
tamo2
OMX_INIT_PARAM (&tDynParams);
tDynParams.nPortIndex = OMX_VIDENC_OUTPUT_PORT;
eError = OMX_GetConfig (pHandle, (OMX_INDEXTYPE)OMX_TI_IndexParamVideoDynamicParams, &tDynParams);
tDynParams.videoDynamicParams.h264EncDynamicParams.videnc2DynamicParams.inputHeight = newHeight;
tDynParams.videoDynamicParams.h264EncDynamicParams.videnc2DynamicParams.inputWidth = newWidth;
tDynParams.videoDynamicParams.h264EncDynamicParams.videnc2DynamicParams.captureWidth = newStride;
eError = OMX_SetConfig(pHandle, (OMX_INDEXTYPE)OMX_TI_IndexParamVideoDynamicParams, &tDynParams);
// Do the same thing for INPUT.