How to achieve video capture with low latency

1. Introduction of low latency capture

2. The methods of using MWCapture SDK to realize low latency capture

MWOpenChannel() → CreateEvent()  → MWRegisterNotify() → MWStartVideoCapture()  →  WaitForSingleObject() →MWGetNotifyStatus() → MWCaptureVideoFrameToVirtualAddressEx() → WaitForSingleObject() → MWGetVideoCaptureStatus()

 Compared with regular capture mode, there are some differences as follows

1. users can only capture according to input frame rate.

2. When MWRegisterNotify() is used to register event notification object, notification mode mask should be MWCAP_NOTIFY_VIDEO_FRAME_BUFFERING. It means when input frames start to buffer to onboard memory, system is notified to capture video data.

3. For iFrame (number of video frames )from MWCaptureVideoFrameToVirtualAddressEx(), choose iNewestBuffering from MWCAP_VIDEO_BUFFER_INFO. It means that it will capture the serial number of frame which is buffering. At the same time, set cyParitalNotify as value 64 / 128 / 256 and etc., meaning once corresponding video lines are buffered to the onboard memory, it can start DMA transmission.

4. In the regular mode, after one frame DMA transmission is done, executing WaitForSingleObject() will inform the status change. While with low latency mode, when line data DMA transmission is done, cyPartialNotify will inform the status change and WaitForSingleObject() monitors the event response. Therefore, only when the value of bFrameCompleted from MWGetVideoCaptureStatus() is TRUE, one frame data has finished DMA transmission.

In all, by means of low latency mode, capture cards capture partial line data and start to DMA transmit to the target memory, which helps to reduce capture latency. At the same time, with the use of Partial Notification mode, it allows application to process this part of data in time. This mode makes signal input, data transmission, and data process happen simultaneously, which will achieve minimum delay.

Examples\Applications\LowLatency contains a demo for low latency capture.