Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Monday, August 30, 2010 8:34:51 AM(UTC)

jigar  
Guest

Groups: Guests
Posts: 3,049

Was thanked: 1 time(s) in 1 post(s)

The C# code below will convert an AVI file to a MP4 file.  It compresses the video to H264, and the audio to AAC.

You will first need to add the ConvertCtrl to the toolbox.  To do that in Visual Studio, click Tools > Choose Toolbox Items.  Browse to "C:\Program Files\LEAD Technologies\LEADTOOLS Multimedia 17\Bin\Dotnet\Win32 folder" and select Leadtools.Multimedia.dll.  Click OK and you should see the ConvertCtrl in the list of items, and it should be checked.  Close the Choose Toolbox Items dialog by pressing OK.  Now from the toolbox select the ConvertCtrl and draw it on the form.  Once you do that, switch to code view and copy this code.
convertCtrl1.SourceFile = @"C:\Input.avi";
convertCtrl1.VideoCompressors.H264.Selected = true;
convertCtrl1.AudioCompressors.AAC.Selected = true;
convertCtrl1.TargetFormat = TargetFormatType.ISO;
convertCtrl1.TargetFile = @"C:\Output.mp4";
convertCtrl1.StartConvert();
You can change the SourceFile to an actual file that you would like to convert.  It can be any valid file that is playable in Windows Media Player.
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

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.

Powered by YAF.NET | YAF.NET © 2003-2017, Yet Another Forum.NET
This page was generated in 0.109 seconds.