I wrote a MJPEG compressor DirectShow filter, it works without problems for color images. But when i try to support 8bit greyscale images i'm not able to connect my filter to the Microsoft AVI muxer filter. It will always fail in ReceiveConnection. I basically copy the BITMAPINFOHEADER of the input image and change biCompression to MJPG and reduce biSizeImage.
Does the Microsoft AVI Muxer has any requirements for it's allocator? I use the size of the output BITMAPINFOHEADER and don't care for prefix or alignment currently.
Thei BITMAPINFOHEADER looks as follows: biSize 1064 biWidth 640 biHeight -480 biPlanes 1 biBitCount 8 biCompression 1196444237 biSizeImage 184320 biXPelsPerMeter 0 biYPelsPerMeter 0 biClrUsed 0 biClrImportant 0
Changing the height to a positive value has no effect. The biSize is bigger than normal as we use the header so save additional information for the encoding. In color mode we have the same BITMAPINFOHEADER except of the biBitCount beeing 24.

VIDEOINFOHEADERhere in your question? The way you see it in debugger as late as possible before the error comes up. - Roman R.VIDEOINFOHEADERdoes not not look valid for MJPG. - Roman R.