Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,516  Location: Belgium Thanks: 318 times Was thanked: 1021 time(s) in 838 post(s)
|
Here is a basic script to rename the (multicorder) video files according their actual creation time issue addressed here https://forums.vmix.com/posts/t3...recording-and-file-namesand here https://forums.vmix.com/posts/t3...ame-for-split-recordingsCode:
Try
Dim filepath as string = "d:\multicordertest\"
Dim filepathnew as string = "d:\multicordertest\renamed\"
' assuming multicorderfiles are saved as mp4 else change extention
Dim dirs As String() = Directory.GetFiles(filepath , "*.mp4")
Dim vidfile As String
For Each vidfile In dirs
Console.WriteLine(vidfile )
' get creation date of video
Dim fileCreatedDate As DateTime = File.GetCreationTime(vidfile )
' create new fileame like dd-mm-yy hh-mm-ss.mp4
Dim CreatedDate as String = fileCreatedDate .Day & "-" & fileCreatedDate .Month & "-" & fileCreatedDate .Year
Dim CreatedTime as String = fileCreatedDate .Hour & "-" & fileCreatedDate .Minute & "-" & fileCreatedDate .Second
Dim newfile as string = CreatedDate + " " + CreatedTime + ".mp4"
Console.WriteLine(filepathnew & newfile)
' rename/move file to new folder
System.IO.File.Move(vidfile, filepathnew & newfile)
Next
Catch e As Exception
Console.WriteLine("The process failed:")
End Try
|
|
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 11/14/2012(UTC) Posts: 353  Location: Finland Thanks: 219 times Was thanked: 23 time(s) in 21 post(s)
|
Is it possible to read the current position of the T-BAR and get the current position (0-255)?
|
|
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/8/2022(UTC) Posts: 154  Thanks: 48 times Was thanked: 3 time(s) in 3 post(s)
|
Script (created with AI) which toggles input in a layer ("layerNumber") on an input ("target input") between defined inputs ("source inputs"). It works with input numbers or input names. Code:
' ==========================================
' SETTINGS
' ==========================================
' Change to your actual input numbers or names
Dim targetInput As String = "1"
Dim layerNumber As Integer = 1
Dim sourceInputs() As String = {"2", "3", "4"}
' ==========================================
Dim xml As String = API.XML()
Dim x As New System.Xml.XmlDocument
x.LoadXml(xml)
' The correct XML path for vMix Dynamic Values is //dynamic/value1
Dim currentIndexNode As System.Xml.XmlNode = x.SelectSingleNode("//dynamic/value1")
Dim currentIndexStr As String = ""
If currentIndexNode IsNot Nothing Then
currentIndexStr = currentIndexNode.InnerText
End If
Dim currentIndex As Integer = 0
' Attempt to convert the saved value to an integer
If Integer.TryParse(currentIndexStr, currentIndex) Then
' Move to the next input in the list
currentIndex = currentIndex + 1
Else
' If the value is empty (e.g., the very first time the script runs)
currentIndex = 0
End If
' If we have reached the end of the list, start over from zero
If currentIndex >= sourceInputs.Length Then
currentIndex = 0
End If
' Get the name/number of the next input from the list
Dim nextInput As String = sourceInputs(currentIndex)
' Print info in the vMix Scripting log for troubleshooting
Console.WriteLine("Found saved index: " & currentIndexStr)
Console.WriteLine("Changing to index: " & currentIndex & " (Which is Input: " & nextInput & ")")
' Build the SetLayer command and send it to vMix
Dim layerValue As String = layerNumber.ToString() & "," & nextInput
API.Function("SetLayer", Input:=targetInput, Value:=layerValue)
' Save the new index so vMix remembers it for the NEXT time the script is executed
API.Function("SetDynamicValue1", Value:=currentIndex.ToString())
|
|
|
|
|
|
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