views:

258

answers:

1

I am using the SampleGrabber filter to get the frames of an AVI file and alter them before writing them to another (new) AVI file using the File writer filter.

The problem that I am facing is that the new AVI file size is greater then the original file. I removed the SampleGrabber filter thinking that it might be my code causing the problem, but still the new file size is greater then the original file. I tested it with graphedit. The filters used were File reader->AVI Splitter->AVI Mux->File writer.

I really want to preserve the file size. Is there any other filter or property that I have to set. At the moment I am only adding the Filters in GraphBuilder and rendering the file. I am using DirectShowLib.Net.

A: 

I just did a quick test using

File source (async) -> AVI splitter -> AVI mux -> file writer

in graphedit and the output file always seems to come out the same size as the input for me. The only thing I can think of is that your input file might be compressed. It might be worth inspecting the input file with an app like gspot to determine that. As I understand it DirectShow will sometimes insert appropriate filters in order to make a connection, so if you're trying to connect your file source to an AVI splitter it may insert a decompressor if needed. Hope that's of some use

Paul
No, there was no decompressor. The resulting file size vary's from couple of KBs to MBs. I think when saving the file using DirectShow filter, it might add some extra information in it. Because when I pass the newly generated File-B through the same graph again, I get a new File-C which is of save size as of File-B.
cornerback84