Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ImageProcessing
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 21-Jul-11 1:03am

1 solution

Rate this: bad
good
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[^]
  Permalink  
Comments
ankur.mu at 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 at 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)

  Print Answers RSS
0 OriginalGriff 295
1 DamithSL 265
2 CPallini 235
3 Maciej Los 190
4 George Jonsson 170
0 OriginalGriff 5,415
1 DamithSL 4,422
2 Maciej Los 3,820
3 Kornfeld Eliyahu Peter 3,470
4 Sergey Alexandrovich Kryukov 2,911


Advertise | Privacy | Mobile
Web04 | 2.8.141216.1 | Last Updated 21 Jul 2011
Copyright © CodeProject, 1999-2014
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