Sign in to follow this  
bimbam09

Width and Height compressor output format (win32)

Recommended Posts

Hello, How to determine if a compressor can output a certain format with a given width x height ? Currently, I use a call to ICCompressQuery() with some input / output BITMAPINFO. I specify some width and height both for input and output but it always return Ok... meaning that the compressor would support this video generation - and obviously it is not possible because later, the call AVIStreamWrite(...) will fail when the width and height are too large for a compressor. Here is the source code on which I am playing with ICCompressQuery(...) http://pierloic.free.fr/compress/width_height.html The only way I see - so far - is to try to write a dummy AVI file with the requested width and height and see if it works. I would expect ICCompressQuery(...) or one of his friends to say it the width x height is supported by a compressor. But may be it is just not possible... Any help welcome ! Thanks

Share this post


Link to post
Share on other sites
It was years ago that I messed with compression. However, a couple questions that may help.

What is the error returned from AVIStreamWrite?

What is "808802372" for the compression in the output format?

(if you specify 24bpp, I would think specifying a compression of BI_RLE8 would fail as it requires 8bpp and a color table)

Share this post


Link to post
Share on other sites
Hi,

1/

return value of AVIStreamWrite(...)
is
HRESULT hr = -2147205018 (AVIERR_BADFORMAT)

this is when the requested size (width x height)


2/

this code was obtained from a call to ICCompressGetFormat(hic, lpbiInput, lpbiOutput)

lpbiInput is specified as the input image. Then the output image header lpbiOutput has the "biCompression" field set to 808802372


I have tried to set this flag to BI_RLE8. But that make the call ICCompressQuery() fails for any width and height.
Yes I agree with you, BI_RLE8 is anyway dedicated to 8bits color.

So, there might be an issue with this "biCompression" field but I do not know what to set here.

Thanks,

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this