Hello,
my OMX application encodes 1080p60 just fine, this is the setup:
HDMI -> VFCC -> VENC -> H.264
(note: no DEI component)
Now I want to add 1080i60 support, VFCC now has this config:
paramPort.format.video.nFrameWidth = width;
paramPort.format.video.nFrameHeight = height;
if(!interlaced)paramPort.format.video.nStride = width;
else paramPort.format.video.nStride = width << 1;
paramPort.nBufferCountActual = g_vfcc_venc_size;
paramPort.format.video.eCompressionFormat = OMX_VIDEO_CodingUnused;
paramPort.format.video.eColorFormat = OMX_COLOR_FormatYUV420SemiPlanar;
paramPort.nBufferSize = (paramPort.format.video.nStride * paramPort.format.video.nFrameHeight * 3) >> 1;
(width 1920, height 1080)
sHwPortParam.eCaptMode = OMX_VIDEO_CaptureModeSC_DISCRETESYNC_ACTVID_VSYNC;
sHwPortParam.eVifMode = OMX_VIDEO_CaptureVifMode_24BIT;
sHwPortParam.eInColorFormat = OMX_COLOR_Format24bitRGB888;
if(!interlaced){
sHwPortParam.eScanType = OMX_VIDEO_CaptureScanTypeProgressive;
sHwPortParam.bFieldMerged = OMX_FALSE;
sHwPortParam.nMaxHeight = height;
sHwPortParam.nMaxWidth = width;
}
else{
sHwPortParam.eScanType = OMX_VIDEO_CaptureScanTypeInterlaced;
sHwPortParam.bFieldMerged = OMX_FALSE;
sHwPortParam.nMaxHeight = height >> 1;
sHwPortParam.nMaxWidth = width;
}
Is the bFieldMerged setting correct? The header file has no description for this field (all the others have a comment, file omx_vfcc.h)
VENC config:
Input:
tPortDef.nBufferCountActual = g_vfcc_venc_size;
tPortDef.format.video.nFrameWidth = width;
tPortDef.format.video.nFrameHeight = height;
if(!interlaced) tPortDef.format.video.nStride = width;
else tPortDef.format.video.nStride = width << 1;
tPortDef.format.video.eColorFormat = OMX_COLOR_FormatYUV420SemiPlanar;
tPortDef.nBufferSize = (tPortDef.format.video.nStride * tPortDef.format.video.nFrameHeight * 3) >> 1;
eError = OMX_SetParameter (venc, OMX_IndexParamPortDefinition, &tPortDef);
Output:
tPortDef.nBufferCountActual = g_venc_output_size;
tPortDef.format.video.nFrameWidth = width;
tPortDef.format.video.nFrameHeight = height;
tPortDef.format.video.eCompressionFormat = OMX_VIDEO_CodingAVC;
tPortDef.format.video.xFramerate = (framerate << 16);
tVideoParams.xFramerate = (framerate << 16);
tPortDef.format.video.nBitrate = bitrate;
Encoder:
tVidEncBitRate.eControlRate = OMX_Video_ControlRateVariable;
tVidEncBitRate.nTargetBitrate = bitrate;
tProfileLevel.eProfile = OMX_VIDEO_AVCProfileHigh;
tProfileLevel.eLevel = OMX_VIDEO_AVCLevel42;
tStaticParam.videoStaticParams.h264EncStaticParams.videnc2Params.profile = IH264_HIGH_PROFILE;
tStaticParam.videoStaticParams.h264EncStaticParams.videnc2Params.level = IH264_LEVEL_42;
tStaticParam.videoStaticParams.h264EncStaticParams.videnc2Params.inputContentType = IVIDEO_INTERLACED_FRAME;
tStaticParam.videoStaticParams.h264EncStaticParams.bottomFieldIntra = 0;
tStaticParam.videoStaticParams.h264EncStaticParams.interlaceCodingType = IH264_INTERLACE_FIELDONLY_ARF;
tStaticParam.videoStaticParams.h264EncStaticParams.videnc2Params.encodingPreset = XDM_DEFAULT;
tStaticParam.videoStaticParams.h264EncStaticParams.videnc2Params.rateControlPreset = IVIDEO_STORAGE;
tStaticParam.videoStaticParams.h264EncStaticParams.intraCodingParams.lumaIntra4x4Enable = 0x1f;
tStaticParam.videoStaticParams.h264EncStaticParams.intraCodingParams.lumaIntra8x8Enable = 0x1f;
tEncoderPreset.eEncodingModePreset = OMX_Video_Enc_Default;
tEncoderPreset.eRateControlPreset = OMX_Video_RC_None;
The Users Guide just says:
How to use interlaced encoding in H.264 encode?
You need to configure contentType as IVIDEO_INTERLACED and provide the pointers to field buffers appropriatelty during process call
Are there any conflicting settings liste above?
This is the OMX error message (return value) I get:
venc go to state idle (start up)
OMX event: *** unrecoverable error: 0x80001005
The wiki lists interlaced support for the H264 codec:
http://processors.wiki.ti.com/index.php/HDVICP2_Video_Codecs#H264_Encoder
On the other hand the VENC might not support it:
http://processors.wiki.ti.com/index.php/OMX_VENC
"2. How to encode in interlace mode? Ans: This is not supported in EZSDK 5.02.02.60, it requires codec header file to be available"
( I have omx 5.2.0.48)
Is my config correct or do I miss some config bits?
Best regards,
Lo