logo

Live Production Software Forums


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

Notification

Icon
Error

26 Pages«<1617181920>»
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: 5,220
Belgium
Location: Belgium

Thanks: 291 times
Was thanked: 953 time(s) in 788 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: 72
Italy

Thanks: 8 times
Was thanked: 9 time(s) in 7 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: 166
Location: NL

Thanks: 164 times
Was thanked: 19 time(s) in 16 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.
thanks 1 user thanked Ario for this useful post.
nikosman88 on 2/4/2023(UTC)
doggy  
#344 Posted : Friday, January 27, 2023 6:49:28 AM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 291 times
Was thanked: 953 time(s) in 788 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: 5,220
Belgium
Location: Belgium

Thanks: 291 times
Was thanked: 953 time(s) in 788 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: 5,220
Belgium
Location: Belgium

Thanks: 291 times
Was thanked: 953 time(s) in 788 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
Denis Dyachenko  
#349 Posted : Thursday, February 9, 2023 5:22:27 PM(UTC)
Denis Dyachenko

Rank: Newbie

Groups: Registered
Joined: 2/9/2023(UTC)
Posts: 3
Ukraine

Thanks: 2 times
Hello!
Please tell me, how can i get parameter panX from api into {dim PX as string = ""}: for example

<input key="4953d13b-4bd1-44a9-a7f3-a3b4e9e8f45f" number="17" type="GT" title="COUNTDOWN" shortTitle="COUNTDOWN" state="Paused" position="0" duration="0" loop="False" selectedIndex="0">COUNTDOWN<position panX="0.35" zoomX="1.35" zoomY="1.35" /><text index="0" name="Time.Text">00:00</text></input>

?
doggy  
#350 Posted : Thursday, February 9, 2023 7:55:29 PM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 291 times
Was thanked: 953 time(s) in 788 post(s)
Originally Posted by: Denis Dyachenko Go to Quoted Post
Hello!
Please tell me, how can i get parameter panX from api into {dim PX as string = ""}: for example

<input key="4953d13b-4bd1-44a9-a7f3-a3b4e9e8f45f" number="17" type="GT" title="COUNTDOWN" shortTitle="COUNTDOWN" state="Paused" position="0" duration="0" loop="False" selectedIndex="0">COUNTDOWN<position panX="0.35" zoomX="1.35" zoomY="1.35" /><text index="0" name="Time.Text">00:00</text></input>

?


By using the Proper Xpath in reading the API XML file ( see one of the multiple script examples in the post that read the XML to get the info )




Code:
dim PX as string = (x.SelectSingleNode("//input[@number='17']//position/@panX").InnerText)


for

Code:
<input key="4953d13b-4bd1-44a9-a7f3-a3b4e9e8f45f" number="17" type="GT" title="COUNTDOWN" shortTitle="COUNTDOWN" state="Paused" position="0" duration="0" loop="False" selectedIndex="0">COUNTDOWN
  <position panX="0.35" zoomX="1.35" zoomY="1.35" />
  <text index="0" name="Time.Text">00:00</text>
</input>

thanks 1 user thanked doggy for this useful post.
Denis Dyachenko on 2/9/2023(UTC)
Denis Dyachenko  
#351 Posted : Thursday, February 9, 2023 9:49:50 PM(UTC)
Denis Dyachenko

Rank: Newbie

Groups: Registered
Joined: 2/9/2023(UTC)
Posts: 3
Ukraine

Thanks: 2 times
Originally Posted by: doggy Go to Quoted Post
Originally Posted by: Denis Dyachenko Go to Quoted Post
Hello!
Please tell me, how can i get parameter panX from api into {dim PX as string = ""}: for example

<input key="4953d13b-4bd1-44a9-a7f3-a3b4e9e8f45f" number="17" type="GT" title="COUNTDOWN" shortTitle="COUNTDOWN" state="Paused" position="0" duration="0" loop="False" selectedIndex="0">COUNTDOWN<position panX="0.35" zoomX="1.35" zoomY="1.35" /><text index="0" name="Time.Text">00:00</text></input>

?


By using the Proper Xpath in reading the API XML file ( see one of the multiple script examples in the post that read the XML to get the info )




Code:
dim PX as string = (x.SelectSingleNode("//input[@number='17']//position/@panX").InnerText)




IT WORKS!

(i get PX is equal "0.35")

now how can i increase or decrease it by "0.1" mathematically? i must convert it?
doggy  
#352 Posted : Thursday, February 9, 2023 10:05:23 PM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 291 times
Was thanked: 953 time(s) in 788 post(s)
Originally Posted by: Denis Dyachenko Go to Quoted Post
Originally Posted by: doggy Go to Quoted Post
Originally Posted by: Denis Dyachenko Go to Quoted Post
Hello!
Please tell me, how can i get parameter panX from api into {dim PX as string = ""}: for example

