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.

Frame Rate (H264 Encoder 1.20.02.00)

Hello,

I am trying to set the frame rate and the bit rate in my encoder instance.  I would like the Frame Rate to 8 frames per second and the CBR to 800000bps. 

I set static parameters to:    

    params.rateControlPreset = IVIDEO_LOW_DELAY;
    params.maxBitRate        = 800000;  
 
    params.inputChromaFormat = XDM_YUV_420SP;  // can you change this to be RGB? No.  This codec version only accepts 420SP
    params.reconChromaFormat = XDM_CHROMA_NA;
    params.maxWidth          = 480;
    params.maxHeight         = 720;
    params.maxFrameRate      = 8000;
 

and dynamic parameters to:

    dynParams.targetBitRate      = params.maxBitRate;
    dynParams.inputWidth         = params.maxWidth;
    dynParams.inputHeight        = params.maxHeight;
    dynParams.refFrameRate   = params.maxFrameRate;
    dynParams.targetFrameRate  = params.maxFrameRate;
    dynParams.intraFrameInterval = 8;

Then I feed the encoder a frame every 125ms. 

I think this should be quite simple and the parameters will be set, however when I use StreamEye from Elcard, I see that this tool at least does not think those are the values.  I would expect that the total number of bits for every 8 frames should total around 800,000 but tha tis not the case.  I would also expect that the tool would know that it is CBR but instead it is telling me it is still a VBR.

Does this version of encoder not support setting these variables?  I have even tried to set "encodingPreset = XDM_USER_DEFINED" but the H264 User Guide says this setting is not supported anyhow.   Does this mean I cannot change any pre-sets in this encoder?

Thanks for your help, please let me know if you would more information.

Brandy

  • Hi Brandy,

    Can you please let us know which platform and codec you are working on?

    Ideally if you have set 800kbps and 8fps, you should be seeing approximately 800kbits/8 frames. The decoder cannot distinguish between CBR and VBR or any other rate control algo, as this is not indicated in the bit-steam.

    Rgds, mahant

     

  • Hi Mahant,

    The codec is the H264 Codec version 1.20.02.00 on the dm6467.  Attached is the screen shot from the Stream Eye.  If is tough to see exactly, but you can see the GOP changed to 8 but within the GOP there is clearly not 800,000 bits.

    Thanks for your advice.

     

    Brandy

     

  • Hi Brandy,

    I see that rate-control(RC) is behaving normally in this case.

    The P-frame that is being pointed (snapshot) is taking 9764 bytes. I-frame is approximately taking 3 times P-frame size.

    In a GOP that has 1 I-frame + 7 P-frame ~ 10 P-frame bytes. That is 97640 bytes = 97640 x 8 = 781120 bits ~ 800000 bits.

    One thing we need to understand is RC tries to achieve the set target bit-rate. Normally there will be minor deviations between achieved bit-rate and set bit-rate depending on RC algorithm being used.

    Rgds, mahant