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.

Issues about the data flow in mcfw

Hi,

I create a usecase in mcfw. The data flow is as following:

rtp_recv->h264dec->dup->swms->merge->nfs->h264enc->rtp_send

I want to test the data process time delay between rtp receive and send. I need to mark the input h264 frames and call gettimeofday() at the beginning and end of the process. But I find that the encoder output frame number does not agree with the decoder input frame number.  When I start the program even if I don't feed any data to the decoder, the encoder start to produce output data which is just black picture. The following is the buf status of all the links. I don't know why the nfs link and decode link could receive data from the previous link. 

IPCBITSOUTLINK:Buffer Statistics
Num Alloc Pools:1
PoolId | TotalBufCnt | FreeBufCnt | BufSize | AppAllocCount
0| 6| 5| 76800| 1

VDEC:Buffer Statistics
ChId | InBufCnt | OutBufCnt
0| 0| 0
[m3video]
[m3video] *** Decode Statistics ***
[m3video] 19506: DEC: Rcvd from prev = 0, Returned to prev = 0
[m3video]
[m3video] *** IpcOutM3 Statistics ***
[m3video]
[m3video] Elasped Time : 2 secs
[m3video] Total Fields Processed : 0
[m3video] Total Fields FPS : 0 FPS
[m3video]
[m3video]
[m3video] CH | In Recv In Process In Skip
[m3video] Num | FPS FPS FPS
[m3video] --------------------------------
[m3video] 0 | 0 0 0
[m3video]
[m3video] DEC Out BufExt Q Status
[m3video] Empty Q 0 -> count 6, wrPtr 6, rdPtr 0
[m3video] Full Q -> count 0, wrPtr 0, rdPtr 0
[m3vpss ]
[m3vpss ] *** [SWMS0] Mosaic Statistics ***
[m3vpss ] 20506: SWMS: Rcvd from prev = 0, Returned to prev = 0
[m3vpss ] SWMS Out Buf Q Status
[m3vpss ] Empty Q -> count 6, wrPtr 63, rdPtr 57
[m3vpss ] Full Q -> count 0, wrPtr 57, rdPtr 57
[m3vpss ]
[m3vpss ] *** [NSF0] NSF Statistics ***
[m3vpss ] 21507: NSF: Rcvd from prev = 73, Returned to prev = 73
[m3vpss ] NSF Out [0] Buf Q Status
[m3vpss ] Empty Q -> count 0, wrPtr 0, rdPtr 0
[m3vpss ] Full Q -> count 0, wrPtr 73, rdPtr 73
[m3vpss ]
[m3vpss ] *** IpcOutM3 Statistics ***
[m3vpss ]
[m3vpss ] Elasped Time : 4 secs
[m3vpss ] Total Fields Processed : 73
[m3vpss ] Total Fields FPS : 18 FPS
[m3vpss ]
[m3vpss ]
[m3vpss ] CH | In Recv In Process In Skip
[m3vpss ] Num | FPS FPS FPS
[m3vpss ] --------------------------------
[m3vpss ] 0 | 18 18 0
[m3vpss ]
[m3video]
[m3video] *** Encode Statistics ***
[m3video] 22508: ENC: Rcvd from prev = 89, Returned to prev = 89
[m3video] ENC Out BitBuf Q Status
[m3video] Empty Q 0 -> count 6, wrPtr 95, rdPtr 89
[m3video] Full Q -> count 0, wrPtr 89, rdPtr 89

So, could I set some params to force the encoder start to work according to the decoder?

Thanks in advance! Appreciate for your reply! 

  • This is because you have SwMs in your data flow and SwMs will periodically generate output frames independent of whether input is available or not .This is the correct behavior for swms as it is composing multiple inputs.You can delay SwMs start if you want but it is not possible to synchronize swms to run only when input is available.

  • Hi Badri,

    Thanks so much for your quick reply!

    You know my object is to construct a media server for video conference. Now the video and audio data flow are alright. But the video time delay is a bit too long. I send the capture video stream to DM8168 board and display it in local host at the same time. And I receive and display the video streams from DM8168 board after process. I compare the videos which I captured and receive from DM8168 board. I find that there is more or less 1 second time delay between them. In order to exclude the rtp transmit time delay,  I just send the captured video to another host and display.  There is nearly no timedelay. So, I need to measure the data process time delay. How could I mark the video frames to get the exact time delay? I try to mark the seq number of the input frame  feed to decoder and wait the encoder to produce the frame with the same number. But the result is not right. The time delay I get varys sharply from hundreds of ms to thousands of ms.

    I don't know if I am clear. I want to know how to measure the time delay  and I don't know why the time delay is so large. Could you give me some advise?

    Thanks a lot!

  • Hi Badri,

    I remember I saw somewhere the time delay of the video process of the DM8168 demos. It seems to be more or less 100 ms. For my usecase, I think the time delay should not far more than it. I don't understand where the time delay comes. Do the input and output buffers of the links involved in the data flow bring the time delay?

    Appreciate for your reply!