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 DVR_RDK3.0] It's No Effective To Set FPS With Encode!



DearAll, In my usecase,I try to set Fps in runtime or creating time, both two way have no Effect(also no Err).

The chain is "srcLink -> ipcOutVpss-> ipcInVideo -> encLink -> ipcOutVideo -> ipcInVpss".

In runtime, the code is the following:

305 {
306 int tmpFrameRate = 10;
307 EncLink_ChFpsParams fpsPrm;
308 fpsPrm.targetFps = 1000 * tmpFrameRate;
309 fpsPrm.targetBitRate = 3*1000*1000;
310 printf("**** set encode link framerate %d\n", tmpFrameRate);
311 System_linkControl(encId, ENC_LINK_CMD_SET_CODEC_FPS, &fpsPrm, sizeof(fpsPrm), TRUE);
312 }

in the creating time, the code is the following:

211 encPrm.chCreateParams[i].defaultDynamicParams.inputFrameRate = 30;

212 encPrm.chCreateParams[i].defaultDynamicParams.targetFrameRate = 10;

however,the result is the same: the encoded data(H264) is 30fps, not 10fps!!!

Is something wrong with it?or some BUG with RDK3.0?or some workaround?

Pls show me some suggestions with it, Thanks!!!

The following is the detailed log:

[m3vpss ] 15029: NULL_SRC: Create in progress !!!

[host] @@@@@@@@@@@@@@@@@Can open file ./liveServer0.264

[host] open file ./liveServer0.264
[host] CHAINS_IPCBITS:Chains_ipcBitsRecvRtspServerFxn:Entered...
[host] 111111111111111

[host] CHAINS_IPCBITS:Chains_ipcBitsRecvRtspServerFxn:INFO: periodic print..
[host] save file ./liveServer0.264 printCnt-0 numBufs-0 len-0
[m3vpss ] 15057: NULL_SRC: Create Done !!!
[m3video] 15059: IPC_IN_M3 : Create in progress !!!
[m3vpss ] 15058: IPC_OUT_M3 : Create in progress !!!
[m3video] 15059: SYSTEM: Opening ListMP [VPSS-M3_IPC_OUT_0] ...
[m3vpss ] 15059: IPC_OUT_M3 : Create Done !!!
[m3video] 15059: SYSTEM: Opening ListMP [VPSS-M3_IPC_IN_0] ...
[m3video] 15062: IPC_IN_M3 : Create Done !!!
[m3video] *7**[traceAlg] links_m3video/iva_enc/encLink_tsk.c_EncLink_tskMain_20!
[m3video] *6**[traceAlg] links_m3video/iva_enc/encLink_common.c_EncLink_codecCreate_1152!
[m3video] 15062: ENCODE: Create in progress ... !!!
[m3video] 15093: ENCODE: Creating CH0 of 1920 x 1080, pitch = (1920, 1920) [PROGRESSIVE] [TILED ], bitrate = 3000 Kbps ...
[m3video] *5**[traceAlg] links_m3video/iva_enc/encLink_common.c_EncLink_codecCreateEncObj_819!
[m3video] *5.1**[traceAlg] links_m3video/iva_enc/encLink_common.c_enclink_codec_set_ch_alg_create_params_661:here has some level para to set!
[m3video] *5.2**[traceAlg] links_m3video/iva_enc/encLink_common.c_enclink_codec_set_ch_alg_create_params_693:level[0]!
[m3video] *5.3.1**[traceAlg] links_m3video/iva_enc/encLink_common.c_enclink_codec_set_ch_alg_default_dynamic_params_766!
[m3video] *5.3.2**[traceAlg] links_m3video/iva_enc/encLink_common.c_enclink_codec_set_ch_alg_default_dynamic_params_794: pChAlgDynPrm->targetBitRate[3000000]!
[m3video] *5.3.3**[traceAlg] links_m3video/iva_enc/encLink_common.c_enclink_codec_set_ch_alg_default_dynamic_params_795: pChAlgDynPrm->targetFrameRate[10000]!
[m3video] *4**[traceAlg] links_m3video/iva_enc/encLink_h264.c_EncLinkH264_algCreate_1237!
[m3video] *3**[traceAlg] links_m3video/iva_enc/encLink_h264.c_enclink_h264_set_static_params_638!
[m3video] *2**[traceAlg] links_m3video/iva_enc/encLink_h264.c_enclink_h264_set_static_params_662-level[51]!
[m3video] *1**[traceAlg] links_m3video/iva_enc/encLink_h264.c_enc_link_h264_create_196!
[m3video] *0**[traceAlg] links_m3video/codec_utils/src/alg_create.c_ALG_create_32!

[host] IpcBitsInLink_tskMain:Entered
[host] 922: IPC_BITS_IN : Create in progress !!!

[host] 922: IPC_BITS_IN : ListMPOpen start !!!

[host] 922: SYSTEM: Opening ListMP [VIDEO-M3_IPC_OUT_24] ...
924: SYSTEM: Opening ListMP [VIDEO-M3_IPC_IN_24] ...

[host] 926: IPC_BITS_IN : ListMPOpen done !!!

