vMix Forums
»
General
»
General Discussion
»
Script Writing for Screen shots
Rank: Member
Groups: Registered
Joined: 4/24/2020(UTC) Posts: 10 Location: Garden Grove Thanks: 3 times
|
Hello,
could anyone help me be able to write a script that would let me capture a screenshot of each of my video inputs for example (Input Numbers 5-10)?
i have four live shots for example that i want to take a screenshot of them at same timing. could anyone please help? greatly appreciated.
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,226 Location: Belgium Thanks: 293 times Was thanked: 955 time(s) in 790 post(s)
|
Why a script when a multiple (combined) shortcut will do that (SnapshotInput)?
Btw they wont be exactly at the same time (shortcuts or script) as each instruction takes some tie even if it's minimal
input 5-10 does not equates 4 four live shots ;-)
Help to be able to write a script: - Read the helpfiles - check the "scripting for dummies" post - script functions contain the same elements as a shortcut (hint) - just write x lines with the same function but different input specified in your script - run script
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/11/2020(UTC) Posts: 31
Thanks: 4 times
|
Originally Posted by: doggy Why a script when a multiple (combined) shortcut will do that (SnapshotInput)?
Btw they wont be exactly at the same time (shortcuts or script) as each instruction takes some tie even if it's minimal
input 5-10 does not equates 4 four live shots ;-)
Help to be able to write a script: - Read the helpfiles - check the "scripting for dummies" post - script functions contain the same elements as a shortcut (hint) - just write x lines with the same function but different input specified in your script - run script I appreciate the reply but haven't seen anything from the OP, so was wondering if you might be able to enlighten people in a bit more on this. I tried my hand at a script that would automatically: -take a screenshot of *one* input -name it currentcap.png (automatically, with no dialog, which I apparently couldn't get the syntax right) -replace the source on input XX with the clip (or create it as input XX and delete XX+1 to keep things in order) I'm on the fence about the version that allows scripting and time is a factor; might you be able to assist with a shortcut-based option? Or Companion has been useful for workarounds in the past.
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,226 Location: Belgium Thanks: 293 times Was thanked: 955 time(s) in 790 post(s)
|
Originally Posted by: mark2020 I appreciate the reply but haven't seen anything from the OP, so was wondering if you might be able to enlighten people in a bit more on this. I often wonder why one is posting in the first place ;-) Quote: I tried my hand at a script that would automatically: -take a screenshot of *one* input -name it currentcap.png (automatically, with no dialog, which I apparently couldn't get the syntax right) -replace the source on input XX with the clip (or create it as input XX and delete XX+1 to keep things in order)
I'm on the fence about the version that allows scripting and time is a factor; might you be able to assist with a shortcut-based option? Or Companion has been useful for workarounds in the past.
Scripting is available in the 4k and pro licenses! External scripts are also possible (as done before vMix scripting was available or still done) what you want to do can be done with shortcuts alone as you describe it : Snapshot or SnapshotInput and value is the location and filename to save to AddInput specify input type and filename RemoveInput removes a specific input MoveInput moves specific input to specific place SetInputName if you want to change the name being displayed need to be aware that shome shortcuts take a bit of time meaning you can't execute them too quickly on after the other , script can add pause
|
1 user thanked doggy for this useful post.
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/11/2020(UTC) Posts: 31
Thanks: 4 times
|
Originally Posted by: doggy Originally Posted by: mark2020 I appreciate the reply but haven't seen anything from the OP, so was wondering if you might be able to enlighten people in a bit more on this. I often wonder why one is posting in the first place ;-) Quote: I tried my hand at a script that would automatically: -take a screenshot of *one* input -name it currentcap.png (automatically, with no dialog, which I apparently couldn't get the syntax right) -replace the source on input XX with the clip (or create it as input XX and delete XX+1 to keep things in order)
I'm on the fence about the version that allows scripting and time is a factor; might you be able to assist with a shortcut-based option? Or Companion has been useful for workarounds in the past.
Scripting is available in the 4k and pro licenses! External scripts are also possible (as done before vMix scripting was available or still done) what you want to do can be done with shortcuts alone as you describe it : Snapshot or SnapshotInput and value is the location and filename to save to AddInput specify input type and filename RemoveInput removes a specific input MoveInput moves specific input to specific place SetInputName if you want to change the name being displayed need to be aware that shome shortcuts take a bit of time meaning you can't execute them too quickly on after the other , script can add pause Thank you much! I forgot the key final steps, lol - adding the new screenshot into a multiview and previewing it, but I've been using those plenty enough to be familiar. I use MoveInput to cycle media and scenes, but in this case I settled for deleting the last input and the still just re-populates that slot. In total it's 5 commands in Companion - 3 shortcuts and two direct commands. Snapshot, Add and RemoveInput weren't immediately obvious options. But it works as intended! P.S. I meant scripting being in the top option that's remotely in my budget, contracts permitting. :) I'll have to look into external scripts when time permits.
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,226 Location: Belgium Thanks: 293 times Was thanked: 955 time(s) in 790 post(s)
|
Originally Posted by: mark2020 I'll have to look into external scripts when time permits. vMix scripting is basically a more simplified way of making the exact same script in visual studio ( vb.net) with a few added vMix specific related functions vMix scripting does not allow for added functionscalls or subs etc within and vMix specific functions might need to be replaced by httpfunctions or so ..... ( of course one is not limited to coding in vb.net ;-) )
|
|
|
|
Rank: Member
Groups: Registered
Joined: 4/24/2020(UTC) Posts: 10 Location: Garden Grove Thanks: 3 times
|
Originally Posted by: doggy Originally Posted by: mark2020 I'll have to look into external scripts when time permits. vMix scripting is basically a more simplified way of making the exact same script in visual studio ( vb.net) with a few added vMix specific related functions vMix scripting does not allow for added functionscalls or subs etc within and vMix specific functions might need to be replaced by httpfunctions or so ..... ( of course one is not limited to coding in vb.net ;-) ) sorry to ask for help again... thanks in advance. when i used the shortcut i cloned it 5 times to take a snapshot of each liveinput i wanted... but when i check the directory where im saving it, it would only take one snapshot. i think i want to revist the idea of scripting beacuse you can delay (pause) a certain amount of time before you can do the next instruction. can you take a look at this instruction and see what im doing wrong? i want to use snapshotinput because i can choose the input i want to take a snapshot of. function=snapshotinput&input=11, d:\savedsnapshots\{0:dd MMM yyyy- hh-mm-ss tt}.png sleep 1400 function=snapshotinput&input=12, d:\savedsnapshots\{0:dd MMM yyyy- hh-mm-ss tt}.png sleep 1400 function=snapshotinput&input=13, d:\savedsnapshots\{0:dd MMM yyyy- hh-mm-ss tt}.png sleep 1400
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,226 Location: Belgium Thanks: 293 times Was thanked: 955 time(s) in 790 post(s)
|
Originally Posted by: Clint Cruz
sorry to ask for help again... thanks in advance.
There you are, nice to see you back better go with vb.net scripting ( seems SnapShotInput has a little issue otherwise) and give them a different name to ( not just the time code) Code:API.Function("SnapshotInput",Input:="31",Value:="d:\test31{0:dd MMM yyyy- hh-mm-ss tt}.png")
sleep (200)
API.Function("SnapshotInput",Input:="34",Value:="d:\test34{0:dd MMM yyyy- hh-mm-ss tt}.png")
|
1 user thanked doggy for this useful post.
|
|
|
Rank: Member
Groups: Registered
Joined: 4/24/2020(UTC) Posts: 10 Location: Garden Grove Thanks: 3 times
|
Originally Posted by: doggy Originally Posted by: Clint Cruz
sorry to ask for help again... thanks in advance.
There you are, nice to see you back better go with vb.net scripting ( seems SnapShotInput has a little issue otherwise) and give them a different name to ( not just the time code) Code:API.Function("SnapshotInput",Input:="31",Value:="d:\test31{0:dd MMM yyyy- hh-mm-ss tt}.png")
sleep (200)
API.Function("SnapshotInput",Input:="34",Value:="d:\test34{0:dd MMM yyyy- hh-mm-ss tt}.png")
Works Perfectly!!! what i also did was i moved the filename "Test31" after the timestamp, that way it was controlled by the time rather than the file name. thanks so much!!!
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,226 Location: Belgium Thanks: 293 times Was thanked: 955 time(s) in 790 post(s)
|
Originally Posted by: Clint Cruz what i also did was i moved the filename "Test31" after the timestamp, that way it was controlled by the time rather than the file name. thanks so much!!! Whatever works for you :-)
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/14/2018(UTC) Posts: 81 Was thanked: 17 time(s) in 6 post(s)
|
How would you use value from database or field on that input that you want to run screenshot script? Lets say I want to create title images (thumbnails) for YouTube. I do it already with GT Title and database values and manual "Snapshot command". But I have to put filename manually. If I could do it with a script I could create multiple snapshots and save time :D
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,226 Location: Belgium Thanks: 293 times Was thanked: 955 time(s) in 790 post(s)
|
Pull data for a filename from a title input fed by a datasource.
Check scripting for dummies post for how to pull data from a title input.
|
|
|
|
vMix Forums
»
General
»
General Discussion
»
Script Writing for Screen shots
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.
Important Information:
The vMix Forums uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close