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.

Changing Bit-rate dynamically inserts I-Frame in Encoded data

Hello TI,

 

We are using DM8148 based custom board and using ezsdk_dm814x-evm_5_05_01_04 from software perspective.

In one of our application it is required to change bit-rate dynamically which we achieve successfully, but when we change the bit-rate encoder inserts I-Frame into the encoded data.

Is it a known behaviour?

If we don't want to insert I-Frame (P-Frame will be ok), how can I achieve this?

Is there a way to disable IDR frame auto-generation upon changing encoder’s bitrate?

We have tried a few approaches to disable it (including manipulating the value of ‘forceFrame’ field). However, neither of them helps.

 

Thanks

Krunal

  • Hi Krunal,

    I tried capture-encode demo to experiment this. I modified the bitRate with index OMX_IndexConfigVideoBitrate at frameCount = 225.  Generated bitstream has I frame at exactly at interval of 90 and At frame 225 I don't see I/IDR frame.

    What are the other components you are using?

    Ram

  • Hello Ram,

    I tried with OMX_IndexConfigVideoBitrate index but still I got the I-Frame when I changed the bitrate.

    Above is the code snippet I implemented. 

    Can you please share your encoded file with change in the bitrate?

    Also can you send me your code snippet?


    Thanks

    Krunal

  • Hi Krunal,

    I modified IL_ClientOutputBitStreamWriteTask function in ilClient.c of capture_encode example and added following snippet.

    if(frameCounter == 225)
    {

    OMX_VIDEO_CONFIG_BITRATETYPE tVidEncBitRate;
    OMX_INIT_PARAM (&tVidEncBitRate);
    printf (" Changing the encoder bitrate \n");
    tVidEncBitRate.nPortIndex = OMX_VIDENC_OUTPUT_PORT;
    err = OMX_GetConfig (encILComp->handle, OMX_IndexConfigVideoBitrate,
    &tVidEncBitRate);

    tVidEncBitRate.nEncodeBitrate = 2000000;
    err = OMX_SetConfig (encILComp->handle, OMX_IndexConfigVideoBitrate,
    &tVidEncBitRate);
    if (err != OMX_ErrorNone)
    {
    ERROR ("failed to set Encode bitrate \n");
    }

    }

    I executed, 

    ./capture_encode_a8host_debug.xv5T
    -m 720p -f 30 -b 1000000 -o /usr/share/ti/data/videos/sample.264 -n 500 -d 0

    Generated 264 doesn't have I frame at frame 225. I have attached the stream. Rename .txt to .264

    Ram

  • Hi Ram,

    Krunal tried the same thing but it was in our custom board with our own application based on capture_encode demo. We will test it at our end on EVM board with the same code you posted.

    BTW, I didn't find the encoded file as a attachment. Can you please attached it again?

    Regards,

    Hitesh

  • Hi Hitesh,

    I had attached the file. somehow it is not uploaded.

    Ram1323.sample.txt

  • Hi Ram,

    The encoded file doesn't have I Frame as you mentioned. But I doubt that the bit-rate gets change from 225 frame. How did you verified that the bit-rate gets changed?

    I played it in elecard and in fact the encoded file doesn't have VUI information which tells about the codec information and changes in the same.

    Let me know if you need anymore information.

    Regards,

    Hitesh

  • Hi Hitesh,

    I made sure SETPARAMS control is called to set the encoder bitrate from the UILogger dump.  I am using default NAL settings hence I didn't observe VUI in SPS.

    I got few info from codec team. if SPS_VUI is ON in either naluPresentMaskIDRPicture or naluPresentMaskStartOfSequence, then I frame insertion is done always when we change the bitRate dynamically.

    What is your NALU settings?

    Ram

  • Hi Ram,

    Below are our NALU Settings :

      tStaticParam.videoStaticParams.h264EncStaticParams.nalUnitControlParams.naluControlPreset = IH264_NALU_CONTROL_USERDEFINED;
      H264_SETNALU_MASK_SPS(tStaticParam.videoStaticParams.h264EncStaticParams.nalUnitControlParams.naluPresentMaskIntraPicture);
      H264_SETNALU_MASK_PPS(tStaticParam.videoStaticParams.h264EncStaticParams.nalUnitControlParams.naluPresentMaskIntraPicture);
      H264_SETNALU_MASK_SPS(tStaticParam.videoStaticParams.h264EncStaticParams.nalUnitControlParams.naluPresentMaskIDRPicture);
      H264_SETNALU_MASK_PPS(tStaticParam.videoStaticParams.h264EncStaticParams.nalUnitControlParams.naluPresentMaskIDRPicture);
      H264_SETNALU_MASK_SEI(tStaticParam.videoStaticParams.h264EncStaticParams.nalUnitControlParams.naluPresentMaskIDRPicture);
      H264_SETNALU_MASK_SPS(tStaticParam.videoStaticParams.h264EncStaticParams.nalUnitControlParams.naluPresentMaskStartOfSequence);
      H264_SETNALU_MASK_PPS(tStaticParam.videoStaticParams.h264EncStaticParams.nalUnitControlParams.naluPresentMaskStartOfSequence);
      H264_SETNALU_MASK_SEI(tStaticParam.videoStaticParams.h264EncStaticParams.nalUnitControlParams.naluPresentMaskStartOfSequence);

    We are referring h264 datasheet in which it is mentioned that:

    "Change in resolution will result in IDR insertion. Change in bit rate may insert IDR if HRD parameters are coded as part of bit-stream. Similarly if timing info related parameters are coded in bit-stream then it can cause insertion of IDR by doing change in frame rate"

    There is a parameter named "hrdParamsPresentFlag" in the datasheet which will disable the insertion of IDR Frame.

    But still we get IDR Frame when we change bitrate dynamically.

    Can you direct us regarding this?

    Thanks

    Krunal

  • Krunal,

    We can avoid I picture insertion & can keep frame type as 'P/B' for dynamic bit_Rate/frame_Rate change if hrdParamsPresentFlag & timingInfoPresentFlag (part of vui coding params) are 0. This has been tested at our end.
    Please make sure that your settings are proper. You can verify your encoder settings by making a control call for XDM_GETSTATUS.

    Below information would help you,

    Encoder Reset and insertion of IDR happens for dynamic change of listed parameters

    Params Change

    Effect

    streamFormat

    Encoder Reset and IDR insertion for Dynamic change of these parameters

    targetBitRate AND hrdParamsPresentFlag

    targetFrameRate AND timingInfoPresentFlag

    sampleAspectRatioHeight AND (aspectRatioIdc == IH264ENC_ASPECTRATIO_EXTENDED)

    sampleAspectRatioWidth AND (aspectRatioIdc == IH264ENC_ASPECTRATIO_EXTENDED)

    inputHeight

    inputWidth

    scalingMatrixPreset

    rcAlgo

    chromaQPIndexOffset

    HRDBufferSize

    initialBufferLevel

    enableHRDComplianceMode

    intraCodingBias

    Note : If you want to change bitrate/frameRate without insertion of IDR picture, then disable hrdParamsPresentFlag and timingInfoPresentFlag. And aslo keep other parameters unaltered.


    Thanks,
    Santosh
  • Hi Santosh,

    When we keep frame type other the I/IDR for dynamic bitRate change then application hungs (We tried P and B).

    We kept the value of hrdParamsPresentFlag and timingInfoPresentFlag as '0' as per your suggestion but still we didn't got the required output.

    The main problem is we are not able to give forceFrame other than I/IDR.

    Can you tell us how did you verified this?

    Thanks

    Krunal

     

  • Krunal,

    • I doubt if you are changing only bitrate parameter of encoder, along with this parameter you might be changing other configurations like hrdBufferSize, initBufLevel etc., If you do so, you can avoid insertion of IDR anymore.Please refer the table provided in the last reply for the parameters which shouldn't be altered.
    • You can verify this by doing a XDM_GETSTATUS control call before and after dynamic bit rate change. Compare the status structure returned from encoder.
    • Yes, you cannot force any pictures than IDR. Just allow that parameter as default.
    Thanks,
    Santosh
  • Hi Santosh,

    Thanks for you inputs. Now onwards I am going to debug this issue. Below are some observations and queries.

    1. Value of flags hrdParamsPresentFlag, timingInfoPresentFlag according to you must be set to '0'   if we don't won't insert IDR frame. But according to datasheet (H264_Encoder_HDVICP2_UserGuide.pdf :page 126) it must be set to "non zero"  if we don't wan to insert HRD parameters and timing information. Please correct me if I am wrong. 

    2. As per you suggestion we print the values of all the parameter which may insert IDR frame. But value of HRDBufferSize, and initialBufferLevel get changed according to new bitrate. Even if we don't change anything. It takes value (bitrate*2) .

    3. One more thing even if I set values of parameters hrdParamsPresentFlag, timingInfoPresentFlag to "1" . And when I read back  I always get those as "0". Is there any reason behind this.

    4. We are using Elecard StreamEye to verify insertion of IDR frame. Please let me know how you are verifying this at your side.

    Please direct us for this issue based our observations. Because this issue is reported by our client. And need to be solved with high priority.

    Regards,

    Jemish

  • Jemish, 

    I think you are using default RC configuration - rateControlParamsPreset = IH264_RATECONTROLPARAMS_DEFAULT, can you please work with user_defined preset. 

    And share the whole set of encoder configurations used at your end. (static , dynamic and encoder status )

    Thanks,

    Santosh

  • Hi Santosh,

    I have share all the parameters which we are using currently without any change now direct us which parameters we have to modify to avoid I/IDR frame insertion.

    #### videnc2Status Param

    extendedError          = 0
    encodingPreset         = 3
    data                   = 0
    accessMask             = 0
    rateControlPreset      = 5
    maxInterFrameInterval  = 1
    inputChromaFormat      = 9
    inputContentType       = 0
    operatingMode          = 1
    profile                = 100
    level                  = 42
    inputDataMode          = 3
    outputDataMode         = 3
    numInputDataUnits      = 1
    numOutputDataUnits      = 1
    configurationID        = 1271
    minNumInBufs           = 2
    minNumOutBufs          = 1
    minInBufSize[0]        = 1280
    minOutBufSize[0]       = 1382400
    inBufMemoryType[0]     = 1
    outBufMemoryType[0]    = 0
    minNumBufSets          = 1
    metadataType[0]        = -1
    metadataType[1]        = -1
    metadataType[2]        = -1
    size                      = 236
    inputHeight               = 720
    inputWidth                = 1280
    refFrameRate              = 60000
    targetFrameRate           = 50000
    targetBitRate             = 2000000
    intraFrameInterval        = 60
    generateHeader            = 0
    captureWidth              = 1280
    forceFrame                = -1
    interFrameInterval = 60
    mvAccuracy                = 2
    sampleAspectRatioHeight   = 1
    sampleAspectRatioWidth    = 1
    ignoreOutbufSizeFlag      = 0
    lateAcquireArg            = 0

    #### IH264ENC_Status Param

    interlaceCodingType     = 3
    bottomFieldIntra        = 0
    gopStructure            = 0
    entropyCodingMode       = 1
    transformBlockSize      = 1
    log2MaxFNumMinus4       = 12
    picOrderCountType       = 0
    enableWatermark         = 0
    IDRFrameInterval        = 0
    maxIntraFrameInterval   = 65535
    debugTraceLevel         = 0
    lastNFramesToLog        = 0
    enableAnalyticinfo      = 0
    enableGMVSei            = 0
    constraintSetFlags      = 0
    enableRCDO              = 0
    enableLongTermRefFrame  = 0
    LTRPPeriod              = 0
    searchCenter            = 0
    enableStaticMBCount     = 0
    numTemporalLayer        = 1
    referencePicMarking     = 0
    extMemoryDebugTraceSize = 36
    enableROI               = 0

    #### IH264ENC_Status->rateControlParams Param

    rateControlParamsPreset      = 0
    scalingMatrixPreset          = 0
    rcAlgo                       = 0
    qpI                          = -1
    qpMaxI                       = 36
    qpMinI                       = 10
    qpP                          = -1
    qpMaxP                       = 40
    qpMinP                       = 10
    qpOffsetB                    = 4
    qpMaxB                       = 44
    qpMinB                       = 10
    allowFrameSkip               = 0
    removeExpensiveCoeff         = 0
    chromaQPIndexOffset          = 0
    IPQualityFactor              = 0
    initialBufferLevel           = 4000000
    HRDBufferSize                = 4000000
    minPicSizeRatioI             = 0
    maxPicSizeRatioI             = 0
    minPicSizeRatioP             = 0
    maxPicSizeRatioP             = 0
    minPicSizeRatioB             = 0
    maxPicSizeRatioB             = 0
    enablePRC                    = 1
    enablePartialFrameSkip       = 0
    discardSavedBits             = 0
    reserved                     = 0
    VBRDuration                  = 8
    VBRsensitivity               = 0
    skipDistributionWindowLength = 5
    numSkipInDistributionWindow  = 1
    enableHRDComplianceMode      = 1
    frameSkipThMulQ5             = 0
    vbvUseLevelThQ5              = 0

    #### IH264ENC_Status->interCodingParams Param

    interCodingPreset  = 0
    searchRangeHorP    = 144
    searchRangeVerP    = 32
    searchRangeHorB    = 144
    searchRangeVerB    = 16
    interCodingBias    = 1
    skipMVCodingBias   = 1
    minBlockSizeP      = 0
    minBlockSizeB      = 0
    meAlgoMode         = 0

    #### IH264ENC_Status->intraCodingParams Param

    intraCodingPreset          = 0
    lumaIntra4x4Enable         = 0
    lumaIntra8x8Enable         = 255
    lumaIntra16x16Enable       = 15
    chromaIntra8x8Enable       = 15
    chromaComponentEnable      = 1
    intraRefreshMethod         = 0
    intraRefreshRate           = 0
    gdrOverlapRowsBtwFrames    = 0
    constrainedIntraPredEnable = 0
    intraCodingBias            = 0

    #### IH264ENC_Status->nalUnitControlParams

    naluControlPreset              = 1
    naluPresentMaskStartOfSequence = 8672
    naluPresentMaskIDRPicture      = 8672
    naluPresentMaskIntraPicture    = 8450
    naluPresentMaskNonIntraPicture = 2
    naluPresentMaskEndOfSequence   = 0

    #### IH264ENC_Status->sliceCodingParams

    sliceCodingPreset = 0
    sliceMode         = 0
    sliceUnitSize     = 0
    streamFormat      = 0

    #### IH264ENC_Status->loopfilterPreset

    loopfilterPreset      = 0
    loopfilterDisableIDC  = 0
    filterOffsetA         = 0
    filterOffsetB         = 0

    #### IH264ENC_Status->fmoCodingParams

    fmoCodingPreset               =0
    numSliceGroups                =1
    sliceGroupMapType             =4
    sliceGroupChangeDirectionFlag =0
    sliceGroupChangeRate          =0
    sliceGroupChangeCycle         =0
    sliceGroupParams[0]           =0
    sliceGroupParams[1]           =0

    #### IH264ENC_Status->vuiCodingParams

    vuiCodingPreset            = 1
    aspectRatioInfoPresentFlag = 0
    aspectRatioIdc             = 0
    videoSignalTypePresentFlag = 0
    videoFormat                = 2
    videoFullRangeFlag         = 0
    timingInfoPresentFlag      = 1
    hrdParamsPresentFlag       = 1
    numUnitsInTicks            = 1000

    #### IH264ENC_Status->stereoInfoParams

    stereoInfoPreset       = 0
    topFieldIsLeftViewFlag = 0
    viewSelfContainedFlag  = 0

    #### IH264ENC_Status->framePackingSEIParams

    framePackingPreset = 0
    framePackingType   = 0
    frame0PositionX    = 0
    frame0PositionY    = 0
    frame1PositionX    = 0
    frame1PositionY    = 0
    reservedByte       = 0

    #### IH264ENC_Status->svcCodingParams

    svcExtensionFlag    = 0
    dependencyID        = 0
    qualityID           = 0
    enhancementProfileID= 0
    layerIndex          = 0
    refLayerDQId        = 0

    Regards,

    Jemish

  • Jemish,

    Try modifying these below parameters to achieve the intended behaviour,

    rateControlParamPreset = 0 1

    timingInfoPresentFlag = 1  0

    hrdParamsPresentFlag = 1  0


    Thanks & Regards,

    Santosh

  • Hi Santosh,

    We tried to run test with the changes you mentioned but still we are not getting expected result.  Means still we are getting I/IDR frame while changing bit rate. To get clear idea I have attached encoded file below you can play it in Elecard and you can verify at you side.

    Regards,

    Jemish

    0724.sample.zip

  • Jemish, 

    Could you please share the status structure (encoder status) used in the above experiment?

    Steps :

    1. Start the encoder.
    2. Get the status of encoder just before changing the bitrate. i.e., control call with XDM_GETSTATUS command
    3. Change the bit rate ie., control call with XDM_SETPARAMS command with new bitrate
    4. Again collect the encoder status now ie.,control call with XDM_GETSTATUS command
    5. Compare the encoder status collected in step #2 and #4
    And I had suggested to modify encoder parameters in my last reply, please modify those parameters in static and dynamic parameters both.
    Thanks.

  • Hi Santosh,

    I tried with the changes you mentioned above in both static and dynamic parameters. But after that the behavior was strange. Initially video start with very bad quality after that it reach to the set bitrate value and after that there was no bitrate change. And below is the list of all the parameters as per your suggestion.

     ################ Value of all the parameters before changing bitrate #######################
    #### videnc2Status Param

    extendedError          = 0
    encodingPreset         = 3
    data                   = 0
    accessMask             = 0
    rateControlPreset      = 5
    maxInterFrameInterval  = 1
    inputChromaFormat      = 9
    inputContentType       = 0
    operatingMode          = 1
    profile                = 100
    level                  = 42
    inputDataMode          = 3
    outputDataMode         = 3
    numInputDataUnits      = 1
    numOutputDataUnits      = 1
    configurationID        = 1271
    minNumInBufs           = 2
    minNumOutBufs          = 1
    minInBufSize[0]        = 1280
    minOutBufSize[0]       = 1382400
    inBufMemoryType[0]     = 1
    outBufMemoryType[0]    = 0
    minNumBufSets          = 1
    metadataType[0]        = -1
    metadataType[1]        = -1
    metadataType[2]        = -1
    size                      = 236
    inputHeight               = 720
    inputWidth                = 1280
    refFrameRate              = 60000
    targetFrameRate           = 50000
    targetBitRate             = 20000000
    intraFrameInterval        = 8001
    generateHeader            = 0
    captureWidth              = 1280
    forceFrame                = -1
    interFrameInterval = 8001
    mvAccuracy                = 2
    sampleAspectRatioHeight   = 1
    sampleAspectRatioWidth    = 1
    ignoreOutbufSizeFlag      = 0
    lateAcquireArg            = 0

    #### IH264ENC_Status Param

    interlaceCodingType     = 3
    bottomFieldIntra        = 0
    gopStructure            = 0
    entropyCodingMode       = 1
    transformBlockSize      = 1
    log2MaxFNumMinus4       = 12
    picOrderCountType       = 0
    enableWatermark         = 0
    IDRFrameInterval        = 0
    maxIntraFrameInterval   = 65535
    debugTraceLevel         = 0
    lastNFramesToLog        = 0
    enableAnalyticinfo      = 0
    enableGMVSei            = 0
    constraintSetFlags      = 0
    enableRCDO              = 0
    enableLongTermRefFrame  = 0
    LTRPPeriod              = 0
    searchCenter            = 0
    enableStaticMBCount     = 0
    numTemporalLayer        = 1
    referencePicMarking     = 0
    extMemoryDebugTraceSize = 36
    enableROI               = 0

    #### IH264ENC_Status->rateControlParams Param

    rateControlParamsPreset      = 1
    scalingMatrixPreset          = 0
    rcAlgo                       = 0
    qpI                          = 20
    qpMaxI                       = 51
    qpMinI                       = 0
    qpP                          = 20
    qpMaxP                       = 51
    qpMinP                       = 0
    qpOffsetB                    = 4
    qpMaxB                       = 51
    qpMinB                       = 0
    allowFrameSkip               = 1
    removeExpensiveCoeff         = 0
    chromaQPIndexOffset          = 0
    IPQualityFactor              = 0
    initialBufferLevel           = 0
    HRDBufferSize                = 40000000
    minPicSizeRatioI             = 0
    maxPicSizeRatioI             = 0
    minPicSizeRatioP             = 0
    maxPicSizeRatioP             = 0
    minPicSizeRatioB             = 0
    maxPicSizeRatioB             = 0
    enablePRC                    = 0
    enablePartialFrameSkip       = 0
    discardSavedBits             = 0
    reserved                     = 0
    VBRDuration                  = 0
    VBRsensitivity               = 0
    skipDistributionWindowLength = 0
    numSkipInDistributionWindow  = 0
    enableHRDComplianceMode      = 0
    frameSkipThMulQ5             = 0
    vbvUseLevelThQ5              = 0

    #### IH264ENC_Status->interCodingParams Param

    interCodingPreset  = 0
    searchRangeHorP    = 144
    searchRangeVerP    = 32
    searchRangeHorB    = 144
    searchRangeVerB    = 16
    interCodingBias    = 1
    skipMVCodingBias   = 1
    minBlockSizeP      = 0
    minBlockSizeB      = 0
    meAlgoMode         = 0

    #### IH264ENC_Status->intraCodingParams Param

    intraCodingPreset          = 0
    lumaIntra4x4Enable         = 0
    lumaIntra8x8Enable         = 255
    lumaIntra16x16Enable       = 15
    chromaIntra8x8Enable       = 15
    chromaComponentEnable      = 1
    intraRefreshMethod         = 0
    intraRefreshRate           = 0
    gdrOverlapRowsBtwFrames    = 0
    constrainedIntraPredEnable = 0
    intraCodingBias            = 0

    #### IH264ENC_Status->nalUnitControlParams

    naluControlPreset              = 0
    naluPresentMaskStartOfSequence = 416
    naluPresentMaskIDRPicture      = 416
    naluPresentMaskIntraPicture    = 2
    naluPresentMaskNonIntraPicture = 2
    naluPresentMaskEndOfSequence   = 3072

    #### IH264ENC_Status->sliceCodingParams

    sliceCodingPreset = 0
    sliceMode         = 0
    sliceUnitSize     = 0
    streamFormat      = 0

    #### IH264ENC_Status->loopfilterPreset

    loopfilterPreset      = 0
    loopfilterDisableIDC  = 0
    filterOffsetA         = 0
    filterOffsetB         = 0

    #### IH264ENC_Status->fmoCodingParams

    fmoCodingPreset               =0
    numSliceGroups                =1
    sliceGroupMapType             =4
    sliceGroupChangeDirectionFlag =0
    sliceGroupChangeRate          =0
    sliceGroupChangeCycle         =0
    sliceGroupParams[0]           =0
    sliceGroupParams[1]           =0

    #### IH264ENC_Status->vuiCodingParams

    vuiCodingPreset            = 1
    aspectRatioInfoPresentFlag = 0
    aspectRatioIdc             = 0
    videoSignalTypePresentFlag = 0
    videoFormat                = 2
    videoFullRangeFlag         = 0
    timingInfoPresentFlag      = 0
    hrdParamsPresentFlag       = 0
    numUnitsInTicks            = 1000

    #### IH264ENC_Status->stereoInfoParams

    stereoInfoPreset       = 0
    topFieldIsLeftViewFlag = 0
    viewSelfContainedFlag  = 0

    #### IH264ENC_Status->framePackingSEIParams

    framePackingPreset = 0
    framePackingType   = 0
    frame0PositionX    = 0
    frame0PositionY    = 0
    frame1PositionX    = 0
    frame1PositionY    = 0
    reservedByte       = 0

    #### IH264ENC_Status->svcCodingParams

    svcExtensionFlag    = 0
    dependencyID        = 0
    qualityID           = 0
    enhancementProfileID= 0
    layerIndex          = 0
    refLayerDQId        = 0

    Set encoder bit-rate to 200 kbps
     ################ Value of all the parameters after changing bitrate #######################
    #### videnc2Status Param

    extendedError          = 0
    encodingPreset         = 3
    data                   = 0
    accessMask             = 0
    rateControlPreset      = 5
    maxInterFrameInterval  = 1
    inputChromaFormat      = 9
    inputContentType       = 0
    operatingMode          = 1
    profile                = 100
    level                  = 42
    inputDataMode          = 3
    outputDataMode         = 3
    numInputDataUnits      = 1
    numOutputDataUnits      = 1
    configurationID        = 1271
    minNumInBufs           = 2
    minNumOutBufs          = 1
    minInBufSize[0]        = 1280
    minOutBufSize[0]       = 1382400
    inBufMemoryType[0]     = 1
    outBufMemoryType[0]    = 0
    minNumBufSets          = 1
    metadataType[0]        = -1
    metadataType[1]        = -1
    metadataType[2]        = -1
    size                      = 236
    inputHeight               = 720
    inputWidth                = 1280
    refFrameRate              = 60000
    targetFrameRate           = 50000
    targetBitRate             = 200000
    intraFrameInterval        = 8001
    generateHeader            = 0
    captureWidth              = 1280
    forceFrame                = -1
    interFrameInterval = 8001
    mvAccuracy                = 2
    sampleAspectRatioHeight   = 1
    sampleAspectRatioWidth    = 1
    ignoreOutbufSizeFlag      = 0
    lateAcquireArg            = 0
    #### IH264ENC_Status Param

    interlaceCodingType     = 3
    bottomFieldIntra        = 0
    gopStructure            = 0
    entropyCodingMode       = 1
    transformBlockSize      = 1
    log2MaxFNumMinus4       = 12
    picOrderCountType       = 0
    enableWatermark         = 0
    IDRFrameInterval        = 0
    maxIntraFrameInterval   = 65535
    debugTraceLevel         = 0
    lastNFramesToLog        = 0
    enableAnalyticinfo      = 0
    enableGMVSei            = 0
    constraintSetFlags      = 0
    enableRCDO              = 0
    enableLongTermRefFrame  = 0
    LTRPPeriod              = 0
    searchCenter            = 0
    enableStaticMBCount     = 0
    numTemporalLayer        = 1
    referencePicMarking     = 0
    extMemoryDebugTraceSize = 36
    enableROI               = 0

    #### IH264ENC_Status->rateControlParams Param

    rateControlParamsPreset      = 1
    scalingMatrixPreset          = 0
    rcAlgo                       = 0
    qpI                          = 20
    qpMaxI                       = 51
    qpMinI                       = 0
    qpP                          = 20
    qpMaxP                       = 51
    qpMinP                       = 0
    qpOffsetB                    = 4
    qpMaxB                       = 51
    qpMinB                       = 0
    allowFrameSkip               = 1
    removeExpensiveCoeff         = 0
    chromaQPIndexOffset          = 0
    IPQualityFactor              = 0
    initialBufferLevel           = 0
    HRDBufferSize                = 40000000
    minPicSizeRatioI             = 0
    maxPicSizeRatioI             = 0
    minPicSizeRatioP             = 0
    maxPicSizeRatioP             = 0
    minPicSizeRatioB             = 0
    maxPicSizeRatioB             = 0
    enablePRC                    = 0
    enablePartialFrameSkip       = 0
    discardSavedBits             = 0
    reserved                     = 0
    VBRDuration                  = 0
    VBRsensitivity               = 0
    skipDistributionWindowLength = 0
    numSkipInDistributionWindow  = 0
    enableHRDComplianceMode      = 0
    frameSkipThMulQ5             = 0
    vbvUseLevelThQ5              = 0

    #### IH264ENC_Status->interCodingParams Param

    interCodingPreset  = 0
    searchRangeHorP    = 144
    searchRangeVerP    = 32
    searchRangeHorB    = 144
    searchRangeVerB    = 16
    interCodingBias    = 1
    skipMVCodingBias   = 1
    minBlockSizeP      = 0
    minBlockSizeB      = 0
    meAlgoMode         = 0

    #### IH264ENC_Status->intraCodingParams Param

    intraCodingPreset          = 0
    lumaIntra4x4Enable         = 0
    lumaIntra8x8Enable         = 255
    lumaIntra16x16Enable       = 15
    chromaIntra8x8Enable       = 15
    chromaComponentEnable      = 1
    intraRefreshMethod         = 0
    intraRefreshRate           = 0
    gdrOverlapRowsBtwFrames    = 0
    constrainedIntraPredEnable = 0
    intraCodingBias            = 0

    #### IH264ENC_Status->nalUnitControlParams

    naluControlPreset              = 0
    naluPresentMaskStartOfSequence = 416
    naluPresentMaskIDRPicture      = 416
    naluPresentMaskIntraPicture    = 2
    naluPresentMaskNonIntraPicture = 2
    naluPresentMaskEndOfSequence   = 3072

    #### IH264ENC_Status->sliceCodingParams

    sliceCodingPreset = 0
    sliceMode         = 0
    sliceUnitSize     = 0
    streamFormat      = 0

    #### IH264ENC_Status->loopfilterPreset

    loopfilterPreset      = 0
    loopfilterDisableIDC  = 0
    filterOffsetA         = 0
    filterOffsetB         = 0

    #### IH264ENC_Status->fmoCodingParams

    fmoCodingPreset               =0
    numSliceGroups                =1
    sliceGroupMapType             =4
    sliceGroupChangeDirectionFlag =0
    sliceGroupChangeRate          =0
    sliceGroupChangeCycle         =0
    sliceGroupParams[0]           =0
    sliceGroupParams[1]           =0

    #### IH264ENC_Status->vuiCodingParams

    vuiCodingPreset            = 1
    aspectRatioInfoPresentFlag = 0
    aspectRatioIdc             = 0
    videoSignalTypePresentFlag = 0
    videoFormat                = 2
    videoFullRangeFlag         = 0
    timingInfoPresentFlag      = 0
    hrdParamsPresentFlag       = 0
    numUnitsInTicks            = 1000

    #### IH264ENC_Status->stereoInfoParams

    stereoInfoPreset       = 0
    topFieldIsLeftViewFlag = 0
    viewSelfContainedFlag  = 0

    #### IH264ENC_Status->framePackingSEIParams

    framePackingPreset = 0
    framePackingType   = 0
    frame0PositionX    = 0
    frame0PositionY    = 0
    frame1PositionX    = 0
    frame1PositionY    = 0
    reservedByte       = 0

    #### IH264ENC_Status->svcCodingParams

    svcExtensionFlag    = 0
    dependencyID        = 0
    qualityID           = 0
    enhancementProfileID= 0
    layerIndex          = 0
    refLayerDQId        = 0

    At this stage I would like to ask you are you sure that if we change bitrate and we don't get I-frame. Because according to me we must get I-frame with information of new bitrate. Let's take a use case if I am transmitting encoded video and receiver is decoding and displaying video. Now if I change bitrate dynamically here.  How receiver is going to know at which bitrate it has to render video? Without refreshing new information (I/IDR ).

    I asking  above question just to clear my understanding.

    Regards,

    Jemish

  • Jemish,

    Dynamic change of bit rate may/mayn't insert IDR frames. If hrdParamsPresentFlag is 0 then Encoder just raises the bitrate without coding the HRD parameters in bit stream. (Like Just assume a scenario where a plane video is encoded and suddenly a complex scene is fed to encoder and bit rate is shoot up) . This scenario is okay as far as standard H264 is concerned.

    Below are experiment details & parameters used at our end. (please apologize that, somehow my system is not allowing me to attach any files, so all the information is shared in plane/descriptive format here)

    • Encoder static parameters

    params = {...}
    videnc2Params = {...}
    size = 316
    encodingPreset = 3
    rateControlPreset = 5
    maxHeight = 1080
    maxWidth = 1920
    dataEndianness = 1
    maxInterFrameInterval = 1
    maxBitRate = -1
    minBitRate = 0
    inputChromaFormat = 9
    inputContentType = 0
    operatingMode = 1
    profile = 100
    level = 40
    inputDataMode = 3
    outputDataMode = 3
    numInputDataUnits = 1
    numOutputDataUnits = 1
    metadataType = 0x5B03D45C
    [0] = -1
    [1] = -1
    [2] = -1
    rateControlParams = {...}
    rateControlParamsPreset = 1
    scalingMatrixPreset = 1
    rcAlgo = 0
    qpI = -1
    qpMaxI = 36
    qpMinI = 10
    qpP = -1
    qpMaxP = 44
    qpMinP = 10
    qpOffsetB = 4
    qpMaxB = 44
    qpMinB = 10
    allowFrameSkip = 1
    removeExpensiveCoeff = 0
    chromaQPIndexOffset = 0
    IPQualityFactor = 0
    initialBufferLevel = 200000
    HRDBufferSize = 200000
    minPicSizeRatioI = 0
    maxPicSizeRatioI = 0
    minPicSizeRatioP = 0
    maxPicSizeRatioP = 0
    minPicSizeRatioB = 0
    maxPicSizeRatioB = 0
    enablePRC = 1
    enablePartialFrameSkip = 0
    discardSavedBits = 0
    reserved = 0
    VBRDuration = 8
    VBRsensitivity = 0
    skipDistributionWindowLength = 0
    numSkipInDistributionWindow = 0
    enableHRDComplianceMode = 1
    frameSkipThMulQ5 = 0
    vbvUseLevelThQ5 = 0
    reservedRC = 0x5B03D4A4
    [0] = 0
    [1] = 0
    [2] = 0
    interCodingParams = {...}
    interCodingPreset = 0
    searchRangeHorP = 144
    searchRangeVerP = 32
    searchRangeHorB = 144
    searchRangeVerB = 16
    interCodingBias = 1
    skipMVCodingBias = 1
    minBlockSizeP = 0
    minBlockSizeB = 0
    meAlgoMode = 0
    intraCodingParams = {...}
    intraCodingPreset = 0
    lumaIntra4x4Enable = 0
    lumaIntra8x8Enable = 255
    lumaIntra16x16Enable = 15
    chromaIntra8x8Enable = 15
    chromaComponentEnable = 1
    intraRefreshMethod = 0
    intraRefreshRate = 0
    gdrOverlapRowsBtwFrames = 0
    constrainedIntraPredEnable = 0
    intraCodingBias = 0
    nalUnitControlParams = {...}
    naluControlPreset = 0
    naluPresentMaskStartOfSequence = 416
    naluPresentMaskIDRPicture = 416
    naluPresentMaskIntraPicture = 2
    naluPresentMaskNonIntraPicture = 2
    naluPresentMaskEndOfSequence = 3072
    sliceCodingParams = {...}
    sliceCodingPreset = 0
    sliceMode = 0
    sliceUnitSize = 0
    sliceStartOffset = 0x5B03D4E8
    [0] = 0
    [1] = 0
    [2] = 0
    streamFormat = 0
    loopFilterParams = {...}
    loopfilterPreset = 0
    loopfilterDisableIDC = 0
    filterOffsetA = 0
    filterOffsetB = 0
    fmoCodingParams = {...}
    fmoCodingPreset = 0
    numSliceGroups = 1
    sliceGroupMapType = 4
    sliceGroupChangeDirectionFlag = 0
    sliceGroupChangeRate = 0
    sliceGroupChangeCycle = 0
    sliceGroupParams = 0x5B03D4F8
    [0] = 0
    [1] = 0
    vuiCodingParams = {...}
    vuiCodingPreset = 1
    aspectRatioInfoPresentFlag = 1
    aspectRatioIdc = 1
    videoSignalTypePresentFlag = 0
    videoFormat = 2
    videoFullRangeFlag = 0
    timingInfoPresentFlag = 0
    hrdParamsPresentFlag = 0
    numUnitsInTicks = 1000
    stereoInfoParams = {...}
    stereoInfoPreset = 0
    topFieldIsLeftViewFlag = 0
    viewSelfContainedFlag = 0
    framePackingSEIParams = {...}
    framePackingPreset = 0
    framePackingType = 0
    frame0PositionX = 0
    frame0PositionY = 0
    frame1PositionX = 0
    frame1PositionY = 0
    reservedByte = 0
    svcCodingParams = {...}
    svcExtensionFlag = 0
    dependencyID = 0
    qualityID = 0
    enhancementProfileID = 0
    layerIndex = 0
    refLayerDQId = 0
    interlaceCodingType = 3
    bottomFieldIntra = 0
    gopStructure = 1
    entropyCodingMode = 1
    transformBlockSize = 2
    log2MaxFNumMinus4 = 8
    picOrderCountType = 0
    enableWatermark = 0
    IDRFrameInterval = 0
    pConstantMemory = 0
    maxIntraFrameInterval = 30
    debugTraceLevel = 1
    lastNFramesToLog = 0
    enableAnalyticinfo = 0
    enableGMVSei = 1
    constraintSetFlags = 0
    enableRCDO = 0
    enableLongTermRefFrame = 0
    LTRPPeriod = -1
    numTemporalLayer = 1
    referencePicMarking = 1
    reservedParams = 0x5B03D544
    [0] = 0
    [1] = 31
    [2] = 0

    • Encoder Dynamic parameters

    dynamicParams = {...}
    videnc2DynamicParams = {...}
    size = 240
    inputHeight = 720
    inputWidth = 1280
    refFrameRate = 30000
    targetFrameRate = 30000
    targetBitRate = 2000000
    intraFrameInterval = 30
    generateHeader = 0
    captureWidth = 1280
    forceFrame = -1
    interFrameInterval = 1
    mvAccuracy = 2
    sampleAspectRatioHeight = 1
    sampleAspectRatioWidth = 1
    ignoreOutbufSizeFlag = 1
    putDataFxn = -1612838911
    putDataHandle = 0
    getDataFxn = -1612834963
    getDataHandle = -1613022428
    getBufferFxn = -1612840843
    getBufferHandle = 0
    lateAcquireArg = 256
    rateControlParams = {...}
    rateControlParamsPreset = 1
    scalingMatrixPreset = 1
    rcAlgo = 0
    qpI = -1
    qpMaxI = 36
    qpMinI = 10
    qpP = -1
    qpMaxP = 44
    qpMinP = 10
    qpOffsetB = 4
    qpMaxB = 44
    qpMinB = 10
    allowFrameSkip = 1
    removeExpensiveCoeff = 0
    chromaQPIndexOffset = 0
    IPQualityFactor = 0
    initialBufferLevel = 200000
    HRDBufferSize = 200000
    minPicSizeRatioI = 0
    maxPicSizeRatioI = 0
    minPicSizeRatioP = 0
    maxPicSizeRatioP = 0
    minPicSizeRatioB = 0
    maxPicSizeRatioB = 0
    enablePRC = 1
    enablePartialFrameSkip = 0
    discardSavedBits = 0
    reserved = 0
    VBRDuration = 8
    VBRsensitivity = 0
    skipDistributionWindowLength = 0
    numSkipInDistributionWindow = 0
    enableHRDComplianceMode = 1
    frameSkipThMulQ5 = 0
    vbvUseLevelThQ5 = 0
    reservedRC = 0x5B03D5E4
    interCodingParams = {...}
    interCodingPreset = 0
    searchRangeHorP = 144
    searchRangeVerP = 32
    searchRangeHorB = 144
    searchRangeVerB = 16
    interCodingBias = 1
    skipMVCodingBias = 1
    minBlockSizeP = 0
    minBlockSizeB = 0
    meAlgoMode = 0
    intraCodingParams = {...}
    intraCodingPreset = 0
    lumaIntra4x4Enable = 0
    lumaIntra8x8Enable = 255
    lumaIntra16x16Enable = 15
    chromaIntra8x8Enable = 15
    chromaComponentEnable = 1
    intraRefreshMethod = 0
    intraRefreshRate = 0
    gdrOverlapRowsBtwFrames = 0
    constrainedIntraPredEnable = 0
    intraCodingBias = 0
    sliceCodingParams = {...}
    sliceCodingPreset = 0
    sliceMode = 0
    sliceUnitSize = 0
    sliceStartOffset = 0x5B03D61C
    [0] = 0
    [1] = 0
    [2] = 0
    streamFormat = 0
    sliceGroupChangeCycle = 0
    searchCenter = {...}
    x = 32767
    y = 0
    enableStaticMBCount = 0
    enableROI = 0
    reservedDynParams = 0x5B03D634
    [0] = 1668246594
    [1] = 2053722987
    [2] = 1023430757

    • Encoder Console output

    #0 : IVIDEO_IDR_FRAME : Bits : 208848
    #1 : IVIDEO_P_FRAME : Bits : 57672
    #2 : IVIDEO_P_FRAME : Bits : 35760
    #3 : IVIDEO_P_FRAME : Bits : 38152
    #4 : IVIDEO_P_FRAME : Bits : 48776

    Requested dynamic parameter change at Frame #5
    Request Dynamic parameter change sucessful ....
    #5 : IVIDEO_P_FRAME : Bits : 83200
    #6 : IVIDEO_P_FRAME : Bits : 104680
    #7 : IVIDEO_P_FRAME : Bits : 127688
    #8 : IVIDEO_P_FRAME : Bits : 125520
    #9 : IVIDEO_P_FRAME : Bits : 82640

    Requested dynamic parameter change at Frame #10
    Request Dynamic parameter change sucessful ....
    #10 : IVIDEO_P_FRAME : Bits : 158416
    #11 : IVIDEO_P_FRAME : Bits : 142232
    #12 : IVIDEO_P_FRAME : Bits : 154488
    #13 : IVIDEO_P_FRAME : Bits : 132928
    #14 : IVIDEO_P_FRAME : Bits : 151144

    Requested dynamic parameter change at Frame #15
    Request Dynamic parameter change sucessful ....
    #15 : IVIDEO_P_FRAME : Bits : 214504
    #16 : IVIDEO_P_FRAME : Bits : 67128
    #17 : IVIDEO_P_FRAME : Bits : 133688
    #18 : IVIDEO_P_FRAME : Bits : 161112
    #19 : IVIDEO_P_FRAME : Bits : 159480

    Requested dynamic parameter change at Frame #20
    Request Dynamic parameter change sucessful ....
    #20 : IVIDEO_P_FRAME : Bits : 147920
    #21 : IVIDEO_P_FRAME : Bits : 167496
    #22 : IVIDEO_P_FRAME : Bits : 125552
    #23 : IVIDEO_P_FRAME : Bits : 191520

    • Encoder status before bit rate change

    [0] = {...}
    videnc2Status = {...}
    size = 828
    extendedError = 0
    data = {...}
    encodingPreset = 3
    rateControlPreset = 5
    maxInterFrameInterval = 1
    inputChromaFormat = 9
    inputContentType = 0
    operatingMode = 1
    profile = 100
    level = 40
    inputDataMode = 3
    outputDataMode = 3
    numInputDataUnits = 1
    numOutputDataUnits = 1
    configurationID = 1271
    bufInfo = {...}
    metadataType = 0x9FD948E8
    encDynamicParams = {...}
    size = 240
    inputHeight = 720
    inputWidth = 1280
    refFrameRate = 30000
    targetFrameRate = 30000
    targetBitRate = 2000000
    intraFrameInterval = 30
    generateHeader = 0
    captureWidth = 1280
    forceFrame = -1
    interFrameInterval = 1
    mvAccuracy = 2
    sampleAspectRatioHeight = 1
    sampleAspectRatioWidth = 1
    ignoreOutbufSizeFlag = 1
    putDataFxn = -1612837703
    putDataHandle = 0
    getDataFxn = -1612833755
    getDataHandle = -1613022428
    getBufferFxn = -1612839635
    getBufferHandle = 0
    lateAcquireArg = 256
    rateControlParams = {...}
    rateControlParamsPreset = 1
    scalingMatrixPreset = 1
    rcAlgo = 0
    qpI = -1
    qpMaxI = 36
    qpMinI = 10
    qpP = -1
    qpMaxP = 44
    qpMinP = 10
    qpOffsetB = 4
    qpMaxB = 44
    qpMinB = 10
    allowFrameSkip = 1
    removeExpensiveCoeff = 0
    chromaQPIndexOffset = 0
    IPQualityFactor = 0
    initialBufferLevel = 200000
    HRDBufferSize = 200000
    minPicSizeRatioI = 0
    maxPicSizeRatioI = 0
    minPicSizeRatioP = 0
    maxPicSizeRatioP = 0
    minPicSizeRatioB = 0
    maxPicSizeRatioB = 0
    enablePRC = 1
    enablePartialFrameSkip = 0
    discardSavedBits = 0
    reserved = 0
    VBRDuration = 8
    VBRsensitivity = 0
    skipDistributionWindowLength = 0
    numSkipInDistributionWindow = 0
    enableHRDComplianceMode = 1
    frameSkipThMulQ5 = 0
    vbvUseLevelThQ5 = 0
    reservedRC = 0x9FD94988
    interCodingParams = {...}
    interCodingPreset = 0
    searchRangeHorP = 144
    searchRangeVerP = 32
    searchRangeHorB = 144
    searchRangeVerB = 16
    interCodingBias = 1
    skipMVCodingBias = 1
    minBlockSizeP = 0
    minBlockSizeB = 0
    meAlgoMode = 0
    intraCodingParams = {...}
    intraCodingPreset = 0
    lumaIntra4x4Enable = 0
    lumaIntra8x8Enable = 255
    lumaIntra16x16Enable = 15
    chromaIntra8x8Enable = 15
    chromaComponentEnable = 1
    intraRefreshMethod = 0
    intraRefreshRate = 0
    gdrOverlapRowsBtwFrames = 0
    constrainedIntraPredEnable = 0
    intraCodingBias = 0
    nalUnitControlParams = {...}
    naluControlPreset = 0
    naluPresentMaskStartOfSequence = 416
    naluPresentMaskIDRPicture = 416
    naluPresentMaskIntraPicture = 2
    naluPresentMaskNonIntraPicture = 2
    naluPresentMaskEndOfSequence = 3072
    sliceCodingParams = {...}
    sliceCodingPreset = 0
    sliceMode = 0
    sliceUnitSize = 0
    sliceStartOffset = 0x9FD949CC
    [0] = 0
    [1] = 0
    [2] = 0
    streamFormat = 0
    loopFilterParams = {...}
    loopfilterPreset = 0
    loopfilterDisableIDC = 0
    filterOffsetA = 0
    filterOffsetB = 0
    fmoCodingParams = {...}
    fmoCodingPreset = 0
    numSliceGroups = 1
    sliceGroupMapType = 4
    sliceGroupChangeDirectionFlag = 0
    sliceGroupChangeRate = 0
    sliceGroupChangeCycle = 0
    sliceGroupParams = 0x9FD949DC
    [0] = 0
    [1] = 0
    vuiCodingParams = {...}
    vuiCodingPreset = 1
    aspectRatioInfoPresentFlag = 1
    aspectRatioIdc = 1
    videoSignalTypePresentFlag = 0
    videoFormat = 2
    videoFullRangeFlag = 0
    timingInfoPresentFlag = 0
    hrdParamsPresentFlag = 0
    numUnitsInTicks = 1000
    stereoInfoParams = {...}
    stereoInfoPreset = 0
    topFieldIsLeftViewFlag = 0
    viewSelfContainedFlag = 0
    framePackingSEIParams = {...}
    framePackingPreset = 0
    framePackingType = 0
    frame0PositionX = 0
    frame0PositionY = 0
    frame1PositionX = 0
    frame1PositionY = 0
    reservedByte = 0
    svcCodingParams = {...}
    svcExtensionFlag = 0
    dependencyID = 0
    qualityID = 0
    enhancementProfileID = 0
    layerIndex = 0
    refLayerDQId = -68
    interlaceCodingType = 3
    bottomFieldIntra = 0
    gopStructure = 1
    entropyCodingMode = 1
    transformBlockSize = 2
    log2MaxFNumMinus4 = 8
    picOrderCountType = 0
    enableWatermark = 0
    IDRFrameInterval = 0
    maxIntraFrameInterval = 30
    debugTraceLevel = 1
    lastNFramesToLog = 0
    enableAnalyticinfo = 0
    enableGMVSei = 1
    constraintSetFlags = 0
    enableRCDO = 0
    enableLongTermRefFrame = 0
    LTRPPeriod = -1
    searchCenter = {...}
    x = 32767
    y = 0
    enableStaticMBCount = 0
    extMemoryDebugTraceAddr = -1736602816
    numTemporalLayer = 1
    referencePicMarking = 1
    extMemoryDebugTraceSize = 1344
    enableROI = 0
    extErrorCode = 0x9FD94A3C

    • Encoder status after enhancing the bit rate (up by 1MB)

    [0] = {...}
    videnc2Status = {...}
    size = 828
    extendedError = 0
    data = {...}
    encodingPreset = 3
    rateControlPreset = 5
    maxInterFrameInterval = 1
    inputChromaFormat = 9
    inputContentType = 0
    operatingMode = 1
    profile = 100
    level = 40
    inputDataMode = 3
    outputDataMode = 3
    numInputDataUnits = 1
    numOutputDataUnits = 1
    configurationID = 1271
    bufInfo = {...}
    metadataType = 0x9FD948E8
    encDynamicParams = {...}
    size = 240
    inputHeight = 720
    inputWidth = 1280
    refFrameRate = 30000
    targetFrameRate = 30000
    targetBitRate = 3000000
    intraFrameInterval = 30
    generateHeader = 0
    captureWidth = 1280
    forceFrame = -1
    interFrameInterval = 1
    mvAccuracy = 2
    sampleAspectRatioHeight = 1
    sampleAspectRatioWidth = 1
    ignoreOutbufSizeFlag = 1
    putDataFxn = -1612837703
    putDataHandle = 0
    getDataFxn = -1612833755
    getDataHandle = -1613022428
    getBufferFxn = -1612839635
    getBufferHandle = 0
    lateAcquireArg = 256
    rateControlParams = {...}
    rateControlParamsPreset = 1
    scalingMatrixPreset = 1
    rcAlgo = 0
    qpI = -1
    qpMaxI = 36
    qpMinI = 10
    qpP = -1
    qpMaxP = 44
    qpMinP = 10
    qpOffsetB = 4
    qpMaxB = 44
    qpMinB = 10
    allowFrameSkip = 1
    removeExpensiveCoeff = 0
    chromaQPIndexOffset = 0
    IPQualityFactor = 0
    initialBufferLevel = 200000
    HRDBufferSize = 200000
    minPicSizeRatioI = 0
    maxPicSizeRatioI = 0
    minPicSizeRatioP = 0
    maxPicSizeRatioP = 0
    minPicSizeRatioB = 0
    maxPicSizeRatioB = 0
    enablePRC = 1
    enablePartialFrameSkip = 0
    discardSavedBits = 0
    reserved = 0
    VBRDuration = 8
    VBRsensitivity = 0
    skipDistributionWindowLength = 0
    numSkipInDistributionWindow = 0
    enableHRDComplianceMode = 1
    frameSkipThMulQ5 = 0
    vbvUseLevelThQ5 = 0
    reservedRC = 0x9FD94988
    [0] = 0
    [1] = 0
    [2] = 0
    interCodingParams = {...}
    interCodingPreset = 0
    searchRangeHorP = 144
    searchRangeVerP = 32
    searchRangeHorB = 144
    searchRangeVerB = 16
    interCodingBias = 1
    skipMVCodingBias = 1
    minBlockSizeP = 0
    minBlockSizeB = 0
    meAlgoMode = 0
    intraCodingParams = {...}
    intraCodingPreset = 0
    lumaIntra4x4Enable = 0
    lumaIntra8x8Enable = 255
    lumaIntra16x16Enable = 15
    chromaIntra8x8Enable = 15
    chromaComponentEnable = 1
    intraRefreshMethod = 0
    intraRefreshRate = 0
    gdrOverlapRowsBtwFrames = 0
    constrainedIntraPredEnable = 0
    intraCodingBias = 0
    nalUnitControlParams = {...}
    naluControlPreset = 0
    naluPresentMaskStartOfSequence = 416
    naluPresentMaskIDRPicture = 416
    naluPresentMaskIntraPicture = 2
    naluPresentMaskNonIntraPicture = 2
    naluPresentMaskEndOfSequence = 3072
    sliceCodingParams = {...}
    sliceCodingPreset = 0
    sliceMode = 0
    sliceUnitSize = 0
    sliceStartOffset = 0x9FD949CC
    [0] = 0
    [1] = 0
    [2] = 0
    streamFormat = 0
    loopFilterParams = {...}
    loopfilterPreset = 0
    loopfilterDisableIDC = 0
    filterOffsetA = 0
    filterOffsetB = 0
    fmoCodingParams = {...}
    fmoCodingPreset = 0
    numSliceGroups = 1
    sliceGroupMapType = 4
    sliceGroupChangeDirectionFlag = 0
    sliceGroupChangeRate = 0
    sliceGroupChangeCycle = 0
    sliceGroupParams = 0x9FD949DC
    [0] = 0
    [1] = 0
    vuiCodingParams = {...}
    vuiCodingPreset = 1
    aspectRatioInfoPresentFlag = 1
    aspectRatioIdc = 1
    videoSignalTypePresentFlag = 0
    videoFormat = 2
    videoFullRangeFlag = 0
    timingInfoPresentFlag = 0
    hrdParamsPresentFlag = 0
    numUnitsInTicks = 1000
    stereoInfoParams = {...}
    stereoInfoPreset = 0
    topFieldIsLeftViewFlag = 0
    viewSelfContainedFlag = 0
    framePackingSEIParams = {...}
    framePackingPreset = 0
    framePackingType = 0
    frame0PositionX = 0
    frame0PositionY = 0
    frame1PositionX = 0
    frame1PositionY = 0
    reservedByte = 0
    svcCodingParams = {...}
    svcExtensionFlag = 0
    dependencyID = 0
    qualityID = 0
    enhancementProfileID = 0
    layerIndex = 0
    refLayerDQId = -68
    interlaceCodingType = 3
    bottomFieldIntra = 0
    gopStructure = 1
    entropyCodingMode = 1
    transformBlockSize = 2
    log2MaxFNumMinus4 = 8
    picOrderCountType = 0
    enableWatermark = 0
    IDRFrameInterval = 0
    maxIntraFrameInterval = 30
    debugTraceLevel = 1
    lastNFramesToLog = 0
    enableAnalyticinfo = 0
    enableGMVSei = 1
    constraintSetFlags = 0
    enableRCDO = 0
    enableLongTermRefFrame = 0
    LTRPPeriod = -1
    searchCenter = {...}
    x = 32767
    y = 0
    enableStaticMBCount = 0
    extMemoryDebugTraceAddr = -1736602816
    numTemporalLayer = 1
    referencePicMarking = 1
    extMemoryDebugTraceSize = 1344
    enableROI = 0

    Let me know if you need any more help.

    Thanks,

    Santosh

  • Hi Santosh,

    I just want to know that how you are verifying successfully bit-rate change. Because we are using "Elecard StreamEye" and it  clear shows bit-rate level (High Level for higher bit-rate 20Mbps , Low level for lower bit-rate 200Kbps) and I/IDR insertion (RED bars). This player will show I frame at intraFrameInterval. So we can have clearly idea that bit-rate is changed and no I/IDR frame insertion occurred when we change bit-rate dynamically.

    Regards,

    Jemish

  • Jemish,

    Quoting your response :

    This player will show I frame at intraFrameInterval. So we can have clearly idea that bit-rate is changed and no I/IDR frame insertion occurred when we change bit-rate dynamically

    --> This is what is intended right? You want to change the bitrate dynamically and you dont want I/IDR frames to be inserted? Am I missing something here?

    PS: We also use elecard analyzer to analyze the streams

  • Hi Santosh,

    Yes whatever you understand is right. We want to change bit-rate and we don't want to insert I-Frame. Did you observe bit-rate change and  no I-frame was inserted in elecard analyzer ?  Means are you able to get result what we expect? If yes can you share encoded file with us?

    Regards,

    Jemish

  • Yes, we are able to get the intended results.

    Shared are the encoder configurations(static, dynamic) + encoder status ( before & after bitrate change) + encoder console for this test + bitstream.

    5344.DynamicRateChange.zip

    Thanks,

    Santosh

  • Hi Santosh,

    Thanks for sharing file and all the parameters. Can you help me bit more. If you can change bit rate from 20Mbps to 200Kbps. Share file with me. It will be really helpful to me to analyze properly. It would be fine if you can share flie with more size (more than 200 frames) if possible.

    Regards,

    Jemish

  • Hi Santosh,

    Sorry about previous range of bit-rate change. Provide me encoded file with bit -rate variation from 40Mbps to 1Mbps.

    Regards,

    Jemish

  • Jemish,

    Parameter changes are  

    • level = 40 to 51 ( to avoid encoder warning as we raise bit rate to 40 MBPS )
    • bitrate variation 40 MBPS to 1 MBPS
    Bitrate variation at every 25th frame
    [ Code snippet
    if(!FrameNum % 25)
     {

      if ( FrameNum & 0x01) // 25, 50, 75 ....
      {
        gDynamicParams[0].videnc2DynamicParams.targetBitRate -= 39000000 ;
      }
      else
      {
        gDynamicParams[0].videnc2DynamicParams.targetBitRate += 39000000 ;
      }

    }

    ]

    0181.ReTest.zip

    Thanks.
  • Hi Santosh,

    Thanks once again . This is exactly what we want. This will solve our problem. Can you share source code of your application. So that I can compare it with my application and debugging will be easy for me. Right now we are not able to identify what we are missing. If code is confidential then send me via email on below email address jemish.patel@einfochips.com.

    Regards,

    Jemish

  • What is the version of H.264 Encoder being used in your application?

    BTW, you should be having a sample test application that comes with the release package. I have used the same sample test application + encoder configuration which is being shared in earlier replies.

    Thanks.

  • Hi Santosh,

    We are using EZSDK version "5_05_01_04" .  So we are using H264 encoder whatever  default comes with this EZSDK. In user guide it written as H.264 2.0.

    You have shared (all the encoder parameters + result encoded files ) but it will be really helpful to us if you can share source code with us.

    Regards,

    Jemish

  • Hi Santosh,

    Thanks for your great support. We are able to close this issue from our side as well as from client side.

    Regards,

    Jemish

  • Hi Santosh,

    It was a great help from your side and we really appreciate your efforts.

    Thanks for guiding us to the correct direction and helping us out to overcome the issue. It was because your quick responses and pin-point direction we were able to resolve the issue. Thanks for all your valuable feedbacks and suggestions.

    Thanks

    Krunal