Edgemeal, thank you!
I made some minor changes. It works like a charm!
Code:Public Class Form1 Private proc2 As VideoProcess = Nothing Private Property fps As Integer Private Sub Record_Click(sender As System.Object, e As System.EventArgs) Handles Record.Click fps = CInt(Button1.Text) 'this button's text changes from 24 to 30fps proc2 = New VideoProcess(fps) proc2.Start() End Sub End Class
Code:Public Class VideoProcess Inherits Process Dim dir As String = Environment.GetFolderPath(Environment.SpecialFolder.MyVideos) Public Sub New(ByVal fps As Integer) StartInfo.FileName = dir & "\" & "\Captured\ffmpeg.exe" StartInfo.Arguments = String.Format("-f image2pipe -r " & fps & " -i pipe:.bmp -pix_fmt yuv420p -c:v libx264 -crf 18 -g 1 -y -r " & fps & " " & dir & "\Captured\Temp.mp4") StartInfo.UseShellExecute = False StartInfo.WindowStyle = ProcessWindowStyle.Hidden StartInfo.RedirectStandardInput = True StartInfo.RedirectStandardOutput = True StartInfo.CreateNoWindow = True End Sub End Class




Reply With Quote
