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.

dm841x encoder lower bit-rate issue

Hello TI,

We are using ezsdk_dm814x-evm_5_05_01_04 with overlay source code.

We are able to set encoder dynamic parameter with this link: e2e.ti.com/.../288641

Now we are facing following issue.

1. Set encoder bit-rate 1700Kbps then output bit-rate is 1700Kbps
2. Set encoder bit-rate 1500Kbps then output bit-rate is 1500Kbps
3. Set encoder bit-rate 1100Kbps then output bit-rate is 1100Kbps
4. Set encoder bit-rate 1000Kbps then output bit-rate is 1000Kbps
5. Set encoder bit-rate 900Kbps then output bit-rate is ~203Kbps.Here it continuesly giving around 203Kbps bit-rate until
application request for IDR frame.

Please help me to resolve this issue.

Thanks,
Jignesh Patel

  • Hello,

    What is the encoder version that you are using here?

    BR
    Margarita
  • Hello Margarita,

    We are using ivahd_h264enc_02_00_02_02_production encoder in ezsdk. 

    Thanks,

    Jignesh Patel 

  • Hello Margarita,

    Some more information on this issue.

    I observe this issue only by decreasing bit-rate in sequence like. 1700, 1500,1400,1300,1200,1100 etc..

    Mostly Issue observe after 1300 bit-rate. Means when I change bit-rate from 1300 to 1200 or 1300 to 1100.

    Also issue recover if application set high bit-rate like 1700 and then set any lower bit-rate less then or equal to 1300.

    Thanks,
    Jignesh Patel
  • Hi Margarita,

    Any update on this issue ?

    Following are some more information.
    Application does not change videoDynamicParams.h264EncDynamicParams.rateControlParams.initialBufferLevel value on bit-rate change.

    Above issue happen while application not setting videoDynamicParams.h264EncDynamicParams.rateControlParams.initialBufferLevel parameter with bit-rate setting. Application does not setting this parameter because it insert I frame after setting bit-rate.

    Thanks,
    Jignesh Patel
  • Hello,

    The initialBufferLevel and HRDBufferSize should be set and they will depends on CBR/VBR.
    When both are set are you observe the issue?

    BR
    Margarita
  • Hello Margarita,

    Setting HRDBufferSize and initialBufferLevel will generate I frame after setting bit-rate. Application does not want to generate I frame so we are not setting this parameter.

    Please let us know how we can resolve this issue. it is very critical.

    Thanks,

    Jignesh Patel

  • Also when both parameter set then we do not observe this issue.
  • Also when both parameter set then we do not observe this issue

  • Hi Jignesh,

    The behavior is expected behavior .
    If dynamically you are changing the bit-rate -
    - If minor change in the bitrate, then you can avoid the changing the HRDBufferSize and initialBufferLevel .
    - If change in the bitrate is bigger (>15-20%), then better change the HRDBufferSize and initialBufferLevel . Since rate control behavior depends on these parameters.

    And also make sure in case of
    CBR ==> HRDBufferSize = initialBufferLevel = 0.5 * bitrate
    VBR ==> HRDBufferSize = initialBufferLevel = 2 * bitrate

    Can you try the same experiment by disabling the vuiCodingParams.hrdParamsPresentFlag if its enabled.

    Regards
    Gajanan
  • Thanks Gajanan for quick reply. I will check today and let you know the result.
  • Hello Gajanan and Margarita,

    Our application do not want to get I frame on setting every bit-rate. So we have added following logic to set "HRDBufferSize and initialBufferLevel".

    Bitrate Value HRDBufferSize and initialBufferLevel
    bitrate > 6400000 4000000
    bitrate > 3200000 2560000
    bitrate > 1600000 1280000
    bitrate > 800000 640000
    bitrate > 400000 320000
    bitrate < 400000 160000

    Also note that vuiCodingParams.hrdParamsPresentFlag  is already disabled.

    Now application try sequence like 1700000, 1200000, 1100000, 1000000, 900000 then at 900000 bit-rate we observe this issue that bit-rate is around 203000.

    Also e2e link:

    This above link shows that new version of encoder has solution that it does not generate I frame with "HRDBufferSize and initialBufferLevel" value setting. So please confirm that this will help to resolve our issue or not. If yes then please let us know from where we can get this new encoder version and how we can integrate this encoder with ezsdk "ezsdk_dm814x-evm_5_05_01_04". 

    Thanks,

    Jignesh Patel

  • Hi Jignesh,

    With change in "HRDBufferSize and initialBufferLevel", there will be always insertion of I/IDR frame. There is no Encoder version to avoid this. If you go through the link you shared, it was clearly mentioned the list of parameters by changing which I/IDR frame will be inserted.
    Below are the parameter which you should follow with bitrate change for best results. If you don't want to insert I/IDR frame, then don't change the "HRDBufferSize and initialBufferLevel".

    CBR ==> HRDBufferSize = initialBufferLevel = 0.5 * bitrate
    VBR ==> HRDBufferSize = initialBufferLevel = 2 * bitrate

    What intraFrameinterval you are using. You can try changing the HRDBufferSize and initialBufferLevel according to bitrate, when I/IDR frame comes due to Intraframeinterval.

    Regards
    Gajanan
  • Hello Gajanan,

    Thanks for providing this information. I really appreciate this help. It was great help for me to find root cause.

    We observe that the Bit-rate at which HRD buffer change at that bit-rate, encoder allow to change 25% of  bit-rate without changing HRD buffer. If application change bit-rate more then 25% of bit-rate then issue gets observed.

    So we change application according to this. So now this workaround work for us.

    Thanks,

    Jignesh Patel

  • Hi Jignesh,

    As of now its working for you with 25% bit-rate change. But it may not work always & its just workaround. This is the expected behavior when Bitrate vs IntialBufferLevel & HRDBuffersize varies too much. For better understanding pleas go through the HRDBuffering usage for H.264 Standard.

    What is the intraFrameinterval parameter value you are setting ?? Is it possible to use , when I/IDR frame is expected, change the HDRbUFFERSIZE along with IntialBufferLevel.

    Regards
    Gajanan