ayufan / camera-streamer

High-performance low-latency camera streamer for Raspberry PI's
327 stars 50 forks source link

Can't pass a tuning-file as a parameter #99

Open sosagarcia opened 1 year ago

sosagarcia commented 1 year ago

Hello!,

I use your camera-streamer service in a fluidd web interface to stream what is happening while I'm 3D printing.

I noticed that is not possible to pass a tuning-file as a parameter ( which is something you can do with libcamera ) For example executing: libcamera-still --tuning-file /usr/share/libcamera/ipa/rpi/vc4/ov5647_noir.json -o image.jpg

As I have a NOIR camera in my Raspberry it would be perfect if I could apply to the streaming a tuning file to see a full-color streaming

For example, the imagen2.jpg is how the camera captures the image in infrared. In image.jpg is with a -tuning-file="/usr/share/libcamera/ipa/raspberrypi/ov5647_noir.json" imagen2 image

The closest thing I could get is when I set --camera-options=AwbEnable=true ( see image3.jpg) image3

Do you know if there is a solution for that? In the past, I could manage it by putting awb_auto_is_greyworld=1 in /boot/config.txt in my raspberry pi. But seems is not working anymore...

I would appreciate any help :) thanks

albatorsssx commented 11 months ago

Hi, No one can answer? I am also interested in my configuration under Octopi. THANKS

kbingham commented 11 months ago

I think these can be set with an environment variable.

kbingham commented 11 months ago
    // We have to pass the tuning file name through an environment variable.
    // Note that we only overwrite the variable if the option was given.
    if (tuning_file != "-")
        setenv("LIBCAMERA_RPI_TUNING_FILE", tuning_file.c_str(), 1);
ayufan commented 11 months ago

Oh. Good hack. I guess, this is best solution then.

albatorsssx commented 11 months ago

Oh great! It works ! So in my case I added the following line in the configuration file /boot/camera-streamer/libcamera.conf

LIBCAMERA_RPI_TUNING_FILE=/usr/share/libcamera/ipa/rpi/vc4/imx219_noir.json

big thanks !

Delivator commented 9 months ago

I set the environment variable but it seems to just be ignored. Using libcamera-still --tuning-file also works fine for me.