How to cut the video?
|
How to cut the video |
Assuming you drag the Movie Maker Timeline Control on form and add two button on form. Change the text of button1 to "Add Video Clips", Change the text of button2 to "Play".
Add following code in Button1 click event. Assume the duration of Video1 is 30 second, now it will start from 20 second and end at 25 second.
private void button1_Click(object sender, EventArgs e) axTimelineControl1.SetScale((float)0.05); string strVideo1 = "C:\\yourfolder\\yourvideo.mpg"; float iVideo1Duration = axTimelineControl1.GetMediaDuration(strVideo1); axTimelineControl1.AddVideoClip(axTimelineControl1.GetVideo1TrackIndex(), strVideo1, 0, 5, 20); axTimelineControl1.AddAudioClip(axTimelineControl1.GetAudio1TrackIndex(), strVideo1, 0, 5, 20, 1); } |
Add following code in Button2 click event. It will preview the video