Movie Maker Timeline SDK Control

Movie Maker Timeline SDK Control

Platform : Windows 10, Windows 8, Vista, Windows 7, XP

Video Editor SDK that allows users Drag & Drop to arrange clip orders, edit movies, apply effects & transitions with C++ , C#, VB.net , VB, Delphi, VFP, MS Access. 

Popular Solution Go   Back

C# - How to combine videos to H.264 MP4 file

Step 1: To install the Movie Maker Timeline SDK Control, begin by launching the setup file (http://www.viscomsoft.com/demo/moviemakersetup.exe). Select the desired installation folder for the Movie Maker Timeline SDK Control and continue with the installation on your development computer.

Step 2: Create New Visual C# Project, select Windows Forms Application.

Step 3: In Solution Explorer, select References ,right click mouse to select Add Reference... 

Select COM tab, select  Movie Maker Timeline Control SDK

Step 4: Now you will see the Movie Maker Timeline Control on Toolbox,  Drag the Movie Maker Timeline Control from Toolbox to form.



Step 5: Next add two button, progress bar control, openfiledialog and savefiledialog on form.

Step 6: add the following code in Form load event, Zoom out to timeline, let us see more video clips in same time.

 axTimelineControl1.SetScale(0.01f);

Step 7: add the following code in Add Clip button click event, let us add the video to timeline

 openFileDialog1.Filter = "All Files (*.*)|*.*|mpg (*.mpg*.vob) | *.mpg;*.vob|avi (*.avi) | *.avi|Divx (*.divx) | *.divx|wmv (*.wmv)| *.wmv|QuickTime (*.mov)| *.mov|MP4 (*.mp4) | *.mp4|WebM (*.webm) | *.webm|FLV (*.flv) | *.flv|MKV (*.mkv) | *.mkv|AVCHD (*.m2ts*.ts*.mts*m2t)|*.m2ts;*.ts;*.mts;*.m2t||";

              if (openFileDialog1.ShowDialog() == DialogResult.OK)

              {

                  short iResultClipIndex;

  float idur = axTimelineControl1.GetMediaDuration(openFileDialog1.FileName);

                  iResultClipIndex = (short)axTimelineControl1.AddVideoClip(1, openFileDialog1.FileName, 0, idur, 0, 0);

                  iResultClipIndex = (short)axTimelineControl1.AddAudioClip(5, openFileDialog1.FileName, 0, idur, 0, 1);

              }

Step 8: add the following code in Save to MP4 button click event, let us setup the MP4 file setting and output MP4 video.

    string strFilter = "MP4 File (*.mp4)|*.mp4||";
            axTimelineControl1.SetVideoTrackResolution (1280,720);
            axTimelineControl1.OutputType=2;
            axTimelineControl1.MP4AspectRatio =1;
            axTimelineControl1.MP4AudioBitrate =96000;
            axTimelineControl1.MP4AudioChannels = 2;
            axTimelineControl1.MP4AudioSampleRate = 44100;
            axTimelineControl1.MP4Framerate = 25;
            axTimelineControl1.MP4H264Preset = 0;
            axTimelineControl1.MP4Height = 720;
            axTimelineControl1.MP4Width = 1280;
            axTimelineControl1.MP4VideoBitrate = 3000000;
            if (saveFileDialog1.ShowDialog() == DialogResult.OK)
            {
                int iresult = axTimelineControl1.Save(saveFileDialog1.FileName);
            }
Step 9: Select the movie maker timeline control on form, select Properties...  Select the Events Tab, double click at OnConvertProgress to add the Handler.
  
Step 10: add the following code on OnConvertProgress

 private void axTimelineControl1_OnConvertProgress(object sender, AxTimelineAxLib._ITimelineControlEvents_OnConvertProgressEvent e)
        {
            progressBar1.Value = e.progress;
        }

Step 11: Select the movie maker timeline control on form, select Properties...  Select the Events Tab, double click at OnConvertCompleted to add the Handler.


Step 12: add the following code on OnConvertCompleted

  private void axTimelineControl1_OnConvertCompleted(object sender, EventArgs e)
        {
            MessageBox.Show("Convert Completed");
        }

Step 13. Now run the project, click Add Clip button to add the video to timeline. To add another video, just repeat the process.
Click Save to MP4 button, it will combine videos and output H.264 MP4 video.