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
DwFMagik  
#1 Posted : Friday, April 29, 2016 5:18:15 AM(UTC)
DwFMagik

Rank: Member

Groups: Registered
Joined: 4/26/2016(UTC)
Posts: 16

Hi there, am looking to create a ticker that displays the 'NOW PLAYING : [band], [song]' from spotify.

I used a few plugins with Xsplit that managed it just fine and the way they did it was to create a .txt file that auto-updated every 5/10seconds and that loaded the information and saved it. Then xsplit would read and update the external .txt every 6-11 seconds resulting in a ticker that was always correct.

Can such a thing be done with vMix?
Nick Davidson  
#2 Posted : Sunday, May 1, 2016 2:24:56 PM(UTC)
Nick Davidson

Rank: Advanced Member

Groups: Registered
Joined: 4/19/2014(UTC)
Posts: 64
Man
Location: United States

Thanks: 4 times
Was thanked: 5 time(s) in 5 post(s)
DwFMagik wrote:
Hi there, am looking to create a ticker that displays the 'NOW PLAYING : [band], [song]' from spotify.

I used a few plugins with Xsplit that managed it just fine and the way they did it was to create a .txt file that auto-updated every 5/10seconds and that loaded the information and saved it. Then xsplit would read and update the external .txt every 6-11 seconds resulting in a ticker that was always correct.

Can such a thing be done with vMix?



I'm trying to figure out a similar solution for autoracing scoring and timing system. We use MyLaps and it would be great if I could add the driver's position to a ticker that was updated in real time.
Speegs  
#3 Posted : Monday, May 2, 2016 3:18:03 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)
I've been very successful at using the VMix web API and powershell scripts for updating titles with changing information.

Some of the code is in the forum. Should work for a Ticker as well as it's also just a different vmix title.

Basically if you can get the data into a format powershell can ingest (which is a lot, it loves csv and database files), Google an example. Even Google Powershell Spotify. I don't use spotify, but seems others use it :)

Doesn't have to be powershell, it can be done with many different languages. Powershell is good because well it's in Windows, easy to learn/google/manipulate and unlikely to crash your Vmix computer or get you into too much trouble. Downside is you have to spend the hours learning some basic programming skills. Start with "Hello World" and progress from that.

Some code that might help, this takes data from a Vmix Playlist and updates a standard Vmix Lower Third NewsHD.xaml

You just run the script minimized along with Vmix. Would be easy to say take the now playing from spotify and update a title with that data instead. But I'm not going to write the taking the data from spotify part for you :)

Code:

#Finds the First Playlist and Grabs the currently playing filename.  Removes extension and sends it to the user defined title.  Designed to run minimized every second.  Hitting "q" in the console will close it.
param (
	[string]$input_no = "NewsHD.xaml",
    [string]$title_name = "Headline",
    [string]$trans_no = "5"
)
[void][System.Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic')
#The input number for the Vmix Title to Change
$input_no = [Microsoft.VisualBasic.Interaction]::InputBox("Please enter Vmix Title Input Number or Title Name eg: NewsHD.xaml)", "Number/Title", $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 enter Vmix Title Text Field to Modify (eg: Headline or Description)", "Item to Modify", $title_name)
#The number of sleeps before transitioning out
$trans_no = [Microsoft.VisualBasic.Interaction]::InputBox("Please enter the number of seconds/iterations to hold the title", "Number", $trans_no)
$lasttitle = ""
$xmlurl = "http://localhost:8088/API/"
$apicallurl1 = "http://localhost:8088/API/?Function=SetText&Input=$input_no&SelectedName=$title_name&Value="
$transinurl = "http://localhost:8088/API/?Function=OverlayInput4In&Input=$input_no"
$transouturl = "http://localhost:8088/API/?Function=OverlayInput4Out&Input=$input_no"
$transcount = 0
while ($true) {
	[xml]$data = (New-Object System.Net.WebClient).DownloadString($xmlurl)
    $node = $data.SelectNodes("/vmix/inputs/input[@state='Running']")
	$title = ($node | Select-Object -ExpandProperty title | Out-String)     
    $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")
     Start-Sleep -Seconds 2
     write-host "Transitioning $input_no In"
     (New-Object System.Net.WebClient).DownloadString("$transinurl")
     $transcount = 1
    } 
    write-host "------waiting-------"    
    Start-Sleep -Seconds 1
    $lasttitle = $title
    if ($transcount -eq $trans_no) {
     write-host "Transitioning $input_no Out"
     (New-Object System.Net.WebClient).DownloadString("$transouturl")
    }
    $transcount++
    if ($Host.UI.RawUI.KeyAvailable -and ("q" -eq $Host.UI.RawUI.ReadKey("IncludeKeyUp,NoEcho").Character)) {
        Write-Host "Exiting now..."
        break;
    }
}



So can it be done, sure. Find out how to get the status of the current playing song into a variable via Powershell and the rest is in the code above.
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.