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 add Picture In Picture effect ?

 

Step 1: To install the Movie Maker Timeline Control SDK, begin by launching the setup file (http://www.viscomsoft.com/demo/moviemakersetup.exe). Select the desired installation folder for the Movie Maker TImeline 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 3: Now you will see the Movie Maker Timeline Control on Toolbox,  Drag the Movie Maker Timeline Control from Toolbox to form.
and add four buttons on form. Change the text of button to "add video 1", "add video 2", "add pic in pic" ,"preview" and add a picture box on form.

Step 4: Add the following to the top of the coding window:

int _iVideoWidth;
int _iVideoHeight;

public Form1()

{

  InitializeComponent();

}

Step 5: Add following code in Button1 click event.

private void button1_Click(object sender, EventArgs e)
{
 string strVideo1 = "c:\yourfolder\yourvideo1.mp4";

 float iVideo1Duration = axTimelineControl1.GetMediaDuration(strVideo1);

_iVideoWidth = axTimelineControl1.GetMediaWidth(strVideo1);
_iVideoHeight = axTimelineControl1.GetMediaHeight(strVideo1);

 axTimelineControl1.AddVideoClip(axTimelineControl1.GetVideo1TrackIndex(), strVideo1, 0, iVideo1Duration, 0,0);

 axTimelineControl1.AddAudioClip(axTimelineControl1.GetAudio1TrackIndex(), strVideo1, 0, iVideo1Duration, 0, 1);

Step 6: Add following code in Button2 click event.

private void button2_Click(object sender, EventArgs e)

{

      axTimelineControl1.SetTrackVisible(axTimelineControl1.GetVideo2TrackIndex(), 1);

      axTimelineControl1.SetTrackVisible(axTimelineControl1.GetAudio2TrackIndex(), 1);

      string strVideo2 = "c:\yourfolder\yourvideo2.mp4"; 

      float iVideo2Duration = axTimelineControl1.GetMediaDuration(strVideo2); 

      axTimelineControl1.AddVideoClip(axTimelineControl1.GetVideo2TrackIndex(), strVideo2, 0, iVideo2Duration, 0, 0); 

      axTimelineControl1.AddAudioClip(axTimelineControl1.GetAudio2TrackIndex(), strVideo2, 0, iVideo2Duration, 0, 1);

}

Step 7: Add following code in Button3 click event. It will set Picture in Picture effect for 30 seconds. Set mediaTrack to 2, it means use Video track 1 and Video track 2 for Picture in Picture effect.

private void button3_Click(object sender, EventArgs e)
{
    axTimelineControl1.SetPicinPicParam(0, 0, 160, 120);

    axTimelineControl1.AddTransition(axTimelineControl1.GetTransitionTrackIndex(), "Pic in Pic", 0,30, "", 2, 0);

 

}

Step 8: Add following code in Form load event.

private void Form1_Load(object sender, EventArgs e)
{
    axTimelineControl1.SetPreviewWnd((int)pictureBox1.Handle);

}


Step 9: Add following code in Button4 click event. It will preview the timeline.

private void button4_Click(object sender, EventArgs e)
{
   axTimelineControl1.SetVideoTrackResolution(_iVideoWidth, _iVideoHeight);  

   axTimelineControl1.Play();    

}

 

Now you can run the sample and click the add video1, add video 2, add pic in pic and preview button to play the timeline. Make sure you changed to correct path of strVideo1 and strVideo2 first.

Download this sample source code