- Posts: 2
- Joined: Mon Apr 05, 2021 10:16 am
- Real Name: Katharina Greiner
Hi Katharina,
Please have a look at the Desktop Video SDK sample InputLoopThrough (Desktop Video SDK 11.5 and later), which demonstrates rescheduling of input frames for output. It also performs a number of other tasks such as measuring latency, but you can ignore these functions.
You can modify the method processVideo in InputLoopThrough.cpp to add your custom frame processing. The input parameter videoFrame provides you the captured frame. You can access the underlying frame data by calling IDeckLinkVideoFrame::GetBytes() with videoFrame->getVideoFramePtr(). Once you have finished modifying the data, you can queue the frame for output by calling DeckLinkOutputDevice::scheduleVideoFrame, as shown in sample.
The processVideo call is performed with a dispatch queue, allowing for concurrent processing of frames on multiple threads. This is important for when your processing is longer than 1 frame period, ensuring that your scheduled frames can keep with the playback rate. You can adjust the number of processing threads by modifying constant kVideoDispatcherThreadCount.
Regards
Cameron