Camera-streamer configuration on the new camera stack for OctoPi

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.

Interesting, as I have the same problem. Also with two Logitech cams (HD920 and a B525HD).

I also started with YUYV on both cams and switched to MJPG as well as JPEG. However, the B525HD was never working correctly.

After switching it back to YUYV on 480p, it is now working. Higher resolution will cause a Server-Error. The 920 is running in 1080p on MJPG without any bigger problems (sometimes it freezes).

Try listing the supported formats by the camera:
v4l2-ctl --list-formats -d /dev/v4l/by-id/whatevercameranameyougot

Thanks. YUYV and MJPG are supported (by both).
However, this discussion is not at the right place. I already have a topic open: New camera stack - one of 2 cameras not active - #14 by Wit4r7

Please don't hesitate to comment there if you have any additional ideas. I would be pleased, if it would work better.

1 Like

Hi All, I've tried editing the config file at /boot/camera-streamer/usb-cam1.conf and changing the frame rate:

FRAMERATE=2

which I'd hope would be pretty noticeable but the feed looks to be anywhere from 10-30 fps (ie smooth). Are there lower limits imposed on the framerate somewhere?

Is Multicam compatible with the new Stack? New stack is working and can see both camers with http://octopi2:8081/stream and http://octopi2:8082/stream (with OPTIONS="--http-listen=0.0.0.0"). Also an wget on octopi retries a shotshop or the stream.
But Multicam plugin shows only:

Webcamstream nicht geladen
It might not be configured correctly or require authentication. You can change the URL of the stream under "Settings" > "Classic Webcam" > "Stream URL". If you don't have a webcam you can also just disable webcam support there.
Aktuell konfigurierte Stream-URL: http://octopi2:8081/stream

I tried also localhost instead of hostname octopi2. Same problem.

This is a new installation with new camera stack. On my older installation I got multicam running with the old camera stack.

Any Ideas?

It should generally be fine. If you have an issue, open your own "Get Help" topic.

I am by no means an expert. I've just been struggling with this new stack for about a week. The command v4l2-ctl --all should tell you the actual frame rate along with resolution and a host of other info.

If you only have one camera and it is USB, the system might be using /boot/camera-streamer/usb-default.conf instead of /boot/camera-streamer/usb-cam1.conf. When I was first trying to get my camera working, I "added" a camera and it created a conf file in a subdirectory. I don't remember where it was. I found some documentation somewhere regarding multicam setup which told me where it was, and I backtracked from that experiment. I am using the usb-default.conf with my one USB camera and I can control the framerate correctly.

Also, it is not clear from posts on this page, but the video that displays in the control tab (http://octopi.local/?#control) or the home page (http://octopi.local) is still coming from MJPEG-Streamer (with its own settings) unless you replace the Classic Webcam plugin with the Camera Streamer Control plugin.

Whart is the syntax in the usb.conf file to add multiple options? I want to disable autofocus and place my absolute focus on 40.

#Additional options
OPTIONS='--camera options="camera-auto_focus[=0]" --camera options="LensPosition=40"

Is this correct? I can't find an answer to this anywhere, not on camera-streamer's documentation as well.

Thanks in advance! :slight_smile:

Not sure what the square brackets are doing there, but this configuration used to work for a Pi Cam V3 (I have referenced my own comment from 12 months ago so hoping it's not changed!)

OPTIONS='--camera-options="AfMode=0" --camera-options="LensPosition=1"

Adjust numbers as you see fit.

1 Like

A tip, in case someone runs into my trouble:

Cannot find encoder to convert from 'YUYV'

and

Cannot find encoder to convert from 'MJPG'

I had cut the amount of memory shared with the GPU down to 16MB on the Raspberry Pi (raspi-config) because "I won't need that because I'm not running a desktop".

Uh, nope. Back up to 128MB and the camera came right on (after hours of head-scratching).

I haven't determined the minimum GPU memory config for this.

While I was at it (and after I got the camera to come on), I moved the USB cable to one of the USB3 ports. Don't know if this was involved in the frame-freezing I got with prior setups, but I'm hoping I'm good on MJPG now.

Hi,
I'm using zero 2w with a V1 Pi camera, OctoPrint version: 1.10.1.

Currently, the only way is by using http://pizero.local/webcam/control to start streaming.
However, pizero.local/:8080/stream can't reach.

From the browser dev tool I found pizero.local/webcam/stream?_cb=1716623****** is working.

Hi there,

I am a bit confused on changing the options on the camera. Do i need to remove the flash card from the PI and then edit in /boot/camera-streamer/libcamera.conf` ?

Or can i also change the settings through putty?

you can change via putty with sudo nano /boot/camera-streamer/libcamera.conf. ctrl+s to save, ctrl+x to exit.

I see the options now but nothing changes if i add options. In the /webcam/control i can see changes if i make them but nothing changes in the /boot/camera-streamer/libcamera.conf file.

Are you restarting the camera streamer?

sudo service camera-streamer restart

If that doesn't work I suggest you start a get help topic and include everyone the template asks for.