OpenCV, Black Magic SDK, and UltraStudio Mini Recorder

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

jaime.morales

  • Posts: 5
  • Joined: Thu Jun 16, 2016 5:04 pm

OpenCV, Black Magic SDK, and UltraStudio Mini Recorder

PostThu Jun 16, 2016 5:28 pm

Hello Blackmagic Community!

Question: How do I get video frames from the MiniRecorder into cv::Mat format for OpenCV?

Set-up:
I am working on a tinkering/proof-of-concept demo, and I need to get up and running in a hurry. I am using OpenCV for some sig processing stuff, I have a Mac, I have a GoPro, and I have BlackMagic UltraStudio Mini Recorder. I downloaded Blackmagic DeckLink SDK 10.6.6.

The configuration it: GoPro --(HMDI)--> Mini Recorder --(Thunderbolt)--> Mac

What I found so far:
I am trying to get the live video frames into my processing chain in OpenCV so I need them in cv::Mat format. It seems like a pretty obvious use case, since there is no encryption and OpenCV is pretty well know. There was even a thread about it here: viewtopic.php?f=12&t=40622
Unfortunately, the code linked to by the OP doesn't compile on mac because:
cameradecklink.cpp:111:13: No viable conversion from 'IplImage *' (aka '_IplImage *') to 'cv::Mat'
Also, the responder referred to an example that I can't find in Blackmagic DeckLink SDK 10.6.6.

So I would like to know:

Is there any sample code that shows how to get frames into OpenCV?


Quick Update: As far as assigning an IplImage* to a cv::Mat, I did find this snippet.
cv::Mat mat = cv::cvarrToMat(img);
No word on if it works yet. Still hoping for an officially sanctioned Sample Code. :)
Offline

Matt Jefferson

Blackmagic Design

  • Posts: 130
  • Joined: Fri Aug 31, 2012 12:50 am

Re: OpenCV, Black Magic SDK, and UltraStudio Mini Recorder

PostTue Jun 21, 2016 1:48 am

Thanks Jaime for your posting on Blackmagic SDK and Open CV.

To answer your question, Blackmagic Design does not provide any you wrote
officially sanctioned Sample Code.
for this computer vision library or other image processing tools or libraries. In fact even digital media platforms / implementations like Gstreamer or VLC use the Decklink SDK. Those communities have implemented support by working with the publicly available SDK and sample code provided in the SDK download.

Hopefully forum members can provide what you seek or pm you with specific assistance on Open CV.

Matt Jefferson
Offline

jaime.morales

  • Posts: 5
  • Joined: Thu Jun 16, 2016 5:04 pm

Re: OpenCV, Black Magic SDK, and UltraStudio Mini Recorder

PostFri Jul 29, 2016 6:03 pm

As it turns out I was able to get everything I needed to get the system running on a Mac with the configuration I described at full frame rate. No PM's necessary. I'm taking it over to the PC side right now, but is seems like the interface for the PC side is different than the interface for the Mac. This might just be because I haven't dug into it enough to figure it out yet. First step is figuring out how to build the H and C files from the "IDL". I'll try to post updates as I progress. Maybe some will find it useful.

What would you say is the best example to start from, the "Capture Preview" sample in the SDK?
Offline
User avatar

Fred Rodrigues

  • Posts: 364
  • Joined: Mon Nov 05, 2012 9:00 am
  • Location: Amsterdam

Re: OpenCV, Black Magic SDK, and UltraStudio Mini Recorder

PostFri Jul 29, 2016 6:26 pm

http://www.fredrodrigues.net/
Offline

jaime.morales

  • Posts: 5
  • Joined: Thu Jun 16, 2016 5:04 pm

Re: OpenCV, Black Magic SDK, and UltraStudio Mini Recorder

PostMon Aug 08, 2016 5:47 pm

<Deleted> (By me)
Last edited by jaime.morales on Mon Aug 08, 2016 10:06 pm, edited 1 time in total.
Offline

jaime.morales

  • Posts: 5
  • Joined: Thu Jun 16, 2016 5:04 pm

Re: OpenCV, Black Magic SDK, and UltraStudio Mini Recorder

PostMon Aug 08, 2016 9:22 pm

Starting the re-write of the DeckLink Input Controller for Windows. Going to try using the "Capture Preview" sample module provided in the SDK as a baseline and see what I can do from there. Hopefully I'll be able to avoid meetings and just code. If I can't figure that out, I'll hop over and check out the open source project.
Offline

jaime.morales

  • Posts: 5
  • Joined: Thu Jun 16, 2016 5:04 pm

Re: OpenCV, Black Magic SDK, and UltraStudio Mini Recorder

PostMon Aug 08, 2016 9:27 pm

Oh and a quick tip:
1) To use an IDL file, add the DeckLinkAPI.idl to your MSVS project
2) Right click it and choose compile. The derived c and h files will by default be in the directory with the project.
3) Either move the files to a location in the search path or Add the path to the include list in the project
4) I added a new filter called "Derived Files" and added DeckLinkAPI_h.h and DeckLinkAPI_i.c to that filter.

Voila!

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 35 guests