Picture-In-Picture in Video Edit SDK .Net

Related products
Video Edit SDK .Net
You can add file pairs to made them horizontally / vertically split or placed one on another. In this article, you can see how to add source files.

Picture-In-Picture (one video inside another)

Create file list

string[] files = {  "c:\\samples\\!video.avi", "c:\\samples\\!video2.wmv" };

Set first file start and stop time (segment)

VFVEFileSegment[] segments1 = new[] { new VFVEFileSegment(0, 10000) };

Create video file source

var videoFile = new VFVEVideoSource(
                                files[0],
                                segments1,
                                VFVideoEditStretchMode.Letterbox,
                                0,
                                1.0);

Same for the second file

VFVEFileSegment[] segments2 = new[] { new VFVEFileSegment(0, 10000) };

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

Set rectangle for a "big" file area, the same as video track resolution

var rect1 = new Rectangle(0, 0, 1280, 720);

Set rectangle for a "small" file area

var rect2 = new Rectangle(100, 100, 320, 240);

Add video files using Picture-In-Picture

VideoEdit1.Input_AddVideoFile_PIP(videoFile, videoFile2, 0, 10000, VFVEPIPMode.Custom, true, 1280, 720, 0, rect2, rect1);

Side-by-side video, vertically or horizontally

Create video file sources same as above.

Add video files using Picture-In-Picture.

Horizontal split

VideoEdit1.Input_AddVideoFile_PIP(videoFile, videoFile2, 0, 10000, VFVEPIPMode.Horizontal, false);

Vertical split

VideoEdit1.Input_AddVideoFile_PIP(videoFile, videoFile2, 0, 10000, VFVEPIPMode.Vertical, false);
Please contact support to get help with this tutorial. Visit our GitHub page to get more code samples.
abstract 2abstract 1abstract 3
logo
VisioForge © 2006 - 2021