Results 1 to 8 of 8

Thread: [RESOLVED] How to pass value from form to custom class? Please help

Threaded View

  1. #3

    Thread Starter
    Fanatic Member Peter Porter's Avatar
    Join Date
    Jul 2013
    Location
    Germany
    Posts
    581

    Resolved Re: How to pass value from form to custom class? Please help

    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
    Last edited by Peter Porter; May 15th, 2015 at 09:16 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width