Vittal Hegdekatte
Guest
|
Posted:
Fri Dec 16, 2005 9:30 am Post subject:
MPEG 4 (V1, V2) Encoder : Colors not saved properly |
|
|
Hello,
I am trying to create AVI files out of many bimap buffers using
AVIFileCreateStream /AVIMakeCompressedStream /AVIStreamSetFormat of Windows
Multimedia API.
While doing so I am using MPG4c32.dll codecfrom Microsfoft with version
4.1.00.3920 (latest I believe).
AVICOMPRESSOPTIONS aviCompressionOpts;
//Microsoft MPEG V2
aviCompressionOpts.fccHandler = 842297453;
aviCompressionOpts.dwBytesPerSecond = 3000;
aviCompressionOpts.dwFlags = AVICOMPRESSF_DATARATE;
and
BITMAPINFOHEADER myBmpInfoHdr;
myBmpInfoHdr.biSize = sizeof(BITMAPINFOHEADER) ;
myBmpInfoHdr.biWidth = 604 ;
myBmpInfoHdr.biHeight = 604 ;
myBmpInfoHdr.iPlanes = 1 ;
myBmpInfoHdr.iBitCount = (WORD) 24;
myBmpInfoHdr.biCompression = BI_RGB ;
myBmpInfoHdr.biSizeImage = 604 * 604 * 3
and appending the frame using
AVIStreamWrite(myCompressedAviStream, // stream pointer
myFrameNo, // time of this frame
1, // number to write
imagedata_in, // ptr to imageData (BYTE*)
myBmpInfoHdr->biSizeImage, //size of frame
AVIIF_KEYFRAME, // flags....
NULL,
NULL);
My observation is that resulting AVI file has random color loss ( example,
if I have yellow line in the original BITMAP (uncompressed) buffer, it
becomes gray, or Green line becomes looses its color here and there.
When I changed the Codec to Micorosft Video 1, or CinePack or TechSmith it
works fine.
I was just wondering whether any one has experienced the same problem and Is
it a bug from MPG4C32.dll ?
Thanks in advance.
Regards,
Vittal
|
|