Example Code

Acquire Blackmagic Intensity Pro 4K Images (HDMI and Analog Video Inputs)

Code and Documents

Attachment

Overview

 

Blackmagic Intensity Pro 4K is a PCIe express board able to acquire and generate NTSC/PAL, HD and UltraHD video.

 

Description

 

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.

 

Hardware and Software Requirements

 

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.

 

Steps to Implement or Execute Code

 

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.

Checking current configurationChecking current configuration Changing to composite videoChanging to composite video Checking configuration againChecking configuration again

 

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:

HDMI2AV connected but no signalHDMI2AV connected but no signal Image format found, index 22Image format found, index 22

 

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.

IMAQ HDMI image acquisitionIMAQ HDMI image acquisition IMAQ NTSC image acquisitionIMAQ NTSC image acquisition IMAQ PAL image acquisitionIMAQ PAL image acquisition

 

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.

DirectShow HDMI image acquisitionDirectShow HDMI image acquisition DirectShow NTSC image acquisitionDirectShow NTSC image acquisition DirectShow PAL image acquisitionDirectShow PAL image acquisition

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.

 

Additional Information or References

 

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.

Contributors