Split a Large AVI Into Smaller Files (Visual Basic)

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

1.

Start Visual Basic.

2.

Add the LEAD Multi-Media controls to your project.

On the Project pull-down menu, use the Components option, and select the LEAD Multi-Media Library (14).

3.

Select the ltmmConvertCtrl Control, and add it 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 Form’s Load event, and code Form_Load sub as follows:

Private Sub Form_Load()
   'Set The Source File. 
   ltmmConvertCtrl1.SourceFile = "c:\source.avi"
End Sub

6.

Handle the btnConvert1 Click event, and code btnConvert1_Click Sub as follows:

Private Sub btnConvert1_Click()
   ' 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 Sub

7.

Handle the btnConvert2 Click event, and code btnConvert2_Click Sub as follows:

Private Sub btnConvert2_Click()
   '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 Sub

8.

Run your program to test it.