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.

How can I limit the bitrate below the targetBitRate?



Hi everyone,

        I use TI's H.264 encoder in RDK3.0 and do experiments.  According our reqirements, I set

encoder's resolution is 4CIF (704*576)

targetBitRate = 256*1000

qpMax = 42 (Because I want certain quality)

And allowFrameSkip = 1

If I use more complex input, the bitrate will reach about 500k+ or more.

And I observe there are some frame skip occurred.  (Most two consecutive frames skipped)

But not enough frames are skipped to reach the targetBitRate. 

The rate control mechanism seems not work for our case.

So, could I adjust any more parameters to reach the targetBitRate?

Sincerely,

James

  • Are you using VBR or CBR. Can you share the encoded bitstream for analysis.Also can you check if in the encLInk_h264.c is discardSavedBIts set to TRUE or FALSE.Also what is the reason for setting such low bitrate ? 2Mbps is reasonable bitrate for 4CIF resolution.256*1000 is too low. If you want to increase the number of skip frames you can increase the numSkipPerDistributionWindow.

  • Dear Badri,

            Thank you for your reply.  It's useful to control the bitrate.

    The reason for setting such low bitrate is customer's request.

    But I met another problem.  My setting is as below:

    rateControlPreset = IVIDEO_LOW_DELAY;

    rcAlgo = 0;

    allowFrameSkip = 1;

    skipDistributionWindowLength = 5;

    numSkipInDistributionWindow = 2;

    There is almost one time down when I run ten times.

    The down situation for H.264 encoder is only first I frame encoded then no more frames encoded.

    If I change skipDistributionWindowLength and numSkipInDistributionWindow, this situation seems more frequently.

    So how to solve this problem? And can we set skipDistributionWindowLength and numSkipInDistributionWindow

    randomly? Or is there any rule for setting these parameters properly? Thank you very much.

    Sincerely,

    James

  • Hi James,

    Let me first explain the background of the parameters - so it will be easier to explain later.
    For low bit rate cases - rate control has to skip frames to meet the target bit rate.Now for time being assume that encoder doesn't have any option apart from skipping the frame, it is giving one flexibility to user by exposing skip control parameters (skipDistributionWindowLength and numSkipInDistributionWindow). Basically this is to prevent a series of skip frames. Now encoder have constraint of skipping only numSkipInDistributionWindow (2) out of skipDistributionWindowLength (5). So you can set the parameter as your application demands. both parameter being equal means encoder has full flexibility to skip the frames and higher the gap b/w these 2 parameters, more the restriction on encoder to skip the frames.

    Now you might question that why encoder is skipping the frames. This totally depends on the

    --> content (complexity of scene)

    --> bits per pixel (resolution/bitrate).

    --> Allowed QP range

    If encoder is skipping the frame then it means that the bits/pixel is not sufficient. If you still think that encoder would have not skipped the frame - please share the stream with value of complete configuration parameters. I can analyze and let you know.

    Your basic parameters related to rate control looks fine.

    With Regards,
    Pramod