Related products: Video Edit SDK .Net

Picture-In-Picture in Video Edit SDK .Net

You can add file pair to made them horizontally / vertically splitted or placed one on another. In this article you can see how to add source files.

 

Picture-In-Picture (one video inside another)

Specify 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 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);

VisioForge © 2006-2020

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