Blackmagic Decklink Device Information from PowerShell Script

decklinkautomation

I have started working on a providing control of Blackmagic Design Decklink cards from Windows PowerShell scripts.

Just at the initial stage of being able to read the configuration of cards connected to the PC.

Updated: Can now set some card options also. Use $Devices | Get-Member
To find the methods and properties. $devices[0].
Will give you more options for the first device detected.

Example script:

$VideoConnections = @{1 = "SDI"; 2 = "HDMI"; 4 = "Optical SDI"; 8 = "Component"; 16 = "Composit"; 32 = "S-Video" }
$AudioConnections = @{1 = "Embedded" ; 2 = "AESEBU" ; 4 = "Analog"; 8 = "Analog XLR"; 16 = "Analog RCA"; 32 = "Microsophone"; 64 = "Headphones"}
$VideoIOSupport = @{1 = "Capture"; 2 = "Playback"}
add-type -path '\Documents\WindowsPowerShell\decklink.dll'
$cards = new-object VISE_DeckLink.DeckLink
$Devices = $cards.DeckLinkDevices()
write-host "Number of devices detected: $($Devices.Count)"
$devices
foreach ($device in $Devices){
    write-host "$($device.DisplayName)" -ForegroundColor red -BackgroundColor white
    Write-host " IO Support:"
    $VideoIOSupport.Keys | where { $_ -band $device.VideoIOSupport } | foreach { $VideoIOSupport.Get_Item($_)} 
    Write-host " Input Video Connections:"
    $VideoConnections.Keys | where { $_ -band $device.VideoInputConnections } | foreach { $VideoConnections.Get_Item($_)}
    Write-host " Input Audio Connections:"
    $AudioConnections.Keys | where { $_ -band $device.AudioInputConnections } | foreach { $AudioConnections.Get_Item($_)}
    Write-host " Output Video Connections:"
    $VideoConnections.Keys | where { $_ -band $device.VideoOutputConnections } | foreach { $VideoConnections.Get_Item($_)}
    Write-host " Output Audio Connections:"
    $AudioConnections.Keys | where { $_ -band $device.AudioOutputConnections } | foreach { $AudioConnections.Get_Item($_)}

Write-host ""
}

Here is an example the output.

decklinkconfig

Download the decklink.dll file from here https://1drv.ms/u/s!ApGpqMMpRLhijeR1-4SVgqdytAUhmg