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.

Encode LINK InSkipFPS UserFPS

Hi, TIers

I'm using DM8168 with RDK 4.0

There are 4 channels be encoded in my usecase, but the statistics information is abnormal,

one of the 4-channel : In Recv FPS = 30, In Skip FPS = 30, Out FPS = 0, there's no encoded frame output;

anothre channel : In Recv FPS = 30, UserFPS = 15, Out FPS = 15, I don't know what does this effect;

info file :

 ==== [Detailed statistics] EncLink : esencId0 = SYSTEM_LINK_ID_VENC_0 ==== 
 [m3video]  
 [m3video]  *** ENCODE Statistics *** 
 [m3video]  
 [m3video]  Elasped Time           : 59 secs
 [m3video]  
 [m3video]  
 [m3video]  CH  | In Recv In Skip In User  Out Latency  
 [m3video]  Num | FPS     FPS     Skip FPS FPS Min / Max
 [m3video]  --------------------------------------------
 [m3video]    0 |      30       0        0  30 255 / 3572
 [m3video]    1 |      30       0       15  15 255 / 197854
 [m3video]    2 |      30       0        0  30 255 / 3549
 [m3video]    3 |      30      30        0   0 255 /   0
 [m3video]  
 [m3video] Multi Channel Encode Average Submit Batch Size 
 [m3video] Max Submit Batch Size : 24
 [m3video] IVAHD_0 Average Batch Size : 0
 [m3video] IVAHD_0 Max achieved Batch Size : 0
 [m3video] IVAHD_1 Average Batch Size : 1
 [m3video] IVAHD_1 Max achieved Batch Size : 1
 [m3video] IVAHD_2 Average Batch Size : 1
 [m3video] IVAHD_2 Max achieved Batch Size : 1
 [m3video]  
 [m3video] Multi Channel Encode Batch break Stats 
 [m3video] Total Number of Batches created: 0 
 [m3video] All numbers are based off total number of Batches created
 [m3video]       Batch breaks due to batch sizeexceeding limit: 0 %
 [m3video]       Batch breaks due to ReqObj Que being empty: 0 %
 [m3video]       Batch breaks due to changed resolution class: 0 %
 [m3video]       Batch breaks due to interlace and progressivecontent mix: 0 %
 [m3video]       Batch breaks due to channel repeat: 0 %
 [m3video]       Batch breaks due to different codec: 0 %
 [m3video] Total Number of Batches created: 3573 
 [m3video] All numbers are based off total number of Batches created
 [m3video]       Batch breaks due to batch sizeexceeding limit: 100 %
 [m3video]       Batch breaks due to ReqObj Que being empty: 0 %
 [m3video]       Batch breaks due to changed resolution class: 0 %
 [m3video]       Batch breaks due to interlace and progressivecontent mix: 0 %
 [m3video]       Batch breaks due to channel repeat: 0 %
 [m3video]       Batch breaks due to different codec: 0 %
 [m3video] Total Number of Batches created: 893 
 [m3video] All numbers are based off total number of Batches created
 [m3video]       Batch breaks due to batch sizeexceeding limit: 0 %
 [m3video]       Batch breaks due to ReqObj Que being empty: 100 %
 [m3video]       Batch breaks due to changed resolution class: 0 %
 [m3video]       Batch breaks due to interlace and progressivecontent mix: 0 %
 [m3video]       Batch breaks due to channel repeat: 0 %
 [m3video]       Batch breaks due to different codec: 0 %
 ==== [IVAHD statistics] EncLink : esencId0 = SYSTEM_LINK_ID_VENC_0 ==== 
 [m3video]      198411: HDVICP-ID:0
 [m3video] All percentage figures are based off totalElapsedTime
 [m3video]               totalAcquire2wait :0 %
 [m3video]               totalWait2Isr :0 %
 [m3video]               totalIsr2Done :0 %
 [m3video]               totalWait2Done :0 %
 [m3video]               totalDone2Release :0 %
 [m3video]               totalAcquire2Release :0 %
 [m3video]               totalAcq2acqDelay :0 %
 [m3video]               totalElapsedTime in msec :       0
 [m3video]               numAccessCnt:       0
 [m3video]              IVA-FPS :       0
 [m3video]              Average time spent per frame in microsec:       0
 [m3video]      198411: HDVICP-ID:1
 [m3video] All percentage figures are based off totalElapsedTime
 [m3video]               totalAcquire2wait :0 %
 [m3video]               totalWait2Isr :67 %
 [m3video]               totalIsr2Done :0 %
 [m3video]               totalWait2Done :67 %
 [m3video]               totalDone2Release :0 %
 [m3video]               totalAcquire2Release :68 %
 [m3video]               totalAcq2acqDelay :31 %
 [m3video]               totalElapsedTime in msec :  191785
 [m3video]               numAccessCnt:   11507
 [m3video]              IVA-FPS :      60
 [m3video]              Average time spent per frame in microsec:   11166
 [m3video]      198412: HDVICP-ID:2
 [m3video] All percentage figures are based off totalElapsedTime
 [m3video]               totalAcquire2wait :0 %
 [m3video]               totalWait2Isr :6 %
 [m3video]               totalIsr2Done :0 %
 [m3video]               totalWait2Done :6 %
 [m3video]               totalDone2Release :0 %
 [m3video]               totalAcquire2Release :7 %
 [m3video]               totalAcq2acqDelay :92 %
 [m3video]               totalElapsedTime in msec :  191747
 [m3video]               numAccessCnt:    2545
 [m3video]              IVA-FPS :      13
 [m3video]              Average time spent per frame in microsec:    4520
 ==== [Buffer statistics] EncLink : esencId0 = SYSTEM_LINK_ID_VENC_0 ==== 
 [m3video]  
 [m3video]  *** Encode Statistics *** 
 [m3video]   198913: ENC: Rcvd from prev = 22414, Returned to prev = 22413
 [m3video]  ENC Out  BitBuf Q Status
 [m3video] Empty Q 0 -> count 13, wrPtr 31, rdPtr 18
 [m3video] Empty Q 1 -> count 7, wrPtr 254, rdPtr 247
 [m3video] Empty Q 2 -> count 7, wrPtr 8, rdPtr 1
 [m3video] Full Q -> count 0, wrPtr 265, rdPtr 265

