Decklink | modify inputstream frame-by-frame

Ask software engineering and SDK questions for developers working on Mac OS X, Windows or Linux.
  • Author
  • Message


  • Posts: 1
  • Joined: Mon Apr 05, 2021 10:16 am
  • Real Name: Katharina Greiner

Decklink | modify inputstream frame-by-frame

PostMon Apr 05, 2021 10:41 am


I´m new here and using the BMD Decklink SDK.

For a project we would like to modify the incoming inputstream of a Decklink 8K Pro by using a mathematical calculation or a LUT and send the modified stream to the output.
Our plan is to access the current frame frame-by-frame, recalculate the frame and send it to the output of the Decklink. We used for our attempts the examples "VancCapture", "SychronisedCapture" and "FileCapture", but we can´t finde a solution to solve our this.

If somebody knews a solution for this, we would be very thankful. Thanks!

Cameron Nichols

Blackmagic Design

  • Posts: 337
  • Joined: Mon Sep 04, 2017 4:05 am

Re: Decklink | modify inputstream frame-by-frame

PostFri Apr 09, 2021 4:16 am

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.


Return to Software Developers

Who is online

Users browsing this forum: No registered users and 5 guests