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.

DM8168 max bitrate is unbound for specific content.

I'm using the h264 codec from the extended BSP (ivahd_h264enc_02_00_02_02_production)

Codec is configured with 2 calls:

* Read OMX_VIDEO_PARAM_STATICPARAMS from codec, adapt settings & write back.

* Read OMX_VIDEO_CONFIG_DYNAMICPARAMS from codec, adapt settings & write back.

Following settings are changed:

* Static:

videoStaticParams.h264EncStaticParams.videnc2Params.encodingPreset = 3;     /* XDM_USER_DEFINED */
videoStaticParams.h264EncStaticParams.videnc2Params.rateControlPreset = 2;    /* IVIDEO_STORAGE (VBR) */
videoStaticParams.h264EncStaticParams.videnc2Params.level = 50     /* IH264_LEVEL_50 */

videoStaticParams.h264EncStaticParams.IDRFrameInterval = 1; /* each Iframe is an IDR frame */
videoStaticParams.h264EncStaticParams.entropyCodingMode = 0; /*IH264_ENTROPYCODING_DEFAULT */
videoStaticParams.h264EncStaticParams.transformBlockSize = 2; /* IH264_TRANSFORM_DEFAULT */

* dynamic:

videoDynamicParams.h264EncDynamicParams.videnc2DynamicParams.intraFrameInterval = 60; /* 1 Iframe / sec */
videoDynamicParams.h264EncDynamicParams.videnc2DynamicParams.targetFrameRate    = 60000; /* 1000 * the expected framerate */
videoDynamicParams.h264EncDynamicParams.videnc2DynamicParams.targetBitRate      = 4000000; /* 4MBit */

I need the IDRFramerate interval. We have one I frame each second, and we need to be able to pick up the stream from that Iframe on, so it must be an IDR frame. (not that fancy)

For most of our content, the bit-rate will remain within this limit. (4 MB/sec)

BUT: for some specific very high moving, very high frequency content, this limit isn't respected. I've seen (continuous) bit-rates of > 48MBit.

In fact, the 'targetBitRate' doesn't change anything for this content. It doesn't matter if it's 10MBit, 2MBit, 512Kbit.

There is a parameter called maxBitRate, but this doesn't seem to do anything.

I switched to IVIDEO_LOWDELAY (CBR), but the problem remains.

In this specific case, severe image degradation is acceptable. Unbound bit-rate is not.

What can we do to prevent this bitrate?

I can't simply post images on e2e. (NDA)