How can I fix this issue?

Appreciate for any reply!

  • The encoder frame skip is determined by

    1. targetFrameRate that is part of dynamic params that application can set by invoking ENC_LINK_CMD_SET_CODEC_FPS

    2. inputFrameRate that application can set by invoking ENC_LINK_CMD_SET_CODEC_INPUT_FPS

     

    Both link commands should be invoked after creating encLink.make sure your application sets them to correct values.

  • I have invoked ENC_LINK_CMD_SET_CODEC_INPUT_FPS and ENC_LINK_CMD_SET_CODEC_FPS to modify input and target framerate after encLink created, as following:

    ////////////////////////////////////////////////////////////////////////////////////////////

        for (i = 0; i < 4; i ++)
        {
            EncLink_ChInputFpsParam inputPrm;
            inputPrm.chId = i;
            inputPrm.inputFps = 30;

            System_linkControl(esencId0, ENC_LINK_CMD_SET_CODEC_INPUT_FPS, (Void *)(&inputPrm), sizeof(EncLink_ChInputFpsParam), TRUE);

            EncLink_ChFpsParams outPrm;
            outPrm.chId = i;
            outPrm.targetFps = 30000;//30;
            if (3 == i)
                outPrm.targetBitRate    =    512000;
            else
                outPrm.targetBitRate = 1000000;//1000;

            System_linkControl(esencId0, ENC_LINK_CMD_SET_CODEC_FPS, (Void *)(&outPrm), sizeof(EncLink_ChFpsParams), TRUE);
        }

    ////////////////////////////////////////////////////////////////////////////////////////////

    it do effect, I invoke ENC_LINK_CMD_GET_CODEC_PARAMS to get channel parameters, result is depicted in the file

    chId=0:inputHeight=1080,inputWidth=1920,inputintraFrameInterval=30,targetBitRate=1000000,targetFrameRate=30000
    chId=1:inputHeight=720,inputWidth=1280,inputintraFrameInterval=30,targetBitRate=1000000,targetFrameRate=30000
    chId=2:inputHeight=1080,inputWidth=1920,inputintraFrameInterval=30,targetBitRate=1000000,targetFrameRate=30000
    chId=3:inputHeight=576,inputWidth=720,inputintraFrameInterval=30,targetBitRate=512000,targetFrameRate=30000
    
     [m3video] --------- CH 0 : H264 ENC : Dynamic Params -------
     [m3video]  
     [m3video] videnc2DynamicParams -> inputHeight             : 1080
     [m3video] videnc2DynamicParams -> inputWidth              : 1920
     [m3video] videnc2DynamicParams -> refFrameRate            : 30000
     [m3video] videnc2DynamicParams -> targetFrameRate         : 30000
     [m3video] videnc2DynamicParams -> targetBitRate           : 1000000
     [m3video] videnc2DynamicParams -> intraFrameInterval      : 30
     [m3video] videnc2DynamicParams -> generateHeader          : 0
     [m3video] videnc2DynamicParams -> captureWidth            : 16384
     [m3video] videnc2DynamicParams -> forceFrame              : -1
     [m3video] videnc2DynamicParams -> interFrameInterval      : 1
     [m3video] videnc2DynamicParams -> mvAccuracy              : 2
     [m3video] videnc2DynamicParams -> sampleAspectRatioHeight : 1
     [m3video] videnc2DynamicParams -> sampleAspectRatioWidth  : 1
     [m3video] videnc2DynamicParams -> ignoreOutbufSizeFlag    : 1
     [m3video] videnc2DynamicParams -> lateAcquireArg          : -1
     [m3video]  
     [m3video] rateControlParams -> rateControlParamsPreset        : 1
     [m3video] rateControlParams -> scalingMatrixPreset            : 0
     [m3video] rateControlParams -> rcAlgo                         : 0
     [m3video] rateControlParams -> qpI                            : -1
     [m3video] rateControlParams -> qpMaxI                         : 51
     [m3video] rateControlParams -> qpMinI                         : 0
     [m3video] rateControlParams -> qpP                            : -1
     [m3video] rateControlParams -> qpMaxP                         : 51
     [m3video] rateControlParams -> qpMinP                         : 0
     [m3video] rateControlParams -> qpOffsetB                      : 4
     [m3video] rateControlParams -> qpMaxB                         : 44
     [m3video] rateControlParams -> qpMinB                         : 10
     [m3video] rateControlParams -> allowFrameSkip                 : 0
     [m3video] rateControlParams -> removeExpensiveCoeff           : 0
     [m3video] rateControlParams -> chromaQPIndexOffset            : 0
     [m3video] rateControlParams -> IPQualityFactor                : 0
     [m3video] rateControlParams -> initialBufferLevel             : 2000000
     [m3video] rateControlParams -> HRDBufferSize                  : 2000000
     [m3video] rateControlParams -> minPicSizeRatioI               : 0
     [m3video] rateControlParams -> maxPicSizeRatioI               : 640
     [m3video] rateControlParams -> minPicSizeRatioP               : 0
     [m3video] rateControlParams -> maxPicSizeRatioP               : 0
     [m3video] rateControlParams -> minPicSizeRatioB               : 0
     [m3video] rateControlParams -> maxPicSizeRatioB               : 0
     [m3video] rateControlParams -> enablePRC                      : 1
     [m3video] rateControlParams -> enablePartialFrameSkip         : 0
     [m3video] rateControlParams -> discardSavedBits               : 1
     [m3video] rateControlParams -> VBRDuration                    : 8
     [m3video] rateControlParams -> VBRsensitivity                 : 0
     [m3video] rateControlParams -> skipDistributionWindowLength   : 5
     [m3video] rateControlParams -> numSkipInDistributionWindow    : 2
     [m3video] rateControlParams -> enableHRDComplianceMode        : 1
     [m3video] rateControlParams -> frameSkipThMulQ5               : 0
     [m3video] rateControlParams -> vbvUseLevelThQ5                : 0
     [m3video]  
     [m3video] interCodingParams -> interCodingPreset  : 0
     [m3video] interCodingParams -> searchRangeHorP    : 144
     [m3video] interCodingParams -> searchRangeVerP    : 32
     [m3video] interCodingParams -> searchRangeHorB    : 144
     [m3video] interCodingParams -> searchRangeVerB    : 16
     [m3video] interCodingParams -> interCodingBias    : 1
     [m3video] interCodingParams -> skipMVCodingBias   : 1
     [m3video] interCodingParams -> minBlockSizeP      : 0
     [m3video] interCodingParams -> minBlockSizeB      : 0
     [m3video] interCodingParams -> meAlgoMode         : 0
     [m3video]  
     [m3video] intraCodingParams -> intraCodingPreset          : 0
     [m3video] intraCodingParams -> lumaIntra4x4Enable         : 0
     [m3video] intraCodingParams -> lumaIntra8x8Enable         : 255
     [m3video] intraCodingParams -> lumaIntra16x16Enable       : 15
     [m3video] intraCodingParams -> chromaIntra8x8Enable       : 15
     [m3video] intraCodingParams -> chromaComponentEnable      : 1
     [m3video] intraCodingParams -> intraRefreshMethod         : 0
     [m3video] intraCodingParams -> intraRefreshRate           : 0
     [m3video] intraCodingParams -> gdrOverlapRowsBtwFrames    : 0
     [m3video] intraCodingParams -> constrainedIntraPredEnable : 0
     [m3video] intraCodingParams -> intraCodingBias            : 0
     [m3video]  
     [m3video] sliceCodingParams -> sliceCodingPreset  : 1
     [m3video] sliceCodingParams -> sliceMode          : 8608
     [m3video] sliceCodingParams -> sliceUnitSize      : 8672
     [m3video] sliceCodingParams -> sliceStartOffset   : [2 33 2]
     [m3video] sliceCodingParams -> streamFormat       : 0
     [m3video]  
     [m3video] sliceGroupChangeCycle           : 3072
     [m3video] searchCenter                    : 0
     [m3video] enableStaticMBCount             : 0
     [m3video] enableROI                       : 262400
     [m3video]  
     [m3video]  
     [m3video]  
     [m3video] --------- CH 2 : H264 ENC : Dynamic Params -------
     [m3video]  
     [m3video] videnc2DynamicParams -> inputHeight             : 1080
     [m3video] videnc2DynamicParams -> inputWidth              : 1920
     [m3video] videnc2DynamicParams -> refFrameRate            : 30000
     [m3video] videnc2DynamicParams -> targetFrameRate         : 30000
     [m3video] videnc2DynamicParams -> targetBitRate           : 1000000
     [m3video] videnc2DynamicParams -> intraFrameInterval      : 30
     [m3video] videnc2DynamicParams -> generateHeader          : 0
     [m3video] videnc2DynamicParams -> captureWidth            : 16384
     [m3video] videnc2DynamicParams -> forceFrame              : -1
     [m3video] videnc2DynamicParams -> interFrameInterval      : 1
     [m3video] videnc2DynamicParams -> mvAccuracy              : 2
     [m3video] videnc2DynamicParams -> sampleAspectRatioHeight : 1
     [m3video] videnc2DynamicParams -> sampleAspectRatioWidth  : 1
     [m3video] videnc2DynamicParams -> ignoreOutbufSizeFlag    : 1
     [m3video] videnc2DynamicParams -> lateAcquireArg          : -1
     [m3video]  
     [m3video] rateControlParams -> rateControlParamsPreset        : 1
     [m3video] rateControlParams -> scalingMatrixPreset            : 0
     [m3video] rateControlParams -> rcAlgo                         : 0
     [m3video] rateControlParams -> qpI                            : -1
     [m3video] rateControlParams -> qpMaxI                         : 51
     [m3video] rateControlParams -> qpMinI                         : 0
     [m3video] rateControlParams -> qpP                            : -1
     [m3video] rateControlParams -> qpMaxP                         : 51
     [m3video] rateControlParams -> qpMinP                         : 0
     [m3video] rateControlParams -> qpOffsetB                      : 4
     [m3video] rateControlParams -> qpMaxB                         : 44
     [m3video] rateControlParams -> qpMinB                         : 10
     [m3video] rateControlParams -> allowFrameSkip                 : 0
     [m3video] rateControlParams -> removeExpensiveCoeff           : 0
     [m3video] rateControlParams -> chromaQPIndexOffset            : 0
     [m3video] rateControlParams -> IPQualityFactor                : 0
     [m3video] rateControlParams -> initialBufferLevel             : 2000000
     [m3video] rateControlParams -> HRDBufferSize                  : 2000000
     [m3video] rateControlParams -> minPicSizeRatioI               : 0
     [m3video] rateControlParams -> maxPicSizeRatioI               : 640
     [m3video] rateControlParams -> minPicSizeRatioP               : 0
     [m3video] rateControlParams -> maxPicSizeRatioP               : 0
     [m3video] rateControlParams -> minPicSizeRatioB               : 0
     [m3video] rateControlParams -> maxPicSizeRatioB               : 0
     [m3video] rateControlParams -> enablePRC                      : 1
     [m3video] rateControlParams -> enablePartialFrameSkip         : 0
     [m3video] rateControlParams -> discardSavedBits               : 1
     [m3video] rateControlParams -> VBRDuration                    : 8
     [m3video] rateControlParams -> VBRsensitivity                 : 0
     [m3video] rateControlParams -> skipDistributionWindowLength   : 5
     [m3video] rateControlParams -> numSkipInDistributionWindow    : 2
     [m3video] rateControlParams -> enableHRDComplianceMode        : 1
     [m3video] rateControlParams -> frameSkipThMulQ5               : 0
     [m3video] rateControlParams -> vbvUseLevelThQ5                : 0
     [m3video]  
     [m3video] interCodingParams -> interCodingPreset  : 0
     [m3video] interCodingParams -> searchRangeHorP    : 144
     [m3video] interCodingParams -> searchRangeVerP    : 32
     [m3video] interCodingParams -> searchRangeHorB    : 144
     [m3video] interCodingParams -> searchRangeVerB    : 16
     [m3video] interCodingParams -> interCodingBias    : 1
     [m3video] interCodingParams -> skipMVCodingBias   : 1
     [m3video] interCodingParams -> minBlockSizeP      : 0
     [m3video] interCodingParams -> minBlockSizeB      : 0
     [m3video] interCodingParams -> meAlgoMode         : 0
     [m3video]  
     [m3video] intraCodingParams -> intraCodingPreset          : 0
     [m3video] intraCodingParams -> lumaIntra4x4Enable         : 0
     [m3video] intraCodingParams -> lumaIntra8x8Enable         : 255
     [m3video] intraCodingParams -> lumaIntra16x16Enable       : 15
     [m3video] intraCodingParams -> chromaIntra8x8Enable       : 15
     [m3video] intraCodingParams -> chromaComponentEnable      : 1
     [m3video] intraCodingParams -> intraRefreshMethod         : 0
     [m3video] intraCodingParams -> intraRefreshRate           : 0
     [m3video] intraCodingParams -> gdrOverlapRowsBtwFrames    : 0
     [m3video] intraCodingParams -> constrainedIntraPredEnable : 0
     [m3video] intraCodingParams -> intraCodingBias            : 0
     [m3video]  
     [m3video] sliceCodingParams -> sliceCodingPreset  : 1
     [m3video] sliceCodingParams -> sliceMode          : 8608
     [m3video] sliceCodingParams -> sliceUnitSize      : 8672
     [m3video] sliceCodingParams -> sliceStartOffset   : [2 33 2]
     [m3video] sliceCodingParams -> streamFormat       : 0
     [m3video]  
     [m3video] sliceGroupChangeCycle           : 3072
     [m3video] searchCenter                    : 0
     [m3video] enableStaticMBCount             : 0
     [m3video] enableROI                       : 262400
     [m3video]  
    
    
    
    
    
    

    parameters of each channel are correct, but skip FPS still exists.

    By the way, the channel-3(with the issue) is derived from the path:swms0---->Scalar---->NSF---->IPC---->Enc...

    Expect your further suggestion,Thanks a lot!

  • Channel 3 has Skip FPS and not User Skip FPS. This means it is dropping all frames .There was a bug in scaler link in RDK 4.0.Pls check if below patch resolves the issue

     

    --------------- mcfw/src_bios6/links_m3vpss/sclr/sclrLink_drv.c ---------------
    diff --git a/mcfw/src_bios6/links_m3vpss/sclr/sclrLink_drv.c b/mcfw/src_bios6/links_m3vpss/sclr/sclrLink_drv.c
    --- a/mcfw/src_bios6/links_m3vpss/sclr/sclrLink_drv.c
    +++ b/mcfw/src_bios6/links_m3vpss/sclr/sclrLink_drv.c
    @@ -322,7 +322,6 @@
         pFormat->pitch[0]       = pChInfo->pitch[0];
         pFormat->pitch[1]       = pChInfo->pitch[1];
         pFormat->pitch[2]       = pChInfo->pitch[2];
    -    pFormat->scanFormat     = pChInfo->scanFormat;
         pFormat->bpp            = FVID2_BPP_BITS16;
         pFormat->reserved       = NULL;
     
    @@ -375,6 +374,7 @@
             pOutChInfo = &pObj->info.queInfo[0].chInfo[chId];
     
             pFormat = &pObj->outObj.outFormat;
    +        pFormat->scanFormat     = pInChInfo->scanFormat;
             if (pObj->createArgs.tilerEnable)
             {
                 pOutChInfo->memType = VPS_VPDMA_MT_TILEDMEM; 

     

     
  • Thanks for your detailed reply to my colleague.

    And I wanna know is there some way to get the information of  updated package or any Bug Patch for DVRRDK?

  • DVR RDK 4.1 is the latest release. You can get it from TI FAE or myregisteredsoftware.ti.com if you have account. There are no patch releases after DVR RDK 4.1 available yet