<input key="4953d13b-4bd1-44a9-a7f3-a3b4e9e8f45f" number="17" type="GT" title="COUNTDOWN" shortTitle="COUNTDOWN" state="Paused" position="0" duration="0" loop="False" selectedIndex="0">COUNTDOWN<position panX="0.35" zoomX="1.35" zoomY="1.35" /><text index="0" name="Time.Text">00:00</text></input>

?


By using the Proper Xpath in reading the API XML file ( see one of the multiple script examples in the post that read the XML to get the info )




Code:
dim PX as string = (x.SelectSingleNode("//input[@number='17']//position/@panX").InnerText)




IT WORKS!

(i get PX is equal "0.35")

now how can i increase or decrease it by "0.1" mathematically? i must convert it?


yes as it is a string

Denis Dyachenko  
#353 Posted : Thursday, February 9, 2023 10:22:50 PM(UTC)
Denis Dyachenko

Rank: Newbie

Groups: Registered
Joined: 2/9/2023(UTC)
Posts: 3
Ukraine

Thanks: 2 times
Originally Posted by: doggy Go to Quoted Post
Originally Posted by: Denis Dyachenko Go to Quoted Post
Originally Posted by: doggy Go to Quoted Post
Originally Posted by: Denis Dyachenko Go to Quoted Post
Hello!
Please tell me, how can i get parameter panX from api into {dim PX as string = ""}: for example

<input key="4953d13b-4bd1-44a9-a7f3-a3b4e9e8f45f" number="17" type="GT" title="COUNTDOWN" shortTitle="COUNTDOWN" state="Paused" position="0" duration="0" loop="False" selectedIndex="0">COUNTDOWN<position panX="0.35" zoomX="1.35" zoomY="1.35" /><text index="0" name="Time.Text">00:00</text></input>

?


By using the Proper Xpath in reading the API XML file ( see one of the multiple script examples in the post that read the XML to get the info )




Code:
dim PX as string = (x.SelectSingleNode("//input[@number='17']//position/@panX").InnerText)




IT WORKS!

(i get PX is equal "0.35")

now how can i increase or decrease it by "0.1" mathematically? i must convert it?


yes as it is a string



PlaceX = (x.SelectSingleNode("//input[@title='"& IName &"']/position/@panX").Value)
Console.WriteLine("panX:"+PlaceX)
dim PX as Double
PX = CDbl(PlaceX) ' Line 14


Error in console (in my language):
panX:0.35
Script 'Move' Error Line 14: Casting the string "0.35" to the type "Double" is invalid.
Stopping Script "Move"

What i do wrong?
doggy  
#354 Posted : Thursday, February 9, 2023 11:29:27 PM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 291 times
Was thanked: 953 time(s) in 788 post(s)
Originally Posted by: Denis Dyachenko Go to Quoted Post


PlaceX = (x.SelectSingleNode("//input[@title='"& IName &"']/position/@panX").Value)
Console.WriteLine("panX:"+PlaceX)
dim PX as Double
PX = CDbl(PlaceX) ' Line 14


Error in console (in my language):
panX:0.35
Script 'Move' Error Line 14: Casting the string "0.35" to the type "Double" is invalid.
Stopping Script "Move"

What i do wrong?


Not enough searching Google like for "vb.net convert string to ...."

and find Double.Parse(PlaceX)
Roy Sinclair  
#355 Posted : Friday, February 10, 2023 1:36:32 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
Originally Posted by: Denis Dyachenko Go to Quoted Post
Hello!
Please tell me, how can i get parameter panX from api into {dim PX as string = ""}: for example

<input key="4953d13b-4bd1-44a9-a7f3-a3b4e9e8f45f" number="17" type="GT" title="COUNTDOWN" shortTitle="COUNTDOWN" state="Paused" position="0" duration="0" loop="False" selectedIndex="0">COUNTDOWN<position panX="0.35" zoomX="1.35" zoomY="1.35" /><text index="0" name="Time.Text">00:00</text></input>

?


By using the Proper Xpath in reading the API XML file ( see one of the multiple script examples in the post that read the XML to get the info )




Code:
dim PX as string = (x.SelectSingleNode("//input[@number='17']//position/@panX").InnerText)


for

Code:
<input key="4953d13b-4bd1-44a9-a7f3-a3b4e9e8f45f" number="17" type="GT" title="COUNTDOWN" shortTitle="COUNTDOWN" state="Paused" position="0" duration="0" loop="False" selectedIndex="0">COUNTDOWN
  <position panX="0.35" zoomX="1.35" zoomY="1.35" />
  <text index="0" name="Time.Text">00:00</text>
