0

I'm doing an application in VSExpress10 using Expression Encoder 4 sdk, wherein I take 2 video files as input and need to produce a single file merging the both. When I add both files to Job class' MediaItems entity, both the files are encoded separately. Is there a way I could merge these files and produce a single file?

4

1 回答 1

3

当然。你可以按照这些思路做一些事情。

假设您有 video1.avi 和 video2.avi;让我们进一步说它们在同一个目录中。要将两者放在一起,video1 后跟 video2,您可以执行以下操作:

string pathTo = @"C:\videos\";
MediaItem mergedVideo = new MediaItem(pathTo + "video1.avi");
mergedVideo.Sources.Add(new Source(pathTo + "video2.avi");
//--And you can keep doing this for more videos like below:
//mergedVideo.Sources.Add(new Source(pathTo + "video3.avi");

//Then just encode the job to get a single video of the two sub-videos
job.MediaItems.Add(mergedVideo);
job.Encode();
于 2012-03-07T14:55:47.297 回答