Click here to Skip to main content
14,356,442 members
Rate this:
Please Sign up or sign in to vote.
See more:
hello, I am using avifil32.dll to add sound to my video. First of all, I created an AVIWriter and add all my pictures (MyAviFile.avi). Then I created Api for avifil32.dll and try to create manager
var manager = new AviManager(fileName, true);
public AviManager(String fileName, bool open){
			Avi.AVIFileInit();
			int result;

			if(open){ //open existing file
				
				result = Avi.AVIFileOpen(
					ref aviFile, fileName,
					Avi.OF_READWRITE, 0);

			}else{ //create empty file
				
				result = Avi.AVIFileOpen(
					ref aviFile, fileName, 
					Avi.OF_WRITE | Avi.OF_CREATE, 0);
			}

			if(result != 0) {
				throw new Exception("Exception in AVIFileOpen: "+result.ToString());
			}
		}


and the result was -214567...

What I have tried:

I have read that that is because of my avi file size (it's near 4G). And what to do with it.
And when I convert my avi to flv the size became near 20 Mb. Why my original avi is too large?
Posted
Updated 10-Aug-17 2:52am
Comments
Richard MacCutchan 10-Aug-17 5:14am
   
Look at the error code as a hex value, you can then use Google to find out what it means.
faradey 10-Aug-17 7:01am
   
That's my return value: -2147204921. Can you help me, I not actually understand what you mean.
Richard MacCutchan 10-Aug-17 7:07am
   
You need to display it in hexadecimal, which is ‭FFFFFFFF800440C7‬. The actual error code is the lower half ‭800440C7‬. Check the documentation for the error codes that may be returned from the API call in question.
Jochen Arndt 10-Aug-17 7:37am
   
That is AVIERR_ERROR (defined in Vfw.h); the generic (unspecified) AVI error.

So it does not help much. There is also a funny comment in that file (at least in the old version I actually have here):
// !!! Questions to be answered:
// How can you get a string form of these errors?
// Which of these errors should be replaced by errors in SCODE.H?
faradey 10-Aug-17 7:56am
   
thanx a lot, it's very usefull but that's all, what i find:
AVIERR_ERROR = HRESULT($800440C7);
and there is no discription what to do(((
Richard MacCutchan 10-Aug-17 8:00am
   
Sorry, but you will have to try a specialist forum, or Microsoft for more information.
faradey 10-Aug-17 8:22am
   
I solved my problem and can tell:
I am using C# and created aviWriter with a help of AForge.Video.VFW.AVIWriter and didn't set the codec. But now I download codec (XVid) to my laptop and set it name in constructor and now it's working))
Thanx all of you, best regards

1 solution

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

Solution 1

You are using the plain AVI format which stores video uncompressed. That is why the file size is so large. AVI itself is limited to 4 GB because it uses 32-bit pointers. But VfW (Video for Windows) has a limitation of 2 GB. When using DirectShow instead of VfW, the limit is the 4 GB limit of AVI.

You might think about using a more recent video format than the quite old AVI format or use DirectShow instead of VfW when all of your uncompressed files are smaller than 4 GB.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




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