Created
December 23, 2016 04:01
-
-
Save imorrish/8f8a31525de0b864ccf2ec45b0e0ddd3 to your computer and use it in GitHub Desktop.
Configure Blackmagic Decklink card from command line or PowerShell script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#download the DLL from https://1drv.ms/u/s!ApGpqMMpRLhijeR1-4SVgqdytAUhmg | |
# remember to unblock the file by right clicking > Properties > Unblock | |
# some constants | |
$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 'C:\Users\imorrish\Documents\WindowsPowerShell\decklink.dll' | |
$Decklink = new-object VISE_DeckLink.DeckLink | |
$Devices = $Decklink.DeckLinkDevices() | |
write-host "Number of devices detected: $($Devices.Count)" | |
#display video and audio in/out ports | |
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 "" | |
} | |
# uncomment the next line if you want to see all properties | |
# $Devices | |
# set audio and video connections | |
# in this case there are 2 decklinks installed and I want to configure the 2nd one | |
$devices[1].ConfigAudioInputConnection = 8 # XLR | |
$devices[1].ConfigVideoInputConnection = 16 # Composite | |
# uncomment this if you want this to be saved as default when power is cycled | |
# Note: this requires the script to be "Run As Administrator" or you will get an error | |
#$devices[1].WriteConfigurationToPreferences() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment