AVIMakeCompressedStream
-
I have a similar problem like E-Jo in this thread:
http://www.ureader.com/message/257118.aspx
i also use the example from codeproject.com "Create a movie from an HBitmap" by P.GopalaKrishna.in my case the AVIMakeCompressedStream passes with no returning error-code but an first-chance exception. the result is a missing header in the avi-file (0x0 to 0x800 all zero, the rest seems to be the compressed stream). i have divx6.6 and koepi's xvid installed and tested. no matter which codec or mmioFOURCC (DIVX, DIV6, XVID, MSVC) i use, i get the same
exception.the code from the example:
ZeroMemory(&m_AviCompressOptions,sizeof(AVICOMPRESSOPTIONS));
m_AviCompressOptions.fccType=streamtypeVIDEO;
m_AviCompressOptions.fccHandler=m_AviStreamInfo.fccHandler;m_AviCompressOptions.dwFlags=AVICOMPRESSF_KEYFRAMES|AVICOMPRESSF_VALID;//|AVICOMPRESSF_DATARATE;
m_AviCompressOptions.dwKeyFrameEvery=1;
//m_AviCompressOptions.dwBytesPerSecond=384000/8;
//m_AviCompressOptions.dwQuality=100;if(FAILED(AVIMakeCompressedStream(&m_pAviCompressedStream,m_pAviStream,&m_AviCompressOptions,NULL)))
{
// One reason this error might occur is if you are using a Codec
that is not
// available on your system. Check the mmioFOURCC() code you are
using and make
// sure you have that codec installed properly on your machine.
SetErrorMessage(_T("Unable to Create Compressed Stream: Check
your CODEC options"));
return E_FAIL;
}m_pAviStream was initialized with AVIFileCreateStream without problems.
what could be the reason that AVIMakeCompressedStream throws an first-chance exception??
any help is much appreciated,
lois