Click here to Skip to main content
15,881,173 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I want to compress an uncompressed avi file into MS-CRAM (Microsoft Video 1).

If anyone knows how to do it please help me with the code.

Thanks!
Posted

1 solution

Hi Ankur
I think this will help you out.
I have used this in one of my project and its very impressive...

A Simple C# Wrapper for the AviFile Library[^]
 
Share this answer
 
Comments
ankur.mu 21-Jul-11 7:18am    
well thanks! I saw that code & it gives an option to change the compression format but I just want the file to get converted into a particular format(MS-CRAM)& I don't want to give multiple options to the user!
It uses dll to create the dialog box & so i have no idea about how to avoid popping up of the dialog box.
Suresh Suthar 21-Jul-11 8:03am    
I had faced up with same issue in my project. So I made some changes in the code.

In VideoStream.cs
Uncomment <pre> /*Avi.AVICOMPRESSOPTIONS opts = new Avi.AVICOMPRESSOPTIONS();
opts.fccType = (UInt32)Avi.mmioStringToFOURCC("vids", 0);
opts.fccHandler = (UInt32)Avi.mmioStringToFOURCC("CVID", 0);
opts.dwKeyFrameEvery = 0;
opts.dwQuality = 0; // 0 .. 10000
opts.dwFlags = 0; // AVICOMRPESSF_KEYFRAMES = 4
opts.dwBytesPerSecond= 0;
opts.lpFormat = new IntPtr(0);
opts.cbFormat = 0;
opts.lpParms = new IntPtr(0);
opts.cbParms = 0;
opts.dwInterleaveEvery = 0;*/</pre>

and replace these two line <pre>
opts.fccType = (UInt32)Avi.mmioStringToFOURCC("vids", 0);
opts.fccHandler = (UInt32)Avi.mmioStringToFOURCC("CVID", 0);
</pre>

with
<pre>
fccType = (uint) Avi.streamtypeVIDEO;
fccHandler = (uint) Avi.mmioFOURCC('X', 'V', 'I', 'D');

</pre>

Now comple the project and use this dll in your project.
This will prevent the dialog to be appear... Hope this will help..

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