logo

Live Production Software Forums


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

Notification

Icon
Error

18 Pages«<161718
Options
Go to last post Go to first unread
doggy  
#341 Posted : Monday, January 23, 2023 8:14:57 PM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 4,406
Belgium
Location: Belgium

Thanks: 249 times
Was thanked: 794 time(s) in 647 post(s)
Originally Posted by: Black Dog Go to Quoted Post
Thanks, Salvatore!
All layers turn On. Then "OFF" as "Set_Layer_NONE" and "ON" as Set_Layer_SomeInput. That is good idea.
Well, I need to rewrite all the scripts (((( with new idea.

Sorry, in code - Input_number as Numder or Input_name as Title. Somebody can copy code and VB_Try hides typing error )))
Originally Posted by: Salvatore Go to Quoted Post

Code:

Input1Layer1on = (x.SelectSingleNode("//input[@number='"& Input1name &"']/overlay[@index='0']/@key").value)


Is because the script is not complete, for one it doesnt defines the XML file and its access . but there are examples for that in this forum thread
Salvatore  
#342 Posted : Tuesday, January 24, 2023 11:37:15 PM(UTC)
Salvatore

Rank: Advanced Member

Groups: Registered
Joined: 11/15/2021(UTC)
Posts: 40
Italy

Thanks: 2 times
Was thanked: 5 time(s) in 4 post(s)
Originally Posted by: Black Dog Go to Quoted Post
Thanks, Salvatore!
All layers turn On. Then "OFF" as "Set_Layer_NONE" and "ON" as Set_Layer_SomeInput. That is good idea.
Well, I need to rewrite all the scripts (((( with new idea.

Sorry, in code - Input_number as Numder or Input_name as Title. Somebody can copy code and VB_Try hides typing error )))
Originally Posted by: Salvatore Go to Quoted Post

Code:

Input1Layer1on = (x.SelectSingleNode("//input[@number='"& Input1name &"']/overlay[@index='0']/@key").value)



if you search by title you have to declare it first:

Code:
'script will search the Input with Title "Input1name" and check the Input Number
dim Input1name as string = (x.SelectSingleNode("//input[@title='Input1name']/@number").Value)



Or instead of
Input1Layer1on = (x.SelectSingleNode("//input[@number='"& Input1name &"']/overlay[@index='0']/@key").value)
You can search directly by Input number:
Input1Layer1on = (x.SelectSingleNode("//input[@number='1']/overlay[@index='0']/@key").value)


And note that the Layer Numbers are different to the Index Numbers, because the Layers beginns to count from 1 and the Index beginns to count from 0
Input3Layer4on = (x.SelectSingleNode("//input[@number='3']/overlay[@index='3']/@key").value)
Input3Layer5on = (x.SelectSingleNode("//input[@number='3']/overlay[@index='4']/@key").value)
Input3Layer6on = (x.SelectSingleNode("//input[@number='3']/overlay[@index='5']/@key").value)
Ario  
#343 Posted : Friday, January 27, 2023 6:38:36 AM(UTC)
Ario

Rank: Advanced Member

Groups: Registered
Joined: 2/2/2015(UTC)
Posts: 154
Location: NL

Thanks: 153 times
Was thanked: 17 time(s) in 14 post(s)
Sharing a vMix script a friend wrote.
The use case:
The List input of vMix, strangely and unfortunately enough, only sorts its file order by file name, and A-Z only (no option for Z-A etc.).
We need files in the list to be sorted Z-A, specifically:
time + date are in the filename and we need to play the newest / latest file (highest date, highest time) first.
Why? Because these are exports from vMix replay (with filename: date - text - time), and we play these back during breaks in the game.
We want to be certain that during these breaks, viewers see the most recent actions as replays. Starting with the most recent one and then going back in time, step by step, ensures this.
Playback of replay events in chronologically reversed order, so to say.

We use Elgato StreamDecks with Companion.
There is a button that first creates the replay event, with a second action on that same button to export the event as an .avi file.

There must be an list input in your vMix project that is called List.

Every time the script is called (we have it behind a keyboard shortcut),
it clears the existing files from the list, populates the list with all avi-files in the specified folder,
sorts these by date/time descending (date/time are taken from file NAME),
and transitions that list (in our case, the list is on input 94) to PGM Out, using Stinger2.

The list has "Auto Next" on.
The list input (94) has a Trigger on it:
OnCompletion - Stinger2 - 1.Main
which means that when the entire list has played, Stinger2 transitions input 1 (Main camera) into PGM Out,
effectively moving the list into Preview.
The longer the list grows, the greater the chance our director transitions out of it manually, before it has completely played.

<start of the script>

Code:
'Script to sort the files on a part of the filename,
'instead of filename itself
'This script sorts files on the relevant time part in the filename
'e.g. "20221210 - Camera4 - [21-32-10] [21-32-15].avi"

Dim relevant_character as string = "["
Dim unique_separator as string = "|"

Dim p As String = "D:\vMix-IRP_D\replays\"
Dim di As New system.IO.DirectoryInfo(p)

Dim fa as system.io.fileinfo() = di.getfiles("*.avi")
dim fi as system.io.fileinfo

Dim cnt as integer = fa.Length
Dim sa(cnt) As String
Dim i as integer = 0
Dim x() as String

for each fi in fa
    'split the filename on the relevant part to sort on;
    'substring can also be used of course
    x = fi.Name.Split(relevant_character)
    sa(i) = x(1) & unique_separator & fi.FullName
    'Console.WriteLine(Cstr(i)&"."&sa(i))
    i += 1
Next

Array.Sort(sa)
Array.Reverse(sa)
API.Function("ListRemoveAll","List")

'Console.WriteLine("----")

i = 0
dim s as String
dim f as String
for each s in sa
    'for some reason, does the sorted array have an extra empty element?
    if s = Nothing
        Continue For
    end if

    'split the value on the unique_separator to get the original filename
    x = s.Split(unique_separator)
    'Console.WriteLine(Cstr(i)&"."&x(1))
    API.Function("ListAdd","List",x(1)) 
    i += 1  

Next

API.Function("Stinger2", Input:="94")

<end of the script>

Please feel free to use, modify, improve, elaborate, comment.
doggy  
#344 Posted : Friday, January 27, 2023 6:49:28 AM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 4,406
Belgium
Location: Belgium

Thanks: 249 times
Was thanked: 794 time(s) in 647 post(s)
Originally Posted by: Ario Go to Quoted Post
Sharing a vMix script a friend wrote.
The use case:


Please enclose the code in language Syntax Highlighting for clarity and readability
thanks 1 user thanked doggy for this useful post.
Ario on 1/27/2023(UTC)
Black Dog  
#345 Posted : Tuesday, January 31, 2023 4:28:52 AM(UTC)
Black Dog

Rank: Newbie

Groups: Registered
Joined: 4/7/2021(UTC)
Posts: 5
Location: Moscow

Thanks: 3 times
Hi Guru!
I have a GT title with running text (ticker). Text runs none stop. How stop text at end by a script?
I have a way to stop running text by pass time(duration)

Code:
'It is not full code for use. It is  only example to get duration running text

'get running text from title:

      Text_roll = Input.Find (title_input_name).text(ticker.text)
      
'get time running text: I know approximate letters per second - 5 and beginning scroll text from right side to left - 20 sec. Then:

    Count_Letters = Text_roll.lenght
    Time_scroll_text =  Count_Letters / 5         ' time pass only text 
    Time_total = Time_scroll_text + 20             ' total time of one pass text
  
'wait pass text 
    Sleep(Time_total)
 'Input title out:
    Api.function(Some overlay input out)


By time is not good. If i change speed scrollig text i have to change script (correct letters per second). The time running depends on the speed of the computer itself.
May be any solutions are?
.
doggy  
#346 Posted : Tuesday, January 31, 2023 5:23:11 AM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 4,406
Belgium
Location: Belgium

Thanks: 249 times
Was thanked: 794 time(s) in 647 post(s)
Originally Posted by: Black Dog Go to Quoted Post
Hi Guru!
I have a GT title with running text (ticker). Text runs none stop. How stop text at end by a script?
I have a way stop running text by time.


By time is not good. If i change speed scrollig text i have to change script (correct letters per second). The time running depends on the speed of the computer itself.
May be any solutions are?
.




the script stops when the time has passed so i dont understand your mentioning text running none stop ( meaning it repeats)
Adapt the formulas on speed of computer too etc, (measure it, is how the initial formula was created )
What is not included in the script is taking into account the length of the ticker space itself for really proper timing. timing is alo dependent on the font and its size used
Find a way to use the speed setting as a variable in the formula.
The post does mention "'It is not full code for use. It is only example to get duration running text"

if you want the text to only pass once , you dont need a script but set the ticker type to replace instead of add

Maybe defining the actual goal would be helpfull.
thanks 1 user thanked doggy for this useful post.
Black Dog on 1/31/2023(UTC)
Black Dog  
#347 Posted : Tuesday, January 31, 2023 5:43:38 AM(UTC)
Black Dog

Rank: Newbie

Groups: Registered
Joined: 4/7/2021(UTC)
Posts: 5
Location: Moscow

Thanks: 3 times
Originally Posted by: doggy Go to Quoted Post

if you want the text to only pass once , you dont need a script but set the ticker type to replace instead of add.

Yes, type to replace. Title does not stop to show. I have to stop title manualy.
So I wrote that script. Script works but one is not nice. No high precision. Doggy is rigth. Precision depends on the font, size, speed ...How close title exactly when the last letter disappeared.,
doggy  
#348 Posted : Tuesday, January 31, 2023 6:58:04 AM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 4,406
Belgium
Location: Belgium

Thanks: 249 times
Was thanked: 794 time(s) in 647 post(s)
Originally Posted by: Black Dog Go to Quoted Post


So I wrote that script.

Based on what?


for really proper time calculation (precision) for text needed to scroll by completely one has to take into account within the calculations:
- the full length of the text used
- Character Width of the font used
- speed settting of the ticker
- the width of the ticker field
- the fps of the production

Using replace makes sence for repeated viewing of text but you have a hard time to get a startign point fo rthe initial text shown for calculating your end time to match your turning off
Users browsing this topic
18 Pages«<161718
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.