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
CyaSteve  
#1 Posted : Thursday, May 1, 2025 8:51:45 AM(UTC)
CyaSteve

Rank: Newbie

Groups: Registered
Joined: 5/1/2025(UTC)
Posts: 4
United States
Location: CA

4box with one main section in 4:3 resolution

Hey all,

I'm looking to figure out if there's a way that I can script or maybe there's a setting that turns on audio from only the first layer in a input.

Four layers in an input, want only the 1st one to play audio

My 4 inputs are OBS1, OBS2, OBS3, and OBS4. At any given time any of these 4 can be in the "main larger box" and then the other 3 options are on the side in the smaller views.

It's simple to set up triggers to hard code which audio comes on, but what I'm looking to do is rotate through them. The way that I have it set up is I have two identical inputs that I merge between to move the scenes around.
So it could be
Input one:
Main: OBS1 (With Audio)
Sidebar: OBS2, OBS3, OBS4 (All Muted)

Input two:
Main: OBS3 (With Audio)
Sidebar: OBS1, OBS2, OBS4 (All Muted)

So is there a way when I transition to a scene that VMix looks at what the first layer is, turns that audio on and turns all other layers in the scene off?

Thanks in advance for any ideas!
nikosman88  
#2 Posted : Thursday, May 1, 2025 10:56:02 AM(UTC)
nikosman88

Rank: Advanced Member

Groups: Registered
Joined: 12/24/2021(UTC)
Posts: 647
Greece
Location: athens

Thanks: 155 times
Was thanked: 84 time(s) in 80 post(s)
Hi there exist at least 2 ways to do it
1.vmix scripting that will check what input is on layer 1 to your input and do the action
2.Bitfocus companion triggers like "on condition become true"-->check internal value-->layer name on the specific input, do the action
CyaSteve  
#3 Posted : Thursday, May 1, 2025 12:52:12 PM(UTC)
CyaSteve

Rank: Newbie

Groups: Registered
Joined: 5/1/2025(UTC)
Posts: 4
United States
Location: CA

Originally Posted by: nikosman88 Go to Quoted Post
Hi there exist at least 2 ways to do it
1.vmix scripting that will check what input is on layer 1 to your input and do the action
2.Bitfocus companion triggers like "on condition become true"-->check internal value-->layer name on the specific input, do the action


Love to hear that, can you think of any scripts that might be close to what I'm asking for? I'll start digging in the meantime!

Thanks!
CyaSteve  
#4 Posted : Thursday, May 1, 2025 2:19:18 PM(UTC)
CyaSteve

Rank: Newbie

Groups: Registered
Joined: 5/1/2025(UTC)
Posts: 4
United States
Location: CA

Ok after some searching the main thing I seem to be getting stuck on is simply how to pull what is on each layer. It seems very simple to set things to layers but much more complex to have the system tell me what's on the layer. Seems like there's some XML solutions so I'll start learning that but it seems like a convoluted solve.
CyaSteve  
#5 Posted : Thursday, May 1, 2025 4:29:11 PM(UTC)
CyaSteve

Rank: Newbie

Groups: Registered
Joined: 5/1/2025(UTC)
Posts: 4
United States
Location: CA

Originally Posted by: CyaSteve Go to Quoted Post
Ok after some searching the main thing I seem to be getting stuck on is simply how to pull what is on each layer. It seems very simple to set things to layers but much more complex to have the system tell me what's on the layer. Seems like there's some XML solutions so I'll start learning that but it seems like a convoluted solve.


Code:
dim xml = API.XML()
dim x as new system.xml.xmldocument
x.loadxml(xml)

dim previewInput as string
dim output as String
dim prevNodeString as String
dim childNode as xml.XmlNode
dim prevNode as xml.XmlNode

'Get what input Preview is looking at
previewInput = (x.selectSingleNode("//preview").InnerText)
Console.WriteLine(previewInput)

'Go to the node in XML
prevNodeString = "//input[@number=" & previewInput & "]"
Console.WriteLine(prevNodeString)
prevNode = (x.selectSingleNode(prevNodeString))

'Get the first child of the node (Hoping it will be layer 1 inside the input.)
childNode = prevNode.FirstChild


'dim ns = childNode.GetNamespaceOfPrefix("key")  -- This was a shot in the dark I don't think it did anything.

'Debug line
Console.WriteLine(childNode.OuterXML)


This is as far as I've gotten so far, from what I can tell I think I've accidentally janked my way into something partially correct. It looks like what's happening is I can look at what the preview sees, get the input reference number from the innertext between the <> <>. After, I use that to do a single node select to find the node that preview is looking at, then I try to figure out what layers are inside of that node and since I'm only looking for the top layer I'm calling the FirstChild function in hopes that it will give me the <overlay id="#" key="afddfhdafhadfhadfhafhafh"> info but it stalls there. No matter what I do I can't manage to get the GUID out of the first child.

Edit: to be super clear trying to get to this key so I can reference it elsewhere.
UserPostedImage
Users browsing this topic
CyaSteve, 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.