LEADTOOLS Support
Multimedia
Multimedia SDK Examples
CODETIP: Convert an AVI file to MP4 file using Multimedia .NET v17.
This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Monday, August 30, 2010 8:29:51 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 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.
LEADTOOLS Support
Multimedia
Multimedia SDK Examples
CODETIP: Convert an AVI file to MP4 file using Multimedia .NET v17.
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.