Camera-streamer configuration on the new camera stack for OctoPi

@brentil - as mentioned above already in this topic. If you have issues with setting up the new camera stack, then you must open your own post. It is extremely confusing to have lots of issues all under one thread that is supposed to be a guide to help change the settings in camera streamer.

Congrats @foosel on this new feature. Where can I find instructions for a custom install of OctoPrint (without the RPi imager). I checked this thread and issue 2 for OctoPi-UpToDate but I was unable to find it.

It's the one that has camera-streamer mentioned.

Thanks but I think I wasn't clear. I have reasons why I have a custom installation of OctoPrint without OctoPi. I'm looking for instructions on how to add this new camera stack to a standalone OctoPrint installation (on raspbian) that doesn't use OctoPi.

1 Like

Ah, gotcha. It's using this.

1 Like

The new camera stack is built for OctoPi. If you want a similar thing for yourself, then you have to install camera-streamer yourself - you can't take advantage of the scripts here, they are OctoPi-only. The whole 'new stack' idea is specific to OctoPi as well.

hi i have octoprint installed on raspbian do i need to install the camera stack ?

it says im running Version 1.9.0.
thanks martin

How do I take a snapshot with the new stack? Can it be done both via OctoPrint and the console?

Found it: You have to do http://localhost:8080/?action=snapshot

Is there any camera option for FOV? I have a Logitech Brio that can run at 65°, 78°, and 90° as configured in Logitech software. Looks like its running 65 as default and would love to get the wider view for timelapse if possible.

Gave up, doesn't look like a configurable option and since it's not manual can't open camera up to change it either. Remounted to make it work for now, will probably replace with different model.

If I add an USB camera with add-usb-camera and I choose the right camera and I can see it set port 8082.
is the URL to the stream as it was before http://octopi.local:8082/?action=stream ?
I can't see the video.

I cannot get this to work at all. I did a fresh install of OctoPi 1.0.0 and Octoprint 1.9.2. I have one USB camera attached, and camera-streamer is running:

/usr/bin/camera-streamer --http-port=8080 --camera-type=v4l2 --camera-path=/dev/v4l/by-id/usb-046d_Logitech_Webcam_C930e_3B3BA81E-video-index0 --camera-format=YUYV --camera-width=1280 --camera-height=720 --camera-fps=15 --camera-nbufs=2

However, when I go to 192.168.1.5:8080 or 192.168.1.5:8081, I just get "Unable to connect". What am I missing? lsusb shows the camera just fine. journctl shows:

Sep 11 21:41:00 octopi systemd[1]: Starting camera-streamer...
Sep 11 21:41:00 octopi camera-streamer-control[3486]: Running start for camera-streamer-libcamera.service...
Sep 11 21:41:00 octopi camera-streamer-control[3486]: ... done.
Sep 11 21:41:00 octopi camera-streamer-control[3486]: Running start for camera-streamer-usb-default.path...
Sep 11 21:41:00 octopi camera-streamer-control[3486]: ... done.
Sep 11 21:41:00 octopi systemd[1]: Finished camera-streamer.

Setting this in usb-default.conf fixed it:

OPTIONS="--http-listen=0.0.0.0"

1 Like

Doesn't sound like you're using the new camera stack in OctoPi there.

Are systemctl service files behind the service files available outside of the build image on a github somewhere?

I imagine there are camera-streamer.service, camera-streamer-libcamera.service camera-streamer-usb.service files that show precisely how the services are implemented and how /boot/camera-streamer/libcamera.conf and perhaps maybe /boot/camera-streamer/use-.conf are used.

The standard camera-streamer docs appear to mention only the libcamera configuration within https://github.com/ayufan/camera-streamer/tree/main/service files and don't appear to use or discuss the /boot/libcamera/*.conf scheme.

====

I see those files are created here:

and the same file points to

and

You already found it. GitHub - OctoPrint/camera-streamer-stack: These are the files of the new camera-streamer based webcam stack for OctoPi-UpToDate. The image does the install for this from the other script file you linked as well here with github actions. The actual service files themselves are here.

1 Like

This is exactly what I had to do to get it working. I also had to wait until all the first startup reboots completed before plugging in my camera or the service wouldn't start.

OPTIONS="--http-listen=0.0.0.0"
Is this necessary to place in libcamera.conf? In 2024? Edit: it seems yes.

For a first startup, should the non-usb camera be installed or not? If not, when should it be installed? My pi4 is in an awkward case, so it takes a while to take it apart and put it together. The case is not camera install friendly.

Could you kindly point me to a thread for configuration of Arducam? I have the 64M pixel camera I'd love to use, but I've barely got it to work. (Did get it to work on a stand alone RPI3B, but it was a whole lot of work.). Thanks.
Edit: I see that autorange and autofocus are enabled. Not sure about anything for high pixel cameras.

Edit 2020 02 17: I found a satisfactory answer here: https://community.octoprint.org/t/usb-camera-options-new-camera-stack/54440

I have the new camera stack working well with my Logitech C920 using the default USB camera config file. I would like to customize some settings, but I can't find the syntax for the options I want to change. I have found many in this post, but not all. I tried $ camera-streamer --help and got the same thing published here. When I tried $ camera-streamer --camera-list_options, I expected to see a list of the camera's options, but I got this instead:

$ camera-streamer --camera-list_options
camera-streamer Version: v0.2.5 (41d8dfd)
device/v4l2/device.c: CAMERA: Device path=/dev/video0 fd=3 opened
device/v4l2/device_options.c: CAMERA: The 'horizontal_flip=0' was failed to find.
device/v4l2/device_options.c: CAMERA: The 'vertical_flip=0' was failed to find.
device/camera/camera_input.c: CAMERA: Disabling DMA since device uses USB (which is likely not working properly).
device/v4l2/buffer_list.c: CAMERA:capture: ioctl(ret=-1, errno=16): Can't set format

Ayufan posted "All available configs can be found here: libcamera/control_ids.yaml ..." but that yaml file talks about controls and return codes; I don't understand how to use that document when setting camera options.

I am looking specifically for the options to turn off autofocus and set manual focus to a specific value, turn off autoexposure and set exposure to a specific value, same with setting manual white balance. I can do those things from the control app at octopi.local/webcam/control, but I want to make the settings persistent.

Is there a list somewhere of all the available options?

I had a little struggle to add a second Logitech C270 camera on my Raspberry PI 4 with camera-streamer.
I could get both cameras to work but not at the same time. If I reboot the service instance of camera-streamer for CAM1 the other one (CAM2) would work and if I do the same for CAM2 then CAM1 would work again.
I could solve it by using MJPG instead of YUYV. I think it has to do with limitations in the internal USB hub in the PI 4. MJPG uses compression whereas YUYV does not.
I checked the image difference and found that MJPG gives a little bit sharper image anyway so I switched to MJPG by setting FORMAT=MJPG in the configuration files of both camera's.

Just sharing this with the community. I hope this could be helpful for anybody.