mpromonet / v4l2rtspserver

RTSP Server for V4L2 device capture supporting HEVC/H264/JPEG/VP8/VP9
The Unlicense
1.86k stars 428 forks source link

Convert stream to black and white / greyscale #166

Closed parautenbach closed 4 years ago

parautenbach commented 4 years ago

Is there a way to do this? I can't seem to find info on this. I'd like to do something similar to ffmpeg where one can set hue=s=0. I don't see options to do this directly with v4l2rtspserver or v4l2-ctl.

The reason I want to do this is to make an infrared camera feed look a little more pleasing.

mpromonet commented 4 years ago

Hi Peter, This project doesnot modify image, it streams what it captures using the V4L2 interface. Depending on the V4L2 device this could be possible using the appropiate control. Using the driver bcm2835_v4l2, the black & white could be set using :

v4l2-ctl -c saturation=-100

or

v4l2-ctl -c color_effects=1

An other way is to add a v4l2loopback device that makes the tranformation, but this will need some processing ressources... Best Regards, Michel.

parautenbach commented 4 years ago

Thanks for the explanation.

The saturation setting is easy to understand, but how do you know what the available colour effects are and what they mean? Does this depend on the specific device?

mpromonet commented 4 years ago

Hi parautenbach, Yes this is depending on the device driver. you can get list of controls supported by the driver using :

v4l2-ctl --all -d /dev/video0

Best Regards, Michel.

parautenbach commented 4 years ago

Thanks, again.

I'm getting this:

color_effects 0x0098091f (menu)   : min=0 max=15 default=0 value=0

Do I need to check the vendor's page for more details on what the different values for this control would mean?

ostecke commented 2 years ago

v4l2-ctl -c saturation=-100

worked perfectly for me using a Raspberry Pi Camera Module 2 NoIR.