- Posts: 2
- Joined: Fri Jun 12, 2020 3:11 am
- Real Name: michael rauchwerk
The CaptureStills sample wasn't designed to capture real-time video, but a fixed number of still frames.
If you the combined latency of IDeckLinkVideoConversion::ConvertFrame and WriteBgra32VideoFrameToPNG is more than 1 frame duration, then the received frame queue will fill and you will eventually exhaust the memory allocator for video input frames.
My recommendations to improve this are:
- Bring forward release of receivedVideoFrame to just after ConvertFrame. If conversion is required, then the received frame is no longer required after this point.
- Consider splitting the CaptureStills worker thread into 2 threads, one for ConvertFrame, the other for WriteBgra32VideoFrameToPNG, with a queue to manage frames between each thread. This will better pipeline your processing to allow working on multiple frames at once.
- If you find either ConvertFrame or WriteBgra32VideoFrameToPNG tasks are still longer than frame duration, then you will then need to further increase threads, have a look at DispatchQueue in InputLoopThrough for an example how to use multiple threads for video frame processing.
Regards
Cameron