Split a Large AVI Into Smaller Files (Delphi 6.0)

The following steps will split a large AVI into two smaller files.

1.

Start Delphi 6.

2.

If you didn’t install LEAD Multi-Media controls before, install them.

On the Component pull-down menu, use the Import ActiveX Control… and select the LEAD Multi-Media Library (14), and Press install, and then compile and install the package dclusr.dpk.

3.

From the ActiveX controls tab; add the ltmmConvertCtrl to your form.

4.

Add 2 button controls to your control, and name them as follows:

 

Name

Caption

 

btnConvert1

Convert First Half

 

btnConvert2

Convert Second Half

5.

Handle the Form1 OnCreate event, and code FormCreate procedure as follows:

   procedure TForm1.FormCreate(Sender: TObject); 
   begin
    // Set The Source File. 
   ltmmConvertCtrl1.SourceFile:= 'c:\source.avi'; 
   end; 

6.

Handle the btnConvert1 OnClick event, and code btnConvert1Click procedure as follows:

procedure TForm1.btnConvert1Click(Sender: TObject); 
begin
  // Set the Taget or Output file. 
 ltmmConvertCtrl1.TargetFile:= 'c:\Avi1.avi'; 
   // Set the end position of the first part. 
 ltmmConvertCtrl1.SelectionEnd:= ltmmConvertCtrl1.Duration /2; 
 // Convert it Now. 
   ltmmConvertCtrl1.StartConvert ( ); 
end;

7.

Handle the btnConvert2 OnClick event, and code btnConvert2Click procedure as follows:

 procedure TForm1.btnConvert2Click(Sender: TObject); 
begin
 // Set the Taget or Output file. 
 ltmmConvertCtrl1.TargetFile:= 'c:\Avi2.avi'; 
   // Set the Start position of the second part. 
 ltmmConvertCtrl1.SelectionStart:= ltmmConvertCtrl1.Duration /2; 
 // Set the End position of the second part. 
 ltmmConvertCtrl1.SelectionEnd:= ltmmConvertCtrl1.Duration
 // Convert it Now. 
 ltmmConvertCtrl1.StartConvert ( ); 
end; 

8.

Run your program to test it.