Question

I am trying to split a large AVI 2.0 (OpenDML format) file in smaller parts (under 1GB in my case) in order to be able to open the parts with VFW (avifil32.dll).

What is the best way to achieve this splitting (preferably in C#)?

One of the options is to copy it frame by frame. I found some examples on the net, which do the same. But most of these use VFW which can't read files above 2GB in general and AVI 2.0 files above 1GB because of the max RIFF part size of 1GB.

I would need DirectShow instead of VFW. I am pretty sure that I would also mess up the audio sync if I try to manually copy frames.

I am looking for something similar to what VirtualDub does with "direct stream copy" that doesn't affect the current compression, just splits the file and creates proper AVI indexes.

Was it helpful?

Solution

Avi files can be encoded in many different ways, depending on the codec used. Avi is a wrapper file, not an encoding method. This means there isn't really an easy generic way to split avi files using C#.

To do it in code from scratch would be a major undertaking. That said, you can cheat by using mencoder and calling it from c# - not ideal, but far easier and more reliable than trying to re-invent the wheel. Alternatively, there are a number of ffmpeg c# wrappers that will give you access the ffmpeg tools (but I haven't found one that isn't buggy as hell)

What are you trying to do, exactly? Why do you need avifil32.dll and how are you using it? If you are just trying to play a very large avi file, there are alternatives. Try aforge.net, for example.

OTHER TIPS

mencoder can split files for you. Another option is ffmpeg

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top