[FFmpeg-user] rgb8

Michael Koch astroelectronic at t-online.de
Wed May 31 08:18:24 EEST 2023

Am 30.05.2023 um 22:53 schrieb Paul B Mahol:
> On Tue, May 30, 2023 at 8:32 PM Michael Koch <astroelectronic at t-online.de>
> wrote:
>> Am 30.05.2023 um 20:28 schrieb Reindl Harald:
>>> Am 30.05.23 um 20:21 schrieb Michael Koch:
>>>> ffmpeg -f dshow -video_size 1280x800 -framerate 5 -pixel_format rgb8
>>>> -i video="ASI178MM Camera (ZWO Design)" -f rawvideo -frames 1 -y
>>>> test.raw
>>>> Then I did read this file, assuming that the pixel format is gray:
>>>> ffmpeg -s 1280x800 -pixel_format gray -f rawvideo -i test.raw -y
>>>> gray.png
>>>> The result looks correct. Is it possible to do this in one command
>>>> line? I mean just tell FFmpeg that the pixel format isn't rgb8 but
>>>> gray, without making any modifications to the data?
>>> parameters before the input file are *input params*
>>> so why don't you change "-pixel_format rgb8" to "-pixel_format gray"
>>> in the first command line when you say it works in the second one?
>> When reading from the camera, the pixel format must be rgb8 because this
>> is the only format supported by the DirectShow driver. All other pixel
>> formats give error message.
> Yes, looks like buggy code, the rgb8 is actually gray and not color.

Is it possible to get correct gray data from the buggy driver in one 
FFmpeg command line? I mean the data can only be read from the driver as 
rgb8. Is it possible to tell FFmpeg that it's actually gray? It works as 
a two-step process with an intermediate raw file, but I'd like to do the 
same thing in one command line in realtime.


More information about the ffmpeg-user mailing list