DeckLinkCoreVideoMediaFrame

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

GlennKenny

  • Posts: 9
  • Joined: Mon Feb 17, 2020 6:59 pm
  • Real Name: Glenn Kenny

DeckLinkCoreVideoMediaFrame

PostMon Feb 17, 2020 7:11 pm

Hi,
I'm using this function from the FilePlayback sample code. I need to get timecode from this function. I see the GetTimecode() method, but it is not implemented. How do I implement this method, IDeckLinkTimecode does not have the set method to allow me to set the timecode from my CMSampleBuffer. Any thoughts?

Thanks,
Glenn
Offline

Cameron Nichols

Blackmagic Design

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

Re: DeckLinkCoreVideoMediaFrame

PostWed Feb 19, 2020 1:51 am

Hi Glenn,

The GetTimecode() is overridden as DeckLinkCoreMediaVideoFrame implements IDeckLinkVideoFrame. For timecode to be embedded in the output video frame, you should do the following.
  1. Create class that implements IDeckLinkTimecode [1], has local members for hours, minutes, seconds, frames, flags, optionally string and optionally userbits. Pass these into constructor and implement all IDeckLinkTimecode and IUnknown methods. Ensure QueryInterface casts for REFIID of IID_IDeckLinkTimecode
  2. Implement DeckLinkCoreMediaVideoFrame as IDeckLinkMutableVideoFrame, instead of IDeckLinkVideoFrame. [2]
  3. In DeckLinkCoreMediaVideoFrame, have a custom timecode member for each BMDTimecodeFormat you want to support
  4. Implement IDeckLinkMutableVideoFrame::SetTimecode() - call your custom timecode constructor with values from timecode->Get* methods. You may need to release existing timecode if non-nullptr.
  5. Implement IDeckLinkMutableVideoFrame::SetTimecodeFromComponents() - call custom timecode constructor with parameters. You may need to release existing timecode if non-nullptr.
  6. Implement IDeckLinkVideoFrame::GetTimecode() [3] return your custom timecode object
  7. Set timecode by calling SetTimecode() or SetTimecodeFromComponents() within your application
Alternatively you can keep DeckLinkCoreMediaVideoFrame as IDeckLinkVideoFrame, but add method to set the timecode value, with similar call as SetTimecodeFromComponents, in that case skip steps 2, 4, 5 and 7.

Let me know if you require further elaboration.

Regards
Cameron

References:
[1] 2.5.24 IDeckLinkTimecode Interface
[2] 2.5.7 IDeckLinkMutableVideoFrame Interface
[3] 2.5.5.7 IDeckLinkVideoFrame::GetTimecode method
Offline

GlennKenny

  • Posts: 9
  • Joined: Mon Feb 17, 2020 6:59 pm
  • Real Name: Glenn Kenny

Re: DeckLinkCoreVideoMediaFrame

PostThu Feb 20, 2020 3:08 pm

Thanks for the quick reply. I’m writing the code, will let you know.

Glenn
Offline

GlennKenny

  • Posts: 9
  • Joined: Mon Feb 17, 2020 6:59 pm
  • Real Name: Glenn Kenny

Re: DeckLinkCoreVideoMediaFrame

PostMon Feb 24, 2020 4:48 pm

Hi Cameron,
Can you please elaborate on these steps. I'm coming from an objective c background. I've tried many different ways, but getting nowhere.

Thanks,
Glenn

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 7 guests