Question

I am decoding video frames from a stream and sws_scale gives me a buffer of decoded RGB image data (PIX_FMT_RGB24). I have an existing front-end application that requires the input be DIB. So I need to know how to convert this buffer to DIB?

From what I understand DIB on windows is BGR and bottom to top and requires a header. Rather than do that manually, I'm hoping this problem has already been solved. I'm also wondering maybe sws_scale can do it natively.

Was it helpful?

Solution

This isn't the answer you're looking for. But, this is about all I've got.

DIB stands for Device Independent Bitmap which is just a bitmap with an extra (DIB) header in it specifying some information about the image data so that it can be understood by more than one device/platform. You can easily link to a free external library such as DevIL to generate the bitmap, but I don't know of any libraries which will create the DIB header for you. However, there's a lot of information about the DIB header on the wiki page and it doesn't look that hard to do yourself and let some other library (I suggest DevIL) do the image conversion.

I hope somebody else comes up with a nice third party library that does exactly what you're asking. Good luck!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top