Camera-streamer configuration on the new camera stack for OctoPi

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.