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)

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

Create video file source

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

Same for the second file

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

var videoFile2 = new VideoSource(
                                files[1],
                                segments2,
                                VideoEditStretchMode.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, VideoEditPIPMode.Custom, true, 1280, 720, 0, rect2, rect1);

Create video file sources same as above.

Add video files using Picture-In-Picture.

Side-by-side video, vertically or horizontally

Horizontal split

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

Vertical split

VideoEdit1.Input_AddVideoFile_PIP(videoFile, videoFile2, 0, 10000, VideoEditPIPMode.Vertical, false);

Required redists

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 - 2022