Click here to Skip to main content
15,896,912 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C++
CvVideoWriter *writeravi = cvCreateVideoWriter("C:\\outavi.avi",CV_FOURCC('D','I','V','X'),fps,cvSize(frameW,frameH),isColor);

for(int stepframe=0;stepframe<numFrames;stepframe++)
{
	cvGrabFrame(captureavi);          
	imgavi=cvRetrieveFrame(captureavi);
	int t= cvWriteFrame(writeravi,imgavi);  
	cvShowImage("image",imgavi);
	cvWaitKey(20);
}


It gives me aceess violation,(even writeravi=0x003ecd18 )

if i put "0" or "-1" instead of CV_FOURCC('D','I','V','X') it works but ) stands for uncompress output & -1 gives dialg box to select compression type , from which Intel indeo video 4.5 works for me.


But in my applicationh i cant use ) or -1 7 i want compresss output.

[edit]SHOUTING removed, Code block added, "Treat my content as plain text..." option disabled - OriginalGriff[/edit]
Posted
Updated 25-Jan-12 1:48am
v3
Comments
OriginalGriff 25-Jan-12 7:09am    
DON'T SHOUT. Using all capitals is considered shouting on the internet, and rude (using all lower case is considered childish). Use proper capitalisation if you want to be taken seriously.
pranav_30 25-Jan-12 7:11am    
ohhh i m realy sorry i dont know this thing...........
CPallini 25-Jan-12 8:10am    
Could you please elaborate? What function call produced such an error?
pranav_30 25-Jan-12 8:45am    
cvWriteFrame (writeravi,imgavi);

gives acess violatn while readng loctn ...
eror

1 solution

You specify DIVX in your code which doesn't work. When you get a dialog you select Intel indeo video which isn't DIVX. I think DIVX isn't installed and therefore won't work. Have a look at the link to check out the FOURCC codec list and change the codec or you could install DIVX and have another try.

http://www.fourcc.org/codecs.php[^]

Good luck!
 
Share this answer
 
Comments
pranav_30 25-Jan-12 10:58am    
i have instal klite kodek pack so i dnt thnk k its kodek issue..
E.F. Nijboer 26-Jan-12 7:44am    
Have another look at the k lite codec pack. It has support for xvid but divx isn't mentioned. http://www.free-codecs.com/download/k_lite_codec_pack.htm
pranav_30 25-Jan-12 23:07pm    
is there any other api for multiple camera capture. i try to learn directshow.. but could not able to understand the procedure of direct show.
pranav_30 26-Jan-12 9:15am    
ok supose i have only klite codek..
Then which fourfcc should i use..
Bcoz i tried with all documented fcc of open cv
Bt prblm nt solved..

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