Hi,
How can I control the max size of NAL and the length of GOP ?
I am developing on DM8168 , and I am a little familar with ezsdk,omx,and omtb,
but I really do not know how can I control the max size of NAL and the length of GOP.
Help me please, Thank you very much!
Neo,
EZSDK 5.03 provides user guide of h264 codec. Please refer to that for specific parameters settings. in OMX these can be set as static and dynamic parameter indices.
http://processors.wiki.ti.com/index.php/OMX_VENC
regards
Vimal
Hi Vimal Jain,
Thank you for your help.
I had control the Intra period succeed.
But How can I control the Max Nal size? Is that supported by ezsdk5.03?
I had try many way to control the max size of NAL ,but seems not work.waiting for your help.
thank you very much.
neo guan.
you have select sliceMode as '2' ( which will enable bytes based slices)
sliceUnitSize as your need of maximum NAL size.
for this you will have to set encoding preset other than '3' and sliceCodingParams as '1'
Deepak Poddar
Hi,Deepak Poddar
This is my code:
--------------------------------------
eError = OMX_GetParameter (pHandle, OMX_TI_IndexParamVideoDynamicParams, &tDynParams); tDynParams.videoDynamicParams.h264EncDynamicParams.sliceCodingParams.sliceCodingPreset = IH264_SLICECODING_USERDEFINED; tDynParams.videoDynamicParams.h264EncDynamicParams.sliceCodingParams.sliceMode = IH264_SLICEMODE_MBUNIT; tDynParams.videoDynamicParams.h264EncDynamicParams.sliceCodingParams.sliceUnitSize = 1400; tDynParams.videoDynamicParams.h264EncDynamicParams.videnc2DynamicParams.intraFrameInterval = 30000; eError = OMX_SetParameter (pHandle, OMX_TI_IndexParamVideoDynamicParams, &tDynParams);
-------------------------------------------------------------------------------------------------
but it seems like that: only the intraFrameInterval works , the paramater about slice doesn't work , where is my mistake?
could you tell me some detial about the config process .
and I didn't understand "sliceCodingParams as 1", how can I follow these words,and understand this sentence,
please help me.
Thank you very much.
Neo Guan
sorry let me correct my copy mistake.the real word i wanna say is like following.
eError = OMX_GetParameter (pHandle, OMX_TI_IndexParamVideoDynamicParams, &tDynParams); tDynParams.videoDynamicParams.h264EncDynamicParams.sliceCodingParams.sliceCodingPreset = IH264_SLICECODING_USERDEFINED; tDynParams.videoDynamicParams.h264EncDynamicParams.sliceCodingParams.sliceMode =IH264_SLICEMODE_BYTES ; tDynParams.videoDynamicParams.h264EncDynamicParams.sliceCodingParams.sliceUnitSize = 1400; tDynParams.videoDynamicParams.h264EncDynamicParams.videnc2DynamicParams.intraFrameInterval = 30000; eError = OMX_SetParameter (pHandle, OMX_TI_IndexParamVideoDynamicParams, &tDynParams);
I meant sliceCodingPreset only as '1'. sliceCodingParams was my mistake.
Now what happens, does codec runs or it throws error ?
If throws error, then please note that bytes based slices is supported only in progressive, IPPP, CAVLC sequences.
if it runs and you dont see the slices as per your expectation then , please check encodingPreset value, it has to be '3'.
Hi, Deepak Poddar
This is my code: -------------------------------- OMX_INIT_PARAM (&tDynParams); tDynParams.nPortIndex = OMX_VIDENC_OUTPUT_PORT; eError = OMX_GetParameter (pHandle, OMX_TI_IndexParamVideoDynamicParams, &tDynParams); tDynParams.videoDynamicParams.h264EncDynamicParams.sliceCodingParams.sliceCodingPreset = IH264_SLICECODING_USERDEFINED; printf("YY,1st sliceCodingPreset-->%d,\n",tDynParams.videoDynamicParams.h264EncDynamicParams.sliceCodingParams.sliceCodingPreset);
tDynParams.videoDynamicParams.h264EncDynamicParams.sliceCodingParams.sliceMode = IH264_SLICEMODE_BYTES; printf("YY,1st sliceMode-->%d,\n",tDynParams.videoDynamicParams.h264EncDynamicParams.sliceCodingParams.sliceMode);
tDynParams.videoDynamicParams.h264EncDynamicParams.sliceCodingParams.sliceUnitSize = 1400; printf("YY,1st sliceMode-->%d,\n",tDynParams.videoDynamicParams.h264EncDynamicParams.sliceCodingParams.sliceUnitSize);
/* setting I frame interval */ tDynParams.videoDynamicParams.h264EncDynamicParams.videnc2DynamicParams.intraFrameInterval = 30000;//90; eError = OMX_SetParameter (pHandle, OMX_TI_IndexParamVideoDynamicParams, &tDynParams); eError = OMX_GetParameter (pHandle, OMX_TI_IndexParamVideoDynamicParams, &tDynParams); printf("YY,2rd Get sliceCodingPreset-->%d,\n",tDynParams.videoDynamicParams.h264EncDynamicParams.sliceCodingParams.sliceCodingPreset); printf("YY,2rd Get sliceMode-->%d,\n",tDynParams.videoDynamicParams.h264EncDynamicParams.sliceCodingParams.sliceMode); printf("YY,2rd sliceMode-->%d,\n",tDynParams.videoDynamicParams.h264EncDynamicParams.sliceCodingParams.sliceUnitSize); -------------------------------- The result is when I check the h264 file with elecard, I can't find picture split, in other words, one picture one slice, and the NAL size is still bigger than 1400(I set this size); but the GOP length is what I set. The omx component never throw errors, the omx component accept the parameters , 1. I run OMX_GetParameter after OMX_SetParameter,the parameters returned is what I configured ; 2. and the OMX_SetParameter return 0; but the parameter I set about slice never works. I don't know where is my mistake; please help me. Thank you very much; Neo Guan
Hi Deepak,
I'm facing the same problem. The codec still doesn't limit the size of the NAL Units. I tried to set the encodingPreset to 3 and it didn't help.
Any Ideas?
Thanks,
Sami