But I can provide images / h264 stream via mail / ftp.

  • Theo,

    In case of IVIDEO_LOW_DELAY (CBR),  what is the value of the rate control parameter enablePartialFrameSkip ? By default its value is zero. If not set, can you make enablePartialFrameSkip = 1 and see if there is any improvement in your case ?

    This will allow the encoder to decide in favor of skipping partial frames to meet the bitrate.

  • I added the following.

    First:

    videoStaticParams.h264EncStaticParams.rateControlParams.enablePartialFrameSkip = 1;

    videoDynamicParams.h264EncDynamicParams.rateControlParams.enablePartialFrameSkip = 1;

    Second:

    videoStaticParams.h264EncStaticParams.rateControlParams.rateControlParamsPreset = 1;

    videoStaticParams.h264EncStaticParams.rateControlParams.enablePartialFrameSkip = 1;

    videoDynamicParams.h264EncDynamicParams..rateControlParams.rateControlParamsPreset = 1;

    videoDynamicParams.h264EncDynamicParams.rateControlParams.enablePartialFrameSkip = 1;

    Neither one solves my issue. All options (nothing, first, second) give me more or less the same result:

    Example output:

    timestamp: 14963.964274 - diff 0.016691 size = 2221120
    timestamp: 14963.980966 - diff 0.016692 size = 120
    timestamp: 14963.997657 - diff 0.016691 size = 1320672
    timestamp: 14964.014349 - diff 0.016692 size = 1258400
    timestamp: 14964.031040 - diff 0.016691 size = 855688
    timestamp: 14964.047732 - diff 0.016692 size = 1113528
    timestamp: 14964.064423 - diff 0.016691 size = 120
    timestamp: 14964.081115 - diff 0.016692 size = 1403328
    timestamp: 14964.097806 - diff 0.016691 size = 1374848
    timestamp: 14964.114498 - diff 0.016692 size = 1299992
    timestamp: 14964.131189 - diff 0.016691 size = 1082216
    timestamp: 14964.147881 - diff 0.016692 size = 120
    timestamp: 14964.164572 - diff 0.016691 size = 1419232
    timestamp: 14964.181264 - diff 0.016692 size = 1397936
    timestamp: 14964.197955 - diff 0.016691 size = 1266728
    timestamp: 14964.214647 - diff 0.016692 size = 1122816
    timestamp: 14964.231338 - diff 0.016691 size = 120
    timestamp: 14964.248029 - diff 0.016691 size = 1245488
    timestamp: 14964.264721 - diff 0.016692 size = 1373824
    timestamp: 14964.281412 - diff 0.016691 size = 1399456
    timestamp: 14964.298104 - diff 0.016692 size = 1383728
    timestamp: 14964.314795 - diff 0.016691 size = 120
    timestamp: 14964.331487 - diff 0.016692 size = 1249544
    timestamp: 14964.348178 - diff 0.016691 size = 1390936
    timestamp: 14964.364870 - diff 0.016692 size = 1428656
    timestamp: 14964.381561 - diff 0.016691 size = 1311208
    timestamp: 14964.398253 - diff 0.016692 size = 120
    timestamp: 14964.414944 - diff 0.016691 size = 861176
    timestamp: 14964.431635 - diff 0.016691 size = 1108272
    timestamp: 14964.448327 - diff 0.016692 size = 1303032
    timestamp: 14964.465018 - diff 0.016691 size = 1409360
    timestamp: 14964.481710 - diff 0.016692 size = 120
    timestamp: 14964.498401 - diff 0.016691 size = 1385776
    timestamp: 14964.515093 - diff 0.016692 size = 1315312
    timestamp: 14964.531784 - diff 0.016691 size = 1080432
    timestamp: 14964.548476 - diff 0.016692 size = 1322808
    timestamp: 14964.565167 - diff 0.016691 size = 120
    timestamp: 14964.581859 - diff 0.016692 size = 1404608
    timestamp: 14964.598550 - diff 0.016691 size = 1270112
    timestamp: 14964.615242 - diff 0.016692 size = 1134024
    timestamp: 14964.631933 - diff 0.016691 size = 863280
    timestamp: 14964.648625 - diff 0.016692 size = 120
    timestamp: 14964.665316 - diff 0.016691 size = 1348152
    timestamp: 14964.682008 - diff 0.016692 size = 1399760
    timestamp: 14964.698699 - diff 0.016691 size = 1380712
    timestamp: 14964.715390 - diff 0.016691 size = 1031040
    timestamp: 14964.732082 - diff 0.016692 size = 120
    timestamp: 14964.748773 - diff 0.016691 size = 1376832
    timestamp: 14964.765465 - diff 0.016692 size = 1427944
    timestamp: 14964.782156 - diff 0.016691 size = 1310536
    timestamp: 14964.798848 - diff 0.016692 size = 1248416
    timestamp: 14964.815539 - diff 0.016691 size = 120
    timestamp: 14964.832231 - diff 0.016692 size = 1120352
    timestamp: 14964.848922 - diff 0.016691 size = 1299392
    timestamp: 14964.865614 - diff 0.016692 size = 1408120
    timestamp: 14964.882305 - diff 0.016691 size = 1378688
    timestamp: 14964.898996 - diff 0.016691 size = 120
    timestamp: 14964.915688 - diff 0.016692 size = 1084952
    timestamp: 14964.932379 - diff 0.016691 size = 1316968
    timestamp: 14964.949071 - diff 0.016692 size = 1426600
    total_size = 61937440

    Any other suggestions?

  • I enabled the following as well:

     

    videoStaticParams.h264EncStaticParams.rateControlParams.allowFrameSkip = 1;

    videoDynamicParams.h264EncDynamicParams.rateControlParams.allowFrameSkip = 1;

     

    In this case, the framerate is within limits, but the video now has a very strong 'pumping' effect.
     (Image looks bad when I frame occurs, and improves)

    This effect will also not be accepted.

  • Theo,

    What is the value provided for HRDBufferSize ?

    You can reduce the value of HRDBufferSize so that the bit consumption will be reduced, but some visual degradation is expected in this case.

    Also please share the entire encoder configuration settings you are using for the exercise. 

  • Mohd. Harris said:

    What is the value provided for HRDBufferSize ?

    Default setting. I don't change it.

    Dynamic parameters:

        initialBufferLevel            : 0
        HRDBufferSize                 : 2500000

    Static parameters:

        initialBufferLevel            : 12000000
        HRDBufferSize                 : 24000000

    When reading status:

        initialBufferLevel            : 0
        HRDBufferSize                 : 0

    If I should reduce this, what value do you propose?

    Mohd. Harris said:

    Also please share the entire encoder configuration settings you are using for the exercise.

    The entire encoder configuration setting is noted into the first post of this thread.

  • Theo,

    You can make HRDBufferSize and InitialBufferLevel to values less than or equal to half the targetBitrate in case of CBR and let us know if any changes are being observed.

    For example, if the targetBitrate is 4Mbps, then make HRDBufferSize and InitialBufferLevel to 2Mbps, 1Mbps etc.

    Meanwhile you can send the stream having the issue to the following mail id for analysis: 

    mohd.harris@ti.com

  • The HRD solves our issue. Bandwidth is/remains now within limitations.

    There is still a pumping effect visible, but I believe it's inherent to our I frame mechanism.


    Thanks for helping.