</input>



As a HABIT, do not use the Input Number for your scripts. The Input Number can change if you add or remove an input lower than that input number and thus breaking your script. Much better to use the Key field instead which remains the same unless you delete that input and add it back again.


Code:
dim PX as Float = CDbl((x.SelectSingleNode("//input[@key='4953d13b-4bd1-44a9-a7f3-a3b4e9e8f45f']//position/@panX").InnerText))


This snippet also converts your string to a floating point number so you can use it for math operations.


thanks 3 users thanked Roy Sinclair for this useful post.
Denis Dyachenko on 2/10/2023(UTC), doggy on 2/10/2023(UTC), nikosman88 on 2/11/2023(UTC)
nikosman88  
#356 Posted : Saturday, February 11, 2023 8:19:05 AM(UTC)
nikosman88

Rank: Advanced Member

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

Thanks: 118 times
Was thanked: 68 time(s) in 64 post(s)
Hello guys i need some help with this script. Lets say i have in vmix an 1 hour video and with mark in/out points, i mark from 0 to 30 minutes. For some reason the script when the time goes for example to 29.58 doesnt do what i want to do.
If i mark the video from 30 minutes as start and end its actual end, when time left for example 2sec it work ok. Can you help me please? What am i missing here? Thank you

Originally Posted by: doggy Go to Quoted Post
From a recent request/discussion to trigger something BEFORE a video finishes


Code:
' Checking time left of active input
' and do some stuff at certain time remaining

dim position as string = ""
dim duration as string = ""
dim activeinput as string = ""
dim Timeleft as double = 0
dim triggertime as integer = 2000       '2 seconds before end
dim triggerduration as integer = 2000   'fade duration, could be different than trigger

do while true

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

activeinput = (x.SelectSingleNode("//active").InnerText)
duration = (x.SelectSingleNode("//input[@number='"& activeinput &"']/@duration").Value)
position = (x.SelectSingleNode("//input[@number='"& activeinput &"']/@position").Value)

Timeleft= Double.Parse(duration)-Double.Parse(position)

if Timeleft < triggertime  

  API.Function("SetVolumeFade",Input:=activeinput.tostring(),Value:="0," & triggerduration.tostring())
  ' do whatever one wants to do 

end if

sleep(500)
Loop


doggy  
#357 Posted : Saturday, February 11, 2023 9:20:15 AM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 291 times
Was thanked: 953 time(s) in 788 post(s)
Originally Posted by: nikosman88 Go to Quoted Post
Hello guys i need some help with this script. Lets say i have in vmix an 1 hour video and with mark in/out points, i mark from 0 to 30 minutes. For some reason the script when the time goes for example to 29.58 doesnt do what i want to do.
If i mark the video from 30 minutes as start and end its actual end, when time left for example 2sec it work ok. Can you help me please? What am i missing here? Thank you



Totally normal it is not working as you are intending to
It is based on the total duration and current position the video is at in this script. The total duration and positions remains the same even when adding a markIn and markOut point in the video.
Check the API XML to verify this and you will also notice there is now added info (markIn & markOut points data whne set) in the XML giving those positions which you can use to base the script on for the intended purpose or you ignore the info and base the trigger time (triggertime = )to a value similar to a Mark point
nikosman88  
#358 Posted : Saturday, February 11, 2023 7:23:07 PM(UTC)
nikosman88

Rank: Advanced Member

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

Thanks: 118 times
Was thanked: 68 time(s) in 64 post(s)
Originally Posted by: doggy Go to Quoted Post
Originally Posted by: nikosman88 Go to Quoted Post
Hello guys i need some help with this script. Lets say i have in vmix an 1 hour video and with mark in/out points, i mark from 0 to 30 minutes. For some reason the script when the time goes for example to 29.58 doesnt do what i want to do.
If i mark the video from 30 minutes as start and end its actual end, when time left for example 2sec it work ok. Can you help me please? What am i missing here? Thank you



Totally normal it is not working as you are intending to
It is based on the total duration and current position the video is at in this script. The total duration and positions remains the same even when adding a markIn and markOut point in the video.
Check the API XML to verify this and you will also notice there is now added info (markIn & markOut points data whne set) in the XML giving those positions which you can use to base the script on for the intended purpose or you ignore the info and base the trigger time (triggertime = )to a value similar to a Mark point


