5

I need to merge multiple video files (.wmv) together to get a single wmv file. How can I do it?

BrokenGlass
  • 158,293
  • 28
  • 286
  • 335
Thilina H
  • 217
  • 1
  • 3
  • 19
  • Duplicate: http://stackoverflow.com/questions/2844398/split-encode-and-join-video-parts-in-c – SiN Jul 31 '11 at 16:29

2 Answers2

8

You can do that easily Use Splicer, it free and open source in C#

Simplify developing applications for editing and encoding audio and video using DirectShow

Example:

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();
    }
}
Jalal Said
  • 15,906
  • 7
  • 45
  • 68
  • @thilina I added an example how to do it, check it. – Jalal Said Jul 31 '11 at 17:55
  • 1
    Hello, I was trying with this solution but with WindowsMediaRenderer and it is taking too much time to merge two small wmv files. Can you please help me with that? How to make it faster? – Masud Rahman May 21 '12 at 14:25
  • I am sorry Masud, It has been a long time since I worked on that library, but as I far as I can remember, is matters on the resolution "a less is faster" and the quality of video, I don't remeber if there was a medium quality WindowsMediaRenderer that is exists by default on Splicer, you have to make some searches... – Jalal Said May 22 '12 at 08:03
2

You can split and join video files using DirectShow or the Windows Media Encoder.

DirectShowNet library has examples which you might find useful. I think its called DESCombine.

Neil Knight
  • 47,437
  • 25
  • 129
  • 188
  • Hello, can you please give me a working example of how to merage videos using Windows media encoder? I downloaded the WME SDK, but not sure how to do that. I am stuck!! Please help. Thanks – Masud Rahman May 21 '12 at 14:26