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
321actionvideo  
#1 Posted : Wednesday, May 6, 2020 8:28:04 AM(UTC)
321actionvideo

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.
doggy  
#2 Posted : Wednesday, May 6, 2020 10:00:52 AM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 293 times
Was thanked: 955 time(s) in 790 post(s)
Originally Posted by: 321actionvideo Go to Quoted Post
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)
1Life2Play  
#3 Posted : Sunday, April 18, 2021 2:43:46 PM(UTC)
1Life2Play

Rank: Newbie

Groups: Registered
Joined: 9/6/2020(UTC)
Posts: 5
United States
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?
1Life2Play  
#4 Posted : Sunday, April 18, 2021 2:49:03 PM(UTC)
1Life2Play

Rank: Newbie

Groups: Registered
Joined: 9/6/2020(UTC)
Posts: 5
United States
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.
doggy  
#5 Posted : Sunday, April 18, 2021 3:40:17 PM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 293 times
Was thanked: 955 time(s) in 790 post(s)
Originally Posted by: 1Life2Play Go to Quoted Post
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-input

And do a FileSystem.CopyFile with a new name




1Life2Play  
#6 Posted : Monday, April 19, 2021 8:56:31 AM(UTC)
1Life2Play

Rank: Newbie

Groups: Registered
Joined: 9/6/2020(UTC)
Posts: 5
United States
Location: Parma

Was thanked: 1 time(s) in 1 post(s)
Originally Posted by: doggy Go to Quoted Post


Why not base it on https://www.vmix.com/kno...ding-to-vmix-as-an-input

And do a FileSystem.CopyFile with a new name



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.
1Life2Play  
#7 Posted : Monday, April 19, 2021 10:29:59 AM(UTC)
1Life2Play

Rank: Newbie

Groups: Registered
Joined: 9/6/2020(UTC)
Posts: 5
United States
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

thanks 1 user thanked 1Life2Play for this useful post.
sunkast on 8/18/2021(UTC)
doggy  
#8 Posted : Monday, April 19, 2021 3:57:47 PM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 293 times
Was thanked: 955 time(s) in 790 post(s)
Originally Posted by: 1Life2Play Go to Quoted Post
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 )
Peter1000  
#9 Posted : Thursday, July 1, 2021 4:40:34 PM(UTC)
Peter1000

Rank: Advanced Member

Groups: Registered
Joined: 1/25/2019(UTC)
Posts: 303
Switzerland

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)
Andreas O  
#10 Posted : Tuesday, July 6, 2021 8:29:46 PM(UTC)
Andreas O

Rank: Member

Groups: Registered
Joined: 2/9/2021(UTC)
Posts: 24
Norway
Location: Oslo

Thanks: 2 times
+1, what Peter said
BugviOester  
#11 Posted : Monday, June 12, 2023 11:00:27 PM(UTC)
BugviOester

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.
Users browsing this topic
Guest
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.