5

我需要将多个视频文件 (.wmv) 合并在一起以获得一个 wmv 文件。我该怎么做?

4

2 回答 2

8

你可以很容易地做到这一点 使用Splicer,它在 C# 中免费和开源

使用 DirectShow 简化用于编辑和编码音频和视频的应用程序的开发

例子:

using Splicer;
using Splicer.Timeline;
using Splicer.Renderer;

string firstVideoFilePath = @"C:\first.avi";
string secondVideoFilePath = @"C:\second.avi";
string outputVideoPath = @"C:\output.avi";

using (ITimeline timeline = new DefaultTimeline())
{
    IGroup group = timeline.AddVideoGroup(32, 720, 576);

    var firstVideoClip = group.AddTrack().AddVideo(firstVideoFilePath);
    var secondVideoClip = group.AddTrack().AddVideo(secondVideoFilePath, firstVideoClip.Duration);

    using (AviFileRenderer renderer = new AviFileRenderer(timeline, outputVideoPath))
    {
        renderer.Render();
    }
}
于 2011-07-31T16:35:28.287 回答
2

您可以使用 DirectShow 或 Windows Media Encoder 拆分和连接视频文件。

DirectShowNet 库包含您可能会发现有用的示例。我认为它称为DESCombine。

于 2011-07-31T16:29:33.387 回答