vMix Forums
»
General
»
Feature Requests
»
API Shortcut to modify record Filename
Rank: Advanced Member
Groups: Registered
Joined: 11/17/2015(UTC) Posts: 34
Was thanked: 2 time(s) in 2 post(s)
|
I would like to suggest that there be a way to modify the recorded filename using API call. The way I would do this, is I would create a program to capture text from one or more text fields in an overlay, such as entry number and name. Then I could create a shortcut to save the file as that name that is on the overlay - with timestamp. Then each time I change the overlay, it would automatically stop recording, and start a new one with the next name on the overlay.
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,218 Location: Belgium Thanks: 291 times Was thanked: 955 time(s) in 790 post(s)
|
Originally Posted by: 321actionvideo I would like to suggest that there be a way to modify the recorded filename using API call. The way I would do this, is I would create a program to capture text from one or more text fields in an overlay, such as entry number and name. Then I could create a shortcut to save the file as that name that is on the overlay - with timestamp. Then each time I change the overlay, it would automatically stop recording, and start a new one with the next name on the overlay. This has been asked a few times in the past ! On the other hand is easy enough to write your program (or just a script) to rename that just saved file to what's in your textfield or wherever it comes from . Have been doing something similar like this for years now for literally thousands of clips Would not advice to let it respond to a change in your text field in case you took the wrong name or something (trust me on this)
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 9/6/2020(UTC) Posts: 5 Location: Parma Was thanked: 1 time(s) in 1 post(s)
|
Tried writing a script to do just that (rename the just saved file) but apparently vMix doesn't allow use of the Set argument. Anyone know of the work around to rename a file within ve.net? I've worked out how to isolate the current recording name in this example Code:
dim xml as string = API.XML()
dim x as new system.xml.xmldocument
x.loadxml(xml)
dim name as string
name = (x.SelectSingleNode("//recording/@filename1").Value)
console.writeline(name)
But as you can see, the above only writes my new var console. I want to use Set to change that file since now I have an immediate way find it based on the time stamp. This would be so much better if vMix removed the filename1 as an attribute of recording and made it a value element. I see it in the xml file and the function already exist to start and stop recording. So it seems logical is that it would only take the attribute to element change to allow for an api call to eliminate all this extra to begin with. But if that for some reason isn't possible then the other option would have to be open up the use of the Set argument with the scripting tool of vMix. Anyone been able to find any other solutions or something I'm missing?
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 9/6/2020(UTC) Posts: 5 Location: Parma Was thanked: 1 time(s) in 1 post(s)
|
Also I wanted to add that I cannot find a local save of the XML() file that the API pulls. I'm limited to only calling it through the url scripting and flip of it's same use within vb.net for the scripting tool. If I was able to save the XML() file myself since I can write the entirety to a string, I could call it (or even mapped) it in Excel and complete my VB scripting there. In Excel I would use a column that uses a =ren"<xml()reference>" and then another column with my newFileName and run a VBScript that would write a bat file with the two columns merged.
BUT ALAS! If I had the Set argument I wouldn't need this....or maybe I would.
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,218 Location: Belgium Thanks: 291 times Was thanked: 955 time(s) in 790 post(s)
|
Originally Posted by: 1Life2Play Tried writing a script to do just that (rename the just saved file) but apparently vMix doesn't allow use of the Set argument. Anyone know of the work around to rename a file within ve.net? I've worked out how to isolate the current recording name in this example Code:
dim xml as string = API.XML()
dim x as new system.xml.xmldocument
x.loadxml(xml)
dim name as string
name = (x.SelectSingleNode("//recording/@filename1").Value)
console.writeline(name)
But as you can see, the above only writes my new var console. I want to use Set to change that file since now I have an immediate way find it based on the time stamp. This would be so much better if vMix removed the filename1 as an attribute of recording and made it a value element. I see it in the xml file and the function already exist to start and stop recording. So it seems logical is that it would only take the attribute to element change to allow for an api call to eliminate all this extra to begin with. But if that for some reason isn't possible then the other option would have to be open up the use of the Set argument with the scripting tool of vMix. Anyone been able to find any other solutions or something I'm missing? Why not base it on https://www.vmix.com/kno...ding-to-vmix-as-an-inputAnd do a FileSystem.CopyFile with a new name
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 9/6/2020(UTC) Posts: 5 Location: Parma Was thanked: 1 time(s) in 1 post(s)
|
Originally Posted by: doggy Because I cannot declare a FileSystemObject without using 'Set'. Is there another way, I'm not sure of to use CopyFile. You're right, the process to find the latest file does indeed work better than my method, but it still leads to the same results. I can load it to vMix or not, but ultimate, both lead to knowing the file and it's location. vMix internal scripting stops at the point in the process we need to rename it or copy it somewhere else with a different name.
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 9/6/2020(UTC) Posts: 5 Location: Parma Was thanked: 1 time(s) in 1 post(s)
|
So here is the solution. It will make a copy of the latest file in the default folder (I will make an example later for referencing a folder that's not the default folder). Further, the example is for use in a competition where you want the new title to be based on Player 1 vs Player 2, but you can configure title any way you like based on values from your Title Inputs. I will continue to poste updated examples as I refine this script and process. Code:
Dim szExt As String = ".mp4"
Dim szFolder As String = System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments) & "\vmixstorage"
Dim szLatestFile As String = ""
Dim dLatestFile As Date = Nothing
dim SetTitle as string = Input.Find("YOURINPUTTITLE").Text("player 1.Text")
dim SetTitle2 as string = Input.Find("YOURINPUTTITLE").Text("player 2.Text")
dim CurrentTitle as string = SetTitle & " vs " & SetTitle2
Dim newName As String = szFolder & "\" & CurrentTitle & ".mp4"
For Each szFile As String In System.IO.Directory.GetFiles(szFolder)
Dim fi As New System.IO.FileInfo(szFile)
If fi.Extension = szExt Then
If fi.LastWriteTime > dLatestFile Then
szLatestFile = szFile
dLatestFile = fi.LastWriteTime
End If
End If
Next
If System.IO.File.Exists(szLatestFile) Then
File.Move(szLatestFile, newName)
console.writeline(newName & " has been saved")
End If
|
1 user thanked 1Life2Play for this useful post.
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,218 Location: Belgium Thanks: 291 times Was thanked: 955 time(s) in 790 post(s)
|
Originally Posted by: 1Life2Play So here is the solution. It will make a copy of the latest file in the default folder (I will make an example later for referencing a folder that's not the default folder).
To make your life easier you can pull the recording folder and filename set in the recording options from the vMix user.config file located @ C:\Users\yourcomputer\AppData\Local\StudioCoast_Pty_Ltd (folder changes per version number). Also helps the script to search for the right recording instead of just based on the latest recorded one being actually a vMix recording Build in a check that the recording itself is actually finished before your rename it Also make sure you have duplicated filename check in place or add sequential number in case of when renaming. It's a real PITA if you have to look through thousands of clips for the original in case of a mishap , you bet it's going to happen (is why a renamed copy is better than just a rename )
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 1/25/2019(UTC) Posts: 302 Thanks: 17 times Was thanked: 79 time(s) in 60 post(s)
|
+1 for changing recording filename per API (i know that i can change a filename of an existing recording via script)
|
|
|
|
Rank: Member
Groups: Registered
Joined: 2/9/2021(UTC) Posts: 24 Location: Oslo Thanks: 2 times
|
|
|
|
|
Rank: Member
Groups: Registered
Joined: 5/19/2018(UTC) Posts: 12 Location: Faroe Islands/Poland
Was thanked: 8 time(s) in 4 post(s)
|
+1 for changing recording filename per API. Not while recording, only before recording is started.
|
|
|
|
vMix Forums
»
General
»
Feature Requests
»
API Shortcut to modify record Filename
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