logo

Live Production Software Forums


Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Speegs  
#1 Posted : Tuesday, June 2, 2015 7:10:48 AM(UTC)
Speegs

Rank: Advanced Member

Groups: Registered
Joined: 8/3/2013(UTC)
Posts: 405
Location: Gold Coast, Australia

Thanks: 27 times
Was thanked: 76 time(s) in 58 post(s)
Hello,

I tried search, but didn't spot anything. Without going and writing any code is there a way in vmix to put the currently playing video from a playlist into a title as a variable?

If not, I guess I should start messing around with the API and a little script. Don't want to do something the hard way if someone has built one already.

Regards,

Speegs
Speegs  
#2 Posted : Thursday, June 4, 2015 11:08:41 PM(UTC)
Speegs

Rank: Advanced Member

Groups: Registered
Joined: 8/3/2013(UTC)
Posts: 405
Location: Gold Coast, Australia

Thanks: 27 times
Was thanked: 76 time(s) in 58 post(s)
Hello,

I built a powershell script, seems to work well.

Here is the code in case it helps someone else. Feel free to improve it and be kind and share any improvements.

It will find the first Playlist at the moment, ready what's playing. Remove the File Extension and put the filename through to a title. It asks for the input number of the title and the name of the title field to manipulate. Shouldn't use any real resources being a powershell script that spends most of it's time sleeping with a VB function to get input to setup, but that can be removed if you wanted to set it up from a batch file. Powershell is on most Windows computers so seems a good choice for something like this. You just minimize it in the background.

My reason for using it, is I need to move around a playlist and don't know the order of items before the event. Therefore I don't want to be madly typing title names as I switch videos. This solves that, if I name the files in the playlist appropriately. May not play well with special characters in the filenames. Not much error checking at all in this code.

"q" with the window active will quit or CTRL-C.

Code:

[void][System.Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic')
#The input number for the Vmix Title to Change
$input_no = [Microsoft.VisualBasic.Interaction]::InputBox("Please Vmix Input Number", "Number", $input_no)
#The name of the title field to modify, on NewsHD.xaml would either be Headline or Description
$title_name = [Microsoft.VisualBasic.Interaction]::InputBox("Please Vmix Title Name to modify", "Number", $title_name)
$lasttitle = ""
$xmlurl = "http://localhost:8088/API/"
$apicallurl1 = "http://localhost:8088/API/?Function=SetText&Input=$input_no&SelectedName=$title_name&Value="
while ($true) {
    [xml]$data = (New-Object System.Net.WebClient).DownloadString($xmlurl)
    $node = $data.SelectNodes("/vmix/inputs/input[@type='VideoList']")
    $title = ($node | Select-Object -ExpandProperty title | Out-String) 
    $title = $title -replace "^List - ", ""
    $title = $title.split('.')[0]
    if ($lasttitle -ne $title) {    
     write-host "Updating Vmix input $input_no - $title_name"
     write-host "With: " $title
     $apicallurl = $apicallurl1 + $title
     write-host $apicallurl
     (New-Object System.Net.WebClient).DownloadString("$apicallurl")
    } 
    write-host "------waiting-------"
    Start-Sleep -Seconds 1
    $lasttitle = $title
    if ($Host.UI.RawUI.KeyAvailable -and ("q" -eq $Host.UI.RawUI.ReadKey("IncludeKeyUp,NoEcho").Character)) {
        Write-Host "Exiting now..."
        break;
    }
}


Regards,

Speegs
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.