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.

OMAP encoder failed when switching input resolution frequently

Hi, All

We tried to make use of OMAP encoder to encode different resolution video in different time in our application. For example, network condition is very very good, we want to encode 720P video and send them, but when network condition become worse, we have to decrease the resolution such as 180P. 

Currently, we found one issue that OMAP encoder will fail to work when we switch different input resolution frequently.

We did two kinds of testing case:

case 1. only initialize and un-initialize OMAP encoder (that is, create and destroy OMAP encoder handle only once) when switching different input resolution, OMAP encoder will work normally about ten times then return error value (OMX_ErrorUndefined);

case 2. create and destroy OMAP encoder handle when switching different input resolution, OMAP encoder will work normally about dozens of times then return error value (OMX_ErrorHardware).

My question is:

Q1. OMAP encoder doesn't support the frequent resolution switching, right?

Q2. If we succeed to switch different resolution repeatedly with OMAP encoder, what we should do?

We are looking forward to your reply and thanks in advance.

Best Regards

-Juanny Wang

  • Juanny;

    Can you provide more information about used release? used application? if it is custom application or Android System application?

    and a log for this error? you can try to print some debug prints for rpmsg? and share the log.

    http://omapedia.org/wiki/Debugging_RPMsg#Remote_Processor_Traces

  • Hi, Manuel Contreras

    Thanks very much for your prompt reply. It's custom application that is aimed to Web Conference.

    Because long logs copying caused much inconvenience, please check the attachment in the next post. 

    Best Regards

    -Juanny Wang


  • Juanny,

    In the future, please attach such long logs to your post, instead of copying and pasting into the body of the message - it will be much easier for us to read and follow.

    Thank you,

    Magdalena

  • Juanny,


    Can you mention the release you are using? 4AI or L27IS? and what version number? 4AI.1.4 4AI1.6?

  • Sorry for the inconvenience. I post the logs in the way of attachment. Please check them.

    PS: zydeco_timsg_init_uninit.txt for case 1

           zydeco_timsg_create_destroy.txt for case 2.

    Thanks

    -Juanny Wang

    4786.zydeco_timsg_init_uninit.txt

    7028.zydeco_timsg_create_destroy.txt

  • Juanny,

    I see that you closed this thread. Do you still want TI to answer?

    Thank you,

    Magdalena

  • Hi, Manuel Contreras

    The version number is 4AI 1.4 with some minor modifications by us.

    Thanks

    -Juanny

  • Magdalena,

    I didn't close this thread and I'm looking forward to your TI's answer.

    Yesterday, I just edit the long logs post and added the attachement about logs (ti_rpmsg).

    Thanks

    -Juanny

  • Hi Juanny,

    As per our understanding, both your approaches should work as it is ensuring to delete the codec and create the codec with a new resolution each time.

    As per the logs attached in the file namely "4786.zydeco_timsg_init_uninit.txt" as highlighted below, it is failing due to unsupported resolution and frame rate for the given profile and level of the codec. Please ensure that the level and profile are also changed accordingly to satisfy the constraints on resolution and frame rate for a given profile and level of the codec.

    [CORE1]: [     14.646] [ERR=1691] src/OMX_H264VideoEncoderUtils.c:[1278]:[Instance 0]:Undefined From Codec


    [CORE1]: [     14.647] [ERR=1692] src/OMX_H264VideoEncoderUtils.c:[1278]:[Instance 0]:Due to Unsupported VIDENC2DYNAMIC Params

    In the case of other log namely "7028.zydeco_timsg_create_destroy.txt" I do not see the errors from codec, could you please capture the error log and upload it for review.

    Thanks & Best Regards,

    Venkat

  • Hi, Venkat

    4078.zydeco_timsg_init_uninit.txt:

    The profile and level are OMX_VIDEO_AVCProfileBaseline and OMX_VIDEO_AVCLevel41 in our testing. 

    We run OMAP encoder sucessfully with single resolution such as 720P (1280x720, 30fps, 2Mbps) and QCIF (176x144, 30fps, 96kbps) individually.

    We did the testing of switching the above two kinds resolution, OMAP encoder can work normally about 14times then failed.

    If it's failing due to unsupported resolution and frame rate, the individual resolution testing (720P or QCIF) and union resolutions testing (720P and QCIF) won't work at all.

    So I don't think it's due to unsupported resolution and frame rate for the given profile and level.

    Thanks and Regards

    -Juanny

     

  • Juanny;

    Thanks for sharing the information, I am going to check it next.

    By running only 14 times that means that some buffer memory could not be freed, it runs few times then fails, let me check the logs.

  • Hi, Manuel

    Thanks very much for your attention focusing on this issue.

    I think you guys can set up one simple testbed to run two kinds of resolution switching on OMAP encoder. In our testbed, we encode one frame of 720P then swith one frame of QCIF, repeat this switching till OMAP encoder failed.

    We expect your reply. Thanks again.

    Regards

    -Juanny

  • Hi Juanny,

    Thanks for the clarification. But based on the error of Unsupported VIDENC Dynamic Parameters in the logs attached, it looks to me something is wrong with the parameters.

    Could you please check the resolution, frame rate, profile level, bitrate along with P & B frames by using OMX Get Parameter for IndexPortDefinition and AVCCodingType both in the case of working cases (13 times) and during the non-working scenario (14th time)?

    It may be the case that one of the dynamic parameters are not set correctly.

    We will continue investigating further from our side based on your inputs so far.

    Thanks & Best Regards,

    Venkat

  • Hi, Venkat

    Thanks very much for your attention on this issue.

    I checked the paramters you mentioned, and no any incorrect paramter was found from the trace.

    We only keep the default port definition setting except profile (baseline), no B frames, only I P frame, 320P frames between each I frame. And the AVCCodingType both for input port and output port are OMX_VIDEO_CodingUnused and OMX_VIDEO_CodingAVC.

    Just suggestion: you guys can set up one simple testbed to run two kinds of resolution switching on OMAP encoder. In our testbed, we encode one frame of 720P then swith one frame of QCIF, repeat this switching till OMAP encoder failed.

    Thanks

    -Juanny

     

  • Juany;

    Can you check that streams are correctly restarted? and that application is closing the files using fclose in case of using fopen?

  • Juany;

    For the shared code it was found that file pointers were not returning to zero when new encoder round started, can you verify if this is the fix for your issue? and verify the post if it is? thanks in advance.

  • Juanny,

    Any update on this, or can this thread be closed?

    Thanks,
    Gina 

  • We still didn't handle with this issue.

    If you want to close this thread, please go ahead.

    Thanks

    -Juanny