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.

DM365 IPNC MT5 Application.

Hello,

I had DM365 IPNC MT5 application source code.

From the code I found that the processing sequence is like this. Video Capture thread gets the video in buffer, then it pass to different threads like FD, VS, encode and display.

Buffer passing is in form of Queue. These all above processes are running in different thread. The video capture thread just copies that buffer and put that buffer in each process Queue.

After that individual thread starts processing. Is this right ?

Now I had inserted another thread similar to FD thread. It does processing of our algorithm. The algorithm runs on ARM itself and it takes much time to process the frame. So the FPS of framework drops. When we see at profiling the avg time / frame for capture thread goes on increasing as we increase our processing. 

Module   | Avg Time/Frame | Frame-rate | Total time | Total Frames |

 CAPTURE  |         127.56 |       7.84 |     114933 |          901 |

 ENCODE0  |          34.02 |      29.40 |      30648 |          901 |

 STREAM   |           1.02 |     977.22 |        922 |          901 |

 AEWB     |           0.32 |    3099.37 |       1107 |         3431 |

 IV.D   |         105.19 |       9.51 |      93097 |          885 |

IV.D is the thread I had added. As the capture buffer just copies the buffer, the processing time for capture thread should not increase, as processing of IV increases.

Please let me know if my understanding is not correct and please let me know how I can manage this so that FPS of Framework remains 30 and my algorithm may run at lower FPS. Whenever my algorithm finishes the processing of current frame, it will fetch the latest frame available and do the processing.

Please let me know how I can implement this.

Thanks 

Harshada

 

  • Hi Harshada,

    Sonali Phatak said:

    Please let me know if my understanding is not correct and please let me know how I can manage this so that FPS of Framework remains 30 and my algorithm may run at lower FPS. Whenever my algorithm finishes the processing of current frame, it will fetch the latest frame available and do the processing.

    Your understanding is right. You should be able to get 30fps for the rest of the system while your IV thread runs slower. Can you please confirm the version of IPNC Ref Design that you are using?

    Also, can you confirm if you do not do any processing in the IV thread and just put a sleep of say 50msec, it keeps the capture rate at 30fps?

    What is the thread priority of your thread (is it greater than capture thread) and do you release the processor in between?

    The implementation is almost the way you understood it. There is a VIDEO_fdCopyRun() API that copies the output buffer from capture thread and just sends a message to FD thread for processing. The capture buffer is instantly freed up in the capture thread.

    Regards,

    Anshuman

     

  • Hello Anshuman,

    Thanks for the reply.

    1. Can you please confirm the version of IPNC Ref Design that you are using? : The version that I downloaded from Approns FTP site is 20100105_Ver1.1.0. I used DM365PrivatePackage-1.1.0-Setup.exe to unzip the source code.

    2. can you confirm if you do not do any processing in the IV thread and just put a sleep of say 50msec, it keeps the capture rate at 30fps? : No the capture framerate is not 30 in this case

    Module   | Avg Time/Frame | Frame-rate | Total time | Total Frames |

     CAPTURE  |          66.25 |      15.09 |     119384 |         1802 |

     ENCODE0  |          15.49 |      64.56 |      27896 |         1801 |

     STREAM   |           0.28 |    3580.52 |        503 |         1801 |

     AEWB     |           0.23 |    4414.22 |        408 |         1801 |

     IV.D   |          50.12 |      19.95 |      90261 |         1801 |

    3.  The thread priority of IV is same as capture thread which is 98. If I keep the priority to 94, the fps of framework increase to 30. But in this case I am not able to access the webpages, also terminating the app even with Ctrl + C takes much time. This just mean I need to tackle the priorities only. But I found some thing different

    I did one more trial, I just added sleep of 50ms and sets priority to 94,even in this case the capture framerate is 15.( which is same with priority 98).

    Please let me know your opinion on these.

    Thanks,

    Harshada