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.

Start decoding from non-I/IDR frame

Hello,

I have a DM8168 based decoder system which receives and decodes H.264 video stream over network.

The H.264 stream received by the decoder has the following properties -

1. It contains Intra macroblocks with AIR refresh period as 1 second

2. SPS and PPS are inserted with each frame (I and P) so that decoder can start decoding at any point

Even with the above properties, I have seen that the decoder does not start decoding video correctly until it receives an I/IDR frame. My expectation from decoder was that it should start decoding even from a P frame using SPS and PPS and refresh the complete frame within 1 second due to AIR.

Is there any limitation in the codec which makes I/IDR frame a must to start decoding? Aren't SPS and PPS sufficient for this?

I'm using EZSDK 5.05.02.00 with the default h.264 decoder.

Regards,

Manu

  • Hi Manu,

    Can you please share the bitstream? 

  • Hi Prashanth,

    Please find the bitstream attached. 

    Can you please let me know what aspect you are looking for in the bitstream?

    enc_dump.zip

    Regards,

    Manu

  • Hi Manu,

    Thanks for the bitstream.

    Decoder is behaving normal even with out IDR frame. I did not see any issue, also no error was set by codec. It should work fine. Issue could be in ezsdk. I am not familiar with ezsdk. Codec wise its working fine.

    What is the h264 decoder version you are using?

    Manu Iyengar said:
    Can you please let me know what aspect you are looking for in the bitstream?

    We wanted to check it on standalone setup. I have also verified on J6 with PSDKLA viddec3test. If you have a set up you can try the same.

  • Hi Prashanth,

    Thanks for the details. 

    The version of h.264 decoder I'm using is 02.00.07. I hope this version of decoder also supports decoding without IDR frames.

    Are there any specific decoder settings that I might be missing to ensure this works?

    Regards,

    Manu

  • Hi Manu,
    Yes the version you using also should support decoding without IDR Frame. If possible I suggest you to use the latest h264-decoder release ver: 02.00.21.00 . You can contact you local FAE.

    For configs, please refer ../packages/ti/sdo/codecs/h264vdec/app/test/testvecs/config/. These are working configs. You might cross verify with your settings.

    There is a sample test application @ ../packages/ti/sdo/codecs/h264vdec/app/test/

  • Hi Manu,
    Is the issue still open?
  • Hi Prashanth,

    Apologies for the delayed response. Yes, the issue is still open.

    I've also tried this with decoder version 02.00.21.00 on DM8168. I have also checked the configurations of decoder test application but did not find any significant difference from our application. The decoder still fails to start decoding until the first IDR frame is given by the application.

    FYI, there is another issue I had reported here which is also seen with decoder 02.00.21.00.

    I do not have the logs now but I can share them if required.

    Am I missing something? Please let me know your thoughts

    Regards,

    Manu

  • Hi Manu,

    As I said earlier, decoder behaves fine with the stream shared by you. It decodes even without IDRFrame. I feel this issue is related to OMX-ezsdk.

    Manu Iyengar said:
    I do not have the logs now but I can share them if required.
    Please share the logs. I will try to analyse. 

  • Hi Prashanth,

    Please find the decoder logs attached.

    decoder_err_log.txt

    As you can see from the logs, the following errors keep repeating for every frame until IDR is received -

    N:Video P:1 #:03987 T:000016a455448f47 M:xdc.runtime.Main S:OMX_TI_VIDDEC_CB_ProcessDone::Line 3343::omxHandle 0x9dff5618::non duped buffer in freebufid error 0x1421 bufstatus 5
    N:Video P:1 #:03988 T:000016a45549d937 M:xdc.runtime.Main S:OMX_TI_VIDDEC_CB_ProcessDone::Line 3357::omxHandle 0x9dff5618::Error->Decoder returned error 0x1421
    N:Video P:1 #:03989 T:000016a455bffb7a M:xdc.runtime.Main S:OMX_TI_VIDDEC_Process::Line 2842::omxHandle 0x9dff5618::Error->Decoder returned error 0x1421

    Please let me know your thoughts

    Regards,

    Manu

  • Hi Manu,

    Thanks for the log, I have asked the experts to check the log. Mean while can you try to run the standalone test app provided with package? Its under component-sources/ivahd_h264vdec_02_00_20_00_production/packages/ti/sdo/codecs/h264vdec/app.

    I am not seeing the issue in standalone setup. This is related to OMX. I will get back to you once I have some reply.

    Is it possible to get logs of inputBytes to the codec and and the bytesConsumed at frame level? This will help.

  • Hi Prashanth,

    Thanks for looking into this. I will see if I can run the test app but it may take a while as I do not have the required setup for this. 

    I have attached the logs you asked with our application.

    I have logged the following parameters for each frame - 

    1. viddec3InArgs->numBytes (inputBytes)

    2. outArgs->bytesConsumed (bytesConsumed)

    dec_err_log_2.txt

    Regards,

    Manu

  • Manu,
    I see some issue with parser here. The bytesconmused is going beyond input numBytes and hence the error 0x1421.
    Looks like to me parser is feeding one field and decoder is trying to decode both the fields.

    In src/ti/omx/comp/vdec/src/omx_h264vd.c , params->processCallLevel = 1;
    means decode both the field. This works only if input buffer is filled with data for both the fields in one VIDDEC3_process call.
    Setting this flag to 0 , VIDDEC3_process decodes one field only even if input buffer has data for both the fields.

    Looks like till the first IDR frame, parser is feeding only one field or imcomplete frame in the input buffer

    Ramprasad
  • Hi Ram,

    Thanks for the suggestion. I realized that there is a problem in the log I had shared. I was running decoder in sub-frame mode (input side) and hence inputBytes were not matching with bytesConsumed. The inputBytes value corresponded to the first slice only. Apologies for the confusion.

    I have corrected it now by running decoder in frame mode. I'm still seeing the same issue (decoder waiting for first IDR frame) even in frame mode. Moreover, I have generated logs for 720p60 to avoid field related issues. Even previously shared log was for 720p60. Please find the new decoder logs with frame mode of operation attached.

    dec_err_log_3.txt

    Additionally, I have also made sure that processCallLevel is set to 0 so that the problem you have described does not occur for interlaced formats. Our application feeds only one field at a time to decoder. 

    Looking forward to your inputs on this

    Regards,

    Manu