Pi Camera V3/IMX Chipset Based Cameras Not Working

I've been testing some configuration through the streamer web interface. I'll do more over the weekend and see if I can incorporate some into the service file, but for now, can some of you try the following. It should enable autofocus for the full range.

http://octopi:8080/option?AfRange=2
http://octopi:8080/option?AfMode=2

1 Like

Thanks @ltlowe - I applied those changes. Could not see any discernible difference in the control view (it does not adjust focus on its own - is that what you were expecting?) but I've found that manual focus through 'Camera Settings' now stays responsive

Thank you for testing.
I was expecting those to turn on autofocus, but wasn't convinced with my setup. I'll try some more options on the weekend.

I take it back!!

It just occurred to me - could Camera Settings plugin be overriding auto-focus. I deactivated that plugin, restarted octopi an there we go - auto-focus seems to be working. Great job @ltlowe

1 Like

Confirmed, works for me as well, without the Camera Settings loaded. Thanks ltlowe.

Confirmed this worked for me also -- thanks all!!

To automatically enable autofocus, change camera-streamer-pi708-12MP.service and add the options to the ExecStart statement so it looks like this:

ExecStart=/usr/local/bin/camera-streamer \
  -camera-path=/base/soc/i2c0mux/i2c@1/imx708@1a \
  -camera-type=libcamera \
  -camera-format=YUYV \
  ; 2304x1296-YUV420
  -camera-width=2304 -camera-height=1296 \
  -camera-fps=30 \
  ; use two memory buffers to optimise usage
  -camera-nbufs=2 \
  ; the high-res is 2304x1296
  -camera-high_res_factor=2 \
  ; the low-res is 576x324
  -camera-low_res_factor=4 \
  ; bump brightness slightly
  ; -camera-options=brightness=0.1 \
  -rtsp-port \
  ; make sure autofocus is on
  -camera-options=AfMode=2 \
  -camera-options=AfRange=2 \

I have not updated the cam3install script yet as I'm trying a few other things first.

is this bit required for all camera types or just the imx708? I assume you can choose the best format from the results of v4l2-ctl --list-formats-ext (ie x264 for direct video copy to HLS).

There are some other examples installed in the services directory as part of camera-streamer. Two of them use YUYV, one uses JPEG. If you're setting it up for a different camera type, I'd say try different values and see what works.

I'm actually having a weird delay in generating the snapshot for Octolapse. Within Octoprint the stream is snappy and responsive, and removing the camera settings plugin reenables autofocus which is also working great in the stream. The V3 can focus up much more closely than most of the webcams I've tried.

The issue is that there's a long delay in aquiring the snapshot for Octolapse that seems to be much longer than any other camera I've used.

I've tried editing settings for snapshot/stream in both octoprint and Octolapse but I haven't been able to reduce the delay in acquiring the snapshot to a usable level. This thread has been great in helping me troubleshoot but this is beyond me.

My timelapses are the same as you. I tried to increase the snap delay in octolapse with no sucess. I even increased it to 5000ms with no luck. The snap are always inconsistent, some are timed and other are after the 5000ms pause before snap.
My camera setting plugin too is desabled.

So I've seen the v3 Camera working happily in octoprint on the Rpi 3A+, fast response time, but only at 0.1fps in obico. I presume octolapse would be fine as it uses the same mechanism as octoprint. Curious where obico falls down... Guess we're a bit ahead of the curve regarding 3rd party software support :person_shrugging:

Obico normally runs it's own streaming setup to power the 25fps streaming to their service. This won't be compatible with libcamera, but if you install camera-streamer using the instructions here and then switch Obico to 'compatibility mode' then it might work.

1 Like

Any sense where I can look to see when this support will be in a version of Octoprint by default? I'd rather not go through a whole process that may be updated later anyway.

Thanks!

@Charlie_Powell has already started working on a libcamera plugin that incorporates these changes and will be usable in OctoPrint 1.9.0, which splits the webcam features out into a plugin.

1 Like

Don't count on it being available in OctoPi for a little while - as the cameras require the use of libcamera, all old streaming software is not compatible with them. camera-streamer is a new project, and Arducam have forked mjpg streamer to provide libcamera compatibility, but there is no guarantee that either of them will be included by default 'soon'.

The process described with the script above is dead easy, I would recommend doing it.

Don't rely on the plugin that @jneilliii has posted being available for a little while either, as I might not have the time to finish it!

I can follow instructions well enough but installing a nightly build is concerning given the risk for other potential issues introduced. A plugin model is easy enough to enable/disable, but have some worry using anything other than the main stream image. I appreciate you doing this at all! I just don't want to risk having any downtime.

Well, the 1.0.0rc3 version seems stable enough, which is not nightly.

I will also note that regardless of what you do you'll need newer software than the 0.18 OctoPi image. Even if there is a plugin that sets up the streaming (mine is just an experiment) then it still needs the 1.0.0 image to start with.

I feel better about it being in a RC vs a nightly. Reading through the thread it wasn't 100% clear to me. Glad it is now.