Related products: Video Edit SDK .Net

Transition between 2 video fragments in Video Edit SDK .Net

In this article we adding simple transition between 2 video files (parts of them).

1. Add 2 video fragments from 2 video files, each 5 seconds (5000 ms) long. 

First fragment located in first 5 seconds on timeline, seconds fragment located between 4 and 9 seconds, so, second video overlap first video. This 1 second overlap will be used as transition between videos. Each transition except fade-in/out require this.

            string[] files = { "c:\\samples\\!video.avi", "c:\\samples\\!video2.wmv" };
            VFVEFileSegment[] segments1 = new[] { new VFVEFileSegment(0, 5000) };
            var videoFile = new VFVEVideoSource(
                                files[0],
                                segments1,
                                VFVideoEditStretchMode.Letterbox,
                                0,
                                1.0);
            VFVEFileSegment[] segments2 = new[] { new VFVEFileSegment(0, 5000) };

            var videoFile2 = new VFVEVideoSource(
                                            files[1],
                                            segments2,
                                            VFVideoEditStretchMode.Letterbox,
                                            0,
                                            1.0);

            VideoEdit1.Input_AddVideoFile(
                                videoFile,
                                0);

            VideoEdit1.Input_AddVideoFile(
                    videoFile2,
                    4000);

2. Get ID of required transition.

            int id = VideoEdit.Video_Transition_GetIDFromName("Upper right");

3. Add transition between 4 and 5 second on timeline.     

            VideoEdit1.Video_Transition_Add(4000, 5000, id); 

Transition names available using VideoEdit.Video_Transition_Names() call. Also you can check ID's list in this article.

VisioForge © 2006-2020

  • GitHub-Mark-64px
  • Twitter Социальные Иконка
  • VisioForge Facebook page
  • YouTube channel