Click here to Skip to main content
13,001,454 members (59,543 online)
Rate this:
Please Sign up or sign in to 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.

Posted 21-Jul-11 0:03am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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[^]
Comments 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
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);

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


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)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170624.1 | Last Updated 21 Jul 2011
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100