Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am working on a project where I need to merge avi files. I got help from this link:

But in my case I have a folder that contains several avi files

I want to merge all these.

When I merged ist two files and after that it is giving me error like "An invalid media type was specified"

Here is my code block.

C#
foreach (string fileName in System.IO.Directory.GetFiles(LPath)) {

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

            var firstVideoClip = group.AddTrack().AddVideo(downloadedfilename);
            var secondVideoClip = group.AddTrack().AddVideo(fileName, firstVideoClip.Duration);

            using (AviFileRenderer renderer = new AviFileRenderer(timeline, downloadedfilename))
            {
                renderer.Render();
            }
        }
    }  

my this line of code giving error:

C#
var firstVideoClip = group.AddTrack().AddVideo(downloadedfilename);

can anybody help me to merge all files in the folder.
Posted
Updated 20-Mar-12 19:39pm
v2
Comments
Shahin Khorshidnia 21-Mar-12 2:02am    
What are 32, 720, 576 for?
tanweer 21-Mar-12 2:14am    
thanks, these are bitCount, width and height

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900