[host] 928: IPC_BITS_IN : System_linkGetInfo done !!!

[host] 928: IPC_BITS_IN : Create Done !!!


  • Can you provide more info about the issue. What do you mean by encoder is 30 fps ? Where are you measuring this fps. Pls share the logs of Vsys_printDetailedStatistics.If you are using Chains then you will have to implement equivalent function to Vsys_printDetailedStatistics and share the log,

  • HI,Badri.

    Firstly, I create a chain without capture and set encode targetFrameRate with 10 fps.

    Secondly, I save a H264 data file and use  BAOFENG Player to play it.

    Actually, I find that the video frame rate is 30fps, rather than 10fps.Why the targetFrameRate parameter  is not invalid?

    Looking forward to your suggestion,Thanks.

  • - Check if VUI info is present in the encoded stream by checking in a H264 elementary stream analyzer like elecard.

    - Check if you are receiveing frame from encLink at 10 fps or 30 fps by doing System_linkControl (,,,ENC_LINK_CMD_PRINT_STATISTICS) and share the log. Make sure you collect the log 2 times with 60 second interval.

  • The following is elecard log:


    The following is M3 Video Log(2 times):

    First Time:

    Enter Choice: [m3video] 78550: HDVICP-ID:0
    [m3video] All percentage figures are based off totalElapsedTime
    [m3video] totalAcquire2wait :0 %
    [m3video] totalWait2Isr :12 %
    [m3video] totalIsr2Done :0 %
    [m3video] totalWait2Done :12 %
    [m3video] totalDone2Release :0 %
    [m3video] totalAcquire2Release :12 %
    [m3video] totalAcq2acqDelay :87 %
    [m3video] totalElapsedTime in msec : 64542
    [m3video] numAccessCnt: 8616
    [m3video] IVA-FPS : 134
    [m3video] Average time spent per frame in microsec: 898
    [m3video] 78551: HDVICP-ID:1
    [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] 78551: HDVICP-ID:2
    [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]
    [m3video] *** ENCODE Statistics ***
    [m3video]
    [m3video] Elasped Time : 64 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 | 33 0 22 11 255 / 78522                               ============>11fps?
    [m3video]
    [m3video] Multi Channel Encode Average Submit Batch Size
    [m3video] Max Submit Batch Size : 24
    [m3video] IVAHD_0 Average Batch Size : 1
    [m3video] IVAHD_0 Max achieved Batch Size : 1
    [m3video] IVAHD_1 Average Batch Size : 0
    [m3video] IVAHD_1 Max achieved Batch Size : 0
    [m3video] IVAHD_2 Average Batch Size : 0
    [m3video] IVAHD_2 Max achieved Batch Size : 0
    [m3video]
    [m3video] Multi Channel Encode Batch break Stats
    [m3video] Total Number of Batches created: 714
    [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: 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: 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 %

    Second Time:

    Enter Choice: [m3video] 142442: HDVICP-ID:0
    [m3video] All percentage figures are based off totalElapsedTime
    [m3video] totalAcquire2wait :0 %
    [m3video] totalWait2Isr :12 %
    [m3video] totalIsr2Done :0 %
    [m3video] totalWait2Done :12 %
    [m3video] totalDone2Release :0 %
    [m3video] totalAcquire2Release :12 %
    [m3video] totalAcq2acqDelay :87 %
    [m3video] totalElapsedTime in msec : 128441
    [m3video] numAccessCnt: 17136
    [m3video] IVA-FPS : 133
    [m3video] Average time spent per frame in microsec: 899
    [m3video] 142443: HDVICP-ID:1
    [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] 142443: HDVICP-ID:2
    [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]
    [m3video] *** ENCODE Statistics ***
    [m3video]
    [m3video] Elasped Time : 63 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 | 33 0 22 11 255 / 142422                              ============>11fps?
    [m3video]
    [m3video] Multi Channel Encode Average Submit Batch Size
    [m3video] Max Submit Batch Size : 24
    [m3video] IVAHD_0 Average Batch Size : 1
    [m3video] IVAHD_0 Max achieved Batch Size : 1
    [m3video] IVAHD_1 Average Batch Size : 0
    [m3video] IVAHD_1 Max achieved Batch Size : 0
    [m3video] IVAHD_2 Average Batch Size : 0
    [m3video] IVAHD_2 Max achieved Batch Size : 0
    [m3video]
    [m3video] Multi Channel Encode Batch break Stats
    [m3video] Total Number of Batches created: 710
    [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: 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: 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 %

  • The encoder is correctly outputting frames at 1/3 of input fps. There is some issue with NullSrc configuration which is resulting in 33 fps instead of 30 fps.

    From the stream it looks like VUI info is not present. Without VUI info the player may be assuming some default frame rate and doing playback.

    Make sure you set encPrm.chCreateParams[i].encodingPreset = XDM_USER_DEFINED and check if the VUI info is present in the stream after this.,

    Refer this thread for enabling VUI info : http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/717/p/237004/830581.aspx#830581

     

  • haha,that is OK! Thanks a lot,Badri.