Skip to content
Peter Gill edited this page Feb 17, 2019 · 11 revisions

To convert a video to a x264 video file you can use code similar to the code shown below.

This example requires mencoder.exe to be in the same working directory as your program.

C Sharp

public static void Main (string[] args)
{
    LibMPlayerCommon.Mencoder a = new LibMPlayerCommon.Mencoder();
    a.Convert2X264(@"\\The\Path\To\The\Video\To\Convert", @"\\The\New\Video\Path.mp4");
    a.ConversionComplete+=new LibMPlayerCommon.MplayerEventHandler(a_ConversionComplete);
}
private void a_ConversionComplete(object sender, LibMPlayerCommon.MplayerEvent e) 
{
    System.Console.WriteLine("Video Converted");
}

VB

Public Shared Sub Main(args As String())

	Dim a As New LibMPlayerCommon.Mencoder()
	a.Convert2X264("\\The\Path\To\The\Video\To\Convert", "\\The\New\Video\Path.mp4")

     AddHandler a.ConversionComplete, New LibMPlayerCommon.MplayerEventHandler(AddressOf a_ConversionComplete) 


End Sub

Private Sub a_ConversionComplete(sender As Object, e As LibMPlayerCommon.MplayerEvent)
	System.Console.WriteLine("Video Converted")
End Sub
Clone this wiki locally