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
engelschall  
#1 Posted : Tuesday, June 28, 2022 3:59:28 AM(UTC)
engelschall

Rank: Advanced Member

Groups: Registered
Joined: 3/7/2022(UTC)
Posts: 71
Germany
Location: Munich

Was thanked: 33 time(s) in 17 post(s)
During the development of my various vMix VB.Net based scripts (see https://github.com/rse/vmix-scripts/) I've stumbled over the following shortcomings, which I would like to see improved in future versions of vMix:

1. Missing Function/Sub-Routines: for unknown reasons in the VB.Net 2.0 environment of vMix it seems one cannot declare neither functions ("function ... end function") nor sub-routines ("sub ... end sub"). This way one cannot define helper functions for complex scripts in order to reduce the script complexity. For one script I even had to change the algorithm from a recursive approach to an interactive one in order to cope with the limitation. VB.Net 2.0 is already a very old and nasty scripting environment, but without even functions/subs it is extremely nasty. Please support functions!

2. Missing Input Type: Although in the vMix documentation the type of inputs is defined to be "Input", this type is not available. There is only a global symbol "Input" for accessing things like Input.Output but no "Input" TYPE. In error messages vMix also tells one that the type of inputs actually internally is vMix.Scripting.Internal.Input. But even this cannot be used as a type as any "vMix." is not allowed. Please expose the type of inputs.

3. Missing Key on Inputs: One can go from numbers/names of inputs to Input-type-based objects via Input.Find(<name>) or Input.Find(<number>), but there seems to be no way to go from Input-type objects to the numbers/names. At least there is no ".Name" or ".Key" or whatever property on Input-type objects exposed. This e.g. dramatically limits the use of Input.Output and Input.Preview. Please expose at least the number and name of an input through a property.

4. Weak API Structure: the vMix API exposes an XML structure with some information on the current vMix configuration. Unfortunately, it is a rather weak exposure of the configuration only. Lots of information (e.g. whether a layer is enabled or disabled) is not exposed. This way one cannot easily react on those configuration aspects from within a script.
thanks 1 user thanked engelschall for this useful post.
Roy Sinclair on 7/8/2022(UTC)
doggy  
#2 Posted : Tuesday, June 28, 2022 4:42:08 AM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,245
Belgium
Location: Belgium

Thanks: 294 times
Was thanked: 961 time(s) in 795 post(s)
Originally Posted by: engelschall Go to Quoted Post

1. Missing Function/Sub-Routines: for unknown reasons in the VB.Net 2.0 environment of vMix it seems one cannot declare neither functions ("function ... end function") nor sub-routines ("sub ... end sub"). This way one cannot define helper functions for complex scripts in order to reduce the script complexity. For one script I even had to change the algorithm from a recursive approach to an interactive one in order to cope with the limitation. VB.Net 2.0 is already a very old and nasty scripting environment, but without even functions/subs it is extremely nasty. Please support functions!


create extarnally (app) and have access to all the bells and wistles of the enviroment!
What we did anyways before vMix scripting was added ( and still prefer for various/practical reasons)
engelschall  
#3 Posted : Tuesday, June 28, 2022 4:49:33 AM(UTC)
engelschall

Rank: Advanced Member

Groups: Registered
Joined: 3/7/2022(UTC)
Posts: 71
Germany
Location: Munich

Was thanked: 33 time(s) in 17 post(s)
Yes and no. YES, in general I agree that when you would place the scripting code into an external program you can use an arbitrary scripting environment (in my case it would be Node.js or something like this). But, NO, this means you get lots of latency because of the involved HTTP API access (even over localhost). For instance, check out my Audio-Sidechain script (https://github.com/rse/vmix-scripts/blob/master/audio-sidechain.vb): every 10ms it has to check the state of vMix in order to perform its actions. It works great, but only because it is running from WITHIN vMix itself. It would fail to work if running externally because of the extra latencies. Also, there is the nasty case that for a complex production one needs multiple scripts anyway. And currently we can just store them as "local scripts" with the event preset. If the scripts are externally, they have to be kept in sync with the preset and also have to be started manually when vMix starts, etc. So, I see your point, of course. But in practice external scripting gets somewhat nasty.
doggy  
#4 Posted : Tuesday, June 28, 2022 5:12:28 AM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,245
Belgium
Location: Belgium

Thanks: 294 times
Was thanked: 961 time(s) in 795 post(s)
Originally Posted by: engelschall Go to Quoted Post
Yes and no. YES, in general I agree that when you would place the scripting code into an external program you can use an arbitrary scripting environment (in my case it would be Node.js or something like this). But, NO, this means you get lots of latency because of the involved HTTP API access (even over localhost). For instance, check out my Audio-Sidechain script (https://github.com/rse/vmix-scripts/blob/master/audio-sidechain.vb): every 10ms it has to check the state of vMix in order to perform its actions. It works great, but only because it is running from WITHIN vMix itself. It would fail to work if running externally because of the extra latencies. Also, there is the nasty case that for a complex production one needs multiple scripts anyway. And currently we can just store them as "local scripts" with the event preset. If the scripts are externally, they have to be kept in sync with the preset and also have to be started manually when vMix starts, etc. So, I see your point, of course. But in practice external scripting gets somewhat nasty.


"Right".
Roy Sinclair  
#5 Posted : Friday, July 8, 2022 7:34:27 AM(UTC)
Roy Sinclair

Rank: Advanced Member

Groups: Registered
Joined: 11/23/2020(UTC)
Posts: 170
United States
Location: Wichita

Thanks: 10 times
Was thanked: 24 time(s) in 20 post(s)
Originally Posted by: doggy Go to Quoted Post

create extarnally (app) and have access to all the bells and wistles of the enviroment!
What we did anyways before vMix scripting was added ( and still prefer for various/practical reasons)


If you can do this by accessing the vMix API then yes (i.s. not the HTTP calls method).


+1 - Implementation is incomplete. It should be finished.
nikosman88  
#6 Posted : Monday, September 23, 2024 4:20:29 AM(UTC)
nikosman88

Rank: Advanced Member

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

Thanks: 130 times
Was thanked: 74 time(s) in 70 post(s)
+1
fgolman  
#7 Posted : Monday, September 23, 2024 4:23:16 AM(UTC)
fgolman

Rank: Advanced Member

Groups: Registered
Joined: 3/30/2023(UTC)
Posts: 85
United States
Location: Chicago

Thanks: 8 times
Was thanked: 3 time(s) in 2 post(s)
+1 on subroutines and functions. Silly that you can't use them. Makes for much poorer scripts without them.
WaltG12  
#8 Posted : Wednesday, September 25, 2024 3:01:14 PM(UTC)
WaltG12

Rank: Advanced Member

Groups: Registered
Joined: 7/4/2021(UTC)
Posts: 312
United States

Thanks: 8 times
Was thanked: 43 time(s) in 37 post(s)
+1
Roy Sinclair  
#9 Posted : Thursday, September 26, 2024 7:04:12 AM(UTC)
Roy Sinclair

Rank: Advanced Member

Groups: Registered
Joined: 11/23/2020(UTC)
Posts: 170
United States
Location: Wichita

Thanks: 10 times
Was thanked: 24 time(s) in 20 post(s)
Originally Posted by: engelschall Go to Quoted Post
During the development of my various vMix VB.Net based scripts (see https://github.com/rse/vmix-scripts/) I've stumbled over the following shortcomings, which I would like to see improved in future versions of vMix:

1. Missing Function/Sub-Routines: for unknown reasons in the VB.Net 2.0 environment of vMix it seems one cannot declare neither functions ("function ... end function") nor sub-routines ("sub ... end sub"). This way one cannot define helper functions for complex scripts in order to reduce the script complexity. For one script I even had to change the algorithm from a recursive approach to an interactive one in order to cope with the limitation. VB.Net 2.0 is already a very old and nasty scripting environment, but without even functions/subs it is extremely nasty. Please support functions!

2. Missing Input Type: Although in the vMix documentation the type of inputs is defined to be "Input", this type is not available. There is only a global symbol "Input" for accessing things like Input.Output but no "Input" TYPE. In error messages vMix also tells one that the type of inputs actually internally is vMix.Scripting.Internal.Input. But even this cannot be used as a type as any "vMix." is not allowed. Please expose the type of inputs.

3. Missing Key on Inputs: One can go from numbers/names of inputs to Input-type-based objects via Input.Find(<name>) or Input.Find(<number>), but there seems to be no way to go from Input-type objects to the numbers/names. At least there is no ".Name" or ".Key" or whatever property on Input-type objects exposed. This e.g. dramatically limits the use of Input.Output and Input.Preview. Please expose at least the number and name of an input through a property.

4. Weak API Structure: the vMix API exposes an XML structure with some information on the current vMix configuration. Unfortunately, it is a rather weak exposure of the configuration only. Lots of information (e.g. whether a layer is enabled or disabled) is not exposed. This way one cannot easily react on those configuration aspects from within a script.


Microsoft has announced they are deprecating the use of VbScripting in programs so this unfulfilled request is now obsolete.

In it's place I suggest vMix create an API DLL that can be used to create "script" DLLS that vMix can call and use instead of the internal VBScripting language so that "scripts" for vMix could be made using Visual Studio in any language supported by Visual Studio.

It should include all the API calls and objects with properties that can be queried and set that currently exist plus events that can be "subscribed" to allow the creation of more sophisticated and substantially faster scripting hopefully allowing the additional control that would allow us to provide much more comprehensive and functional scripts AND perhaps allow control integration to and from other programs like lighting controllers and sound systems.

Once that is in place the existing VBScript system could be left to run for a few years while people migrate to the new system then eventually removed.

Brano  
#10 Posted : Thursday, December 12, 2024 4:53:17 AM(UTC)
Brano

Rank: Member

Groups: Registered
Joined: 11/28/2024(UTC)
Posts: 14

Was thanked: 3 time(s) in 3 post(s)
+1
Users browsing this topic
Guest (2)
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.