Thank you you`re right. It does the way you say. After a lot of tries and searching on how to make the command
markout = (x.SelectSingleNode("//input[@number='"& activeinput &"']/@markout").Value) to work and without success i discovered the great tool called ffmpeg!!! With this in some seconds video can split without re-enconding! So problem solved! It can even do the job with a script inside vmix! Im impressed!!
doggy  
#359 Posted : Saturday, February 11, 2023 7:57:49 PM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 291 times
Was thanked: 953 time(s) in 788 post(s)
Originally Posted by: nikosman88 Go to Quoted Post
Originally Posted by: doggy Go to Quoted Post
Originally Posted by: nikosman88 Go to Quoted Post
Hello guys i need some help with this script. Lets say i have in vmix an 1 hour video and with mark in/out points, i mark from 0 to 30 minutes. For some reason the script when the time goes for example to 29.58 doesnt do what i want to do.
If i mark the video from 30 minutes as start and end its actual end, when time left for example 2sec it work ok. Can you help me please? What am i missing here? Thank you



Totally normal it is not working as you are intending to
It is based on the total duration and current position the video is at in this script. The total duration and positions remains the same even when adding a markIn and markOut point in the video.
Check the API XML to verify this and you will also notice there is now added info (markIn & markOut points data whne set) in the XML giving those positions which you can use to base the script on for the intended purpose or you ignore the info and base the trigger time (triggertime = )to a value similar to a Mark point


Thank you you`re right. It does the way you say. After a lot of tries and searching on how to make the command
markout = (x.SelectSingleNode("//input[@number='"& activeinput &"']/@markout").Value) to work and without success i discovered the great tool called ffmpeg!!! With this in some seconds video can split without re-enconding! So problem solved! It can even do the job with a script inside vmix! Im impressed!!


Maybe in return you could explain for others why it was without succes ( for one scripts often needs error trapping , like in this case if an input has no markout value looking for it will return in an error (you need to catch) or simply an error in logic.
Using ffmpeg is very powerfull to manipulate videos, again sharing your process could benefit others especially if one relies often on solutions from others in these posts
nikosman88  
#360 Posted : Saturday, February 11, 2023 8:53:31 PM(UTC)
nikosman88

Rank: Advanced Member

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

Thanks: 118 times
Was thanked: 68 time(s) in 64 post(s)
Originally Posted by: doggy Go to Quoted Post
Originally Posted by: nikosman88 Go to Quoted Post
Originally Posted by: doggy Go to Quoted Post
Originally Posted by: nikosman88 Go to Quoted Post
Hello guys i need some help with this script. Lets say i have in vmix an 1 hour video and with mark in/out points, i mark from 0 to 30 minutes. For some reason the script when the time goes for example to 29.58 doesnt do what i want to do.
If i mark the video from 30 minutes as start and end its actual end, when time left for example 2sec it work ok. Can you help me please? What am i missing here? Thank you



Totally normal it is not working as you are intending to
It is based on the total duration and current position the video is at in this script. The total duration and positions remains the same even when adding a markIn and markOut point in the video.
Check the API XML to verify this and you will also notice there is now added info (markIn & markOut points data whne set) in the XML giving those positions which you can use to base the script on for the intended purpose or you ignore the info and base the trigger time (triggertime = )to a value similar to a Mark point


Thank you you`re right. It does the way you say. After a lot of tries and searching on how to make the command
markout = (x.SelectSingleNode("//input[@number='"& activeinput &"']/@markout").Value) to work and without success i discovered the great tool called ffmpeg!!! With this in some seconds video can split without re-enconding! So problem solved! It can even do the job with a script inside vmix! Im impressed!!


Maybe in return you could explain for others why it was without succes ( for one scripts often needs error trapping , like in this case if an input has no markout value looking for it will return in an error (you need to catch) or simply an error in logic.
Using ffmpeg is very powerfull to manipulate videos, again sharing your process could benefit others especially if one relies often on solutions from others in these posts


Ok im not script guru so i am trying to combine things from "here" and "there".. Try not to laugh :p with my logic i do the things
At first i add
dim markout as string = ""
then i add the line that reads markout as first line after activeinput and the script doesnt start. it says object line error. Then i put this line after position line and script start but not work. Then i tried Timeleft= Double.Parse(duration)-Double.Parse(position) to change to Timeleft= Double.Parse(duration)-Double.Parse(markout) or Timeleft= Double.Parse(position)-Double.Parse(markout) some combinations here,dont work
Then i see to xml manually the total time of video (that of course will need to change every time because not all videos are have to be split for example 30minutes exactly) so for the specific video that said markout=1900340 and i wanted to do the "script thing" 8sec before it reaches the markout point to change the triggertime. As value in triggertime i tried to do some mathematical actions and put the result actual duration - markout duration -8sec.. Of course it didnt work and if i have for every video that i need something to do before it ends,to take the calculator, i prefer to do edit real editing in premiere. That`s the way i tried and search..
Users browsing this topic
Guest
26 Pages«<1617181920>»
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.