Blackmagic Intensity Pro 4K is a PCIe express board able to acquire and generate NTSC/PAL, HD and UltraHD video.
Although Blackmagic provide a SDK (IDL based) with good examples, this post aims to exemplify acquire NTSC/PAL and HD images in LabVIEW through IMAQdx and/or DirectShow .NET LabVIEW SDK (thanks GriffinRU for the great job done) to be process in NI Vision Development Module.
HW:
- HDMI Output (used my laptop HDMI output);
- HDMI2AV converter (to convert laptop HDMI output to NTSC/PAL);
- Blackmagic Intensity Pro 4k.
SW:
- LabVIEW 2016;
- Vision Development Module 2016;
- Blackmagic Desktop Video 10.10;
- Blackmagic Desktop Video 10.10 SDK;
- All SW required for the DirectShow .NET LabVIEW SDK.
Either on IMAQdx or DirectShow, Intensity Pro 4K requires to switch the right input as well as configure the right image format, otherwise returns black/blue image.
Switch inputs can be done with the "Switch Video and Audio Inputs.vi", that basically send commands to DeviceConfigure.exe (located at [Blackmagic SDK Folder]\Win\Samples\bin) through SystemExec.vi.
OBS: Put DeviceConfigure.exe in the same VI folder or change how the VI refers to it.
Find the right image format can be in MAX or DecklinkCapture.exe (located at [Blackmagic SDK Folder]\Win\DirectShow\Samples\bin), trying one by one and checking when return a proper image.
"Scan Video Modes.vi", scan and take a snap in every format and populate an array indicator:
IMAQdx:
Mapped the image/video format index, set "Video Mode" control in the "Video Mode Grab - Flip Img.vi" example, choose the right camera name (in my case "Blackmagic WDM Capture" appeared as "cam0", can be seen in MAX) and run the VI. Flip the image horizontally if needed.
DirectShow:
Was done few changes in the "DirectShow - Example - Acquire Video plus Sample Grabber.vi" SDK example allowing set video format and copy image to an IMAQ pointer. Same case than IMAQdx example, set the "Video Input Index" and run the VI.
Others few changes in "DirectShow - SampleGrabber (Buffer).vi" and "DirectShow - Bitmap to LabVIEW image.vi" were just to optimize it for this example. These 3 VIs are attached and were renamed with MOD at the beginning of the file name.
Files attached in the ZIP:
- MOD_DirectShow - Bitmap to U32.vi
- MOD_DirectShow - Example - Acquire Video plus Sample Grabber.vi
- MOD_DirectShow - SampleGrabber (Buffer).vi
- NEW_DirectShow - Example - List Video Formats.vi
- Scan Video Modes.vi
- Switch Video and Audio Inputs.vi
- Video Mode Grab - Flip Img.vi
If "DirectShow Examples.llb" and "DirectShow SDK.llb" are in this same folder, it should be ok to open and run the examples.
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.