Code example (Function/call) for those who are unsure

Aug 30, 2010 at 1:16 PM

As the example code on the front page is for the older build i thought id postthe code im using witht he new build for other users to look at who might be stuck.

You need:

1 label (YourStatusLable)

1 progress bar (YourProgressBar)

And the button/trigger

Add a referance tothe fflib.dll and copy the resource folder formt he source code to you exe's location.


Then add this code:

    Public WithEvents newcoder As New FFLib.Encoder

#Region "FF Wrapper Main workings"
    Private Sub ConOut(ByVal prog As String, ByVal tl As String) Handles newcoder.Progress
        YourProgressBar.Value = prog
    End Sub
    Private Sub stat(ByVal status) Handles newcoder.Status
        YourStatusLable.Text = status
    End Sub

    Sub convgo(ByVal inputfile As String, ByVal outputdir As String)
        newcoder.OverWrite = False
        newcoder.SourceFile = inputfile
        newcoder.Format = newcoder.Format_Matroska
        newcoder.AudioCodec = newcoder.AudioCodec_Copy
        newcoder.Video_Codec = newcoder.Vcodec_h264
        newcoder.Threads = 2
        newcoder.OverWrite = True
        newcoder.ConstantRateFactor = 17
        newcoder.RateControl = newcoder.RateControl_CRF
        newcoder.Libx264_Preset_pass1 = newcoder.libx264_default
        newcoder.OutputPath = outputdir
    End Sub
#End Region

And on the button/trigger add this:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim inf As String = "C:\A.flv" ''THE INPUT FILES LOCATION Dim outf As String = "C:\Finished\" ''THE FOLDER TO SAVE THE NEW FILE TO convgo(inf, outf) ''CALL TOT HE FUNCTION PASSING THE IN AND OUT FILE/LOCATION TO IT End Sub