This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Encode application - maximum GOP achievable


Hello,

We are working on TIDM8148EVM board.

We tested the encode application that's come with EzSDK on our EVM.
When we give P frame to 128 between two I-frame, we get "unrecoverable error: OMX_ErrorBadParameter (0x80001005)" error.
This means we are unable to set GOP longer than 127 frames.

Can we configure GOP higher then this? Is there any hardcoding inside encoder?




Error Prints:
========================================================================================================================
root@dm814x-evm:~/dm814x-evm/usr/share/ti/ti-omx#
root@dm814x-evm:~/dm814x-evm/usr/share/ti/ti-omx# ./encode_a8host_debug.xv5T -o out_1080p_sp_185frames.h264 -i out_1080p_sp_185frames.yuv -f 60 -b 60000000 -w 1920 -h 1080 -c h264 -a 1 -p 128 -m 0 -M 0 -r 0
b-frame: 1
p-frame: 128
no of reference frames: 0
output file: out_1080p_sp_185frames.h264
input file: out_1080p_sp_185frames.yuv
bit_rate: 60000000
frame_rate: 60
codec: h264
width: 1920
height: 1080
no of b-frame: 1
no of p-frame: 128
Block size used for Motion Estimation for P-Frames = 0
Block size used for Motion Estimation for B-Frames = 0
no of reference frame: 0
 Encode example
===============================
 OMX_Init completed
 UIAClient is ready to send a UIA configuration command
UIAClient received UIA_CONFIGURE_ACK
UIAClient is done sending requests
UIAClient is ready to send a UIA configuration command
UIAClient received UIA_CONFIGURE_ACK
UIAClient is done sending requests
 opening file
 encoder component is created
success OMX_IndexParamVideoAvc getparams
success OMX_IndexParamVideoAvc setparams
success OMX_TI_IndexParamVideoMEBlockSize getparams
success OMX_TI_IndexParamVideoMEBlockSize setparams
 encoder input port allocate buffer done
  encoder outport buffers allocated
 got event*** unrecoverable error: OMX_ErrorBadParameter (0x80001005)
Press a key to proceed

  • Hello,

    Based on H264 encoder datasheet the GOP size is user defined and max GOP size or IDRFrameInterval is limited to 0x7FFFFFFF.

    Refer to H264 Encoder User Guide for more details.

    ti-ezsdk_dm814x-evm_5_05_02_00/component-sources/omx_05_02_00_48/src/ti/omx/docs

    H264_Encoder_HDVICP2_UserGuide.pdf

    Best Regards,

    Margarita

  • Hello Margarita,

    I go through this user guide. But I didn't get max no of  P frame value i can set in encode example.

    As I described is above post we are getting following error, when we set p frame values higher then 127. Why this error is occurring.


    Error Prints:
    ========================================================================================================================
    root@dm814x-evm:~/dm814x-evm/usr/share/ti/ti-omx#
    root@dm814x-evm:~/dm814x-evm/usr/share/ti/ti-omx# ./encode_a8host_debug.xv5T -o out_1080p_sp_185frames.h264 -i out_1080p_sp_185frames.yuv -f 60 -b 60000000 -w 1920 -h 1080 -c h264 -a 1 -p 128 -m 0 -M 0 -r 0
    b-frame: 1
    p-frame: 128
    no of reference frames: 0
    output file: out_1080p_sp_185frames.h264
    input file: out_1080p_sp_185frames.yuv
    bit_rate: 60000000
    frame_rate: 60
    codec: h264
    width: 1920
    height: 1080
    no of b-frame: 1
    no of p-frame: 128
    Block size used for Motion Estimation for P-Frames = 0
    Block size used for Motion Estimation for B-Frames = 0
    no of reference frame: 0
     Encode example
    ===============================
     OMX_Init completed
     UIAClient is ready to send a UIA configuration command
    UIAClient received UIA_CONFIGURE_ACK
    UIAClient is done sending requests
    UIAClient is ready to send a UIA configuration command
    UIAClient received UIA_CONFIGURE_ACK
    UIAClient is done sending requests
     opening file
     encoder component is created
    success OMX_IndexParamVideoAvc getparams
    success OMX_IndexParamVideoAvc setparams
    success OMX_TI_IndexParamVideoMEBlockSize getparams
    success OMX_TI_IndexParamVideoMEBlockSize setparams
     encoder input port allocate buffer done
      encoder outport buffers allocated
     got event*** unrecoverable error: OMX_ErrorBadParameter (0x80001005)
    Press a key to proceed

  • Hi Vaibhav,

    Check the data-type of the variable you have used for setting no of P frames.

    From you statement, It looks to me as if its "char" which at max can hold value - 127. If yes, try to change it to some higher data-type like "int" or "unsigned int".

    -- Krunal

    Please click "Verify Answer" if this post has answered your question!

  • Hi Krunal,

    Thanks for solution. I fixed this issue with same solution.