Skip to main content

How to create a new file from multiple source files?

Product: Video Edit SDK .Net. Engine: VideoEditCore (Windows only).

Sample code

Using our SDK, you can combine streams from several input files. For example, you can add an additional audio stream to the AVI file. Reencoding is not required if the output format is compatible with audio and video streams.

Create a streams list:

var streams = new List();

Add video stream. ID set to "v" to add video stream.

streams.Add(new FFMPEGStream
{
Filename = "c:\\samples\\!video.avi",
ID = "v"
});

Add audio stream from mp3 file. ID set to "a" to add the audio stream. Must be "a" for audio files.

streams.Add(new FFMPEGStream
{
Filename = "c:\\samples\\!sophie.mp3",
ID = "a"
});

Add audio stream from another AVI file. ID set to "a" to add audio stream from video file.

streams.Add(new FFMPEGStream
{
Filename = "c:\\samples\\!video2.avi",
ID = "a"
});

The second parameter is "true" to set the duration of the output file to the shortest stream. If video stream duration is bigger than audio stream duration, you'll have problems seeking in some players.

VideoEdit1.FastEdit_MuxStreams(streams, true, outputFile);

Required redists

  • SDK redist
  • FFMPEG redist x86 x64

How to install required redists or deploy them to the user's PC?


Visit our GitHub page to get more code samples.