[FFmpeg-user] rgb8

Michael Koch astroelectronic at t-online.de
Wed Jul 19 09:13:28 EEST 2023


Am 19.07.2023 um 05:41 schrieb Roger Pack:
> On Tue, Jun 20, 2023 at 8:28 AM Diederick C. Niehorster
> <dcnieho at gmail.com> wrote:
>> HI Michael,
>>
>> On Tue, Jun 20, 2023 at 9:14 AM Michael Koch
>> <astroelectronic at t-online.de> wrote:
>>> Am 20.06.2023 um 02:53 schrieb Roger Pack:
>>>> Can other apps use this dshow device?
>>> In VLC player it's incorrectly shown as a noisy rgb8 color video. Same
>>> output as in FFmpeg.
>>> In SharpCap I can open the camera directly (using the camera
>>> manufacturer's API), that works without problems, the data is
>>> uncompressed 8-bit or 16-bit grayscale.
>>> If I open it in SharpCap as a DirectShow device, then the video is very
>>> noisy but grayscale (no colors). Probably rgb8 converted to grayscale.
>>>
>>>>     If you plunk it into
>>>> graphstudionext does it work, what media format do you see on the
>>>> wires?
>>> See the attached screenshot.
>>>
>>>> I guess the only question is "is it actually palletized"?
>>>> Based on the source it seems like we weren't sure...
>>> What else could it be? DirectShow doesn't support 8-bit gray.
>>> It's sure that the pixel format is either 8-bit gray, or pal8 with a
>>> palette which contains 256 levels of gray.
>> I've only half been following this conversation, but i assume it must
>> be palettized, since thats what the format says it is and how the
>> other tools probably interpret it correctly.
>> Your screenshot was helpful. It shows that biCompression is 0x0000.
>> According to the docs, this value (BI_RGB, see
>> https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-wmf/4e588f70-bd92-4a6f-b77f-35d0feaf7a57)
>> means a palette is used:
>> https://learn.microsoft.com/en-us/windows/win32/api/wingdi/ns-wingdi-bitmapinfoheader#color-tables.
>>
>> Now whether this can correctly be converted to a ffmpeg color format,
>> and what needs to be done for that, i don't know ;)
> Maybe it's PIX_FMT_PAL8, though implementing this might be a little
> tricky...funding helps :)

It is RGB8 in DirectShow and should become PIX_FMT_PAL8 in FFmpeg. Not 
PIX_FMT_RGB8 as it is now.
See ticket 10418.
RGB8 in Directshow is defined as "RGB, 8 bpp, palettized".
PIX_FMT_RGB8 in FFmpeg is defined as "packed RGB 3:2:2, 8bpp, (msb)2R 3G 
3B(lsb)".
These are two completely different pixel formats.

Michael



More information about the ffmpeg-user mailing list