Pi Camera V3/IMX Chipset Based Cameras Not Working

I just received the new pi camera V3
I thought it would be a straight swap for my camera V2.1, but I dont get a picture/video.

I have run a full apt update/upgrade but still doesnt detect the camera
Is there an update I can run in putty to enable the camera or update drivers?

There is no webcamd.log

Pi Camera V3
No Picture/video
Full apt update and upgrade
OctoPrint version 1.8.6, OctoPi version 0.18.0

1 Like

If I remember correctly from reading about the V3 camera it is using a different sensor than the V2.1 which requires a different driver. Software support may require a "Bullseye" based OS but OctoPi version 0.18.0 is based on "Buster". There is a release candidate of OctoPI 1.0.0-rc3 which is based on "Bullseye".

On "Buster" you probably need to install the libcamera software.

https://www.raspberrypi.com/documentation/accessories/camera.html

https://www.raspberrypi.com/documentation/computers/camera_software.html

1 Like

Yes it uses the Sony IMX708 sensor.
Even in the official bullseye image, I had up do a full apt update/upgrade to get the drivers.
Even then it didnt work with my Pi 3B+, I had to enable Glamor graphics which is a temporary fix apparantly.
So I have it working in Bullseye using libcamera - it all works as expected. The quality is great and the autofocus feature is very good.

Once I confirmed the camera was working I tried installing libcamera on Octopi Buster but have not been succesful so far.

I then tried the Octopi Bullseye image (1.0.0 RC3 from October I think) and couldnt get libcamera to work either.

I even tried installing Octopi/octoprint on the offical bullseye image but still cant get Octoprint to see the camera even though libcamera works.

Will have to go back to my V2.1 until someone smarter than me writes a guide I think!

Yeah from a quick read of the RPi blog post announcing it, they aren't supported by the legacy camera stack. To view a webcam in OctoPrint you need some other streaming software (OctoPrint doesn't stream itself). MJPG streamer (that is used on OctoPi) has not been updated in a long time and so I don't think there is a chance that it will be supported there. We will have to find some alternative camera streaming software, that is compatible with libcamera.

ayufan/camera-streamer is one such project I know of, that you could give a go to see if it works.

1 Like

I have the same problem

v3 wide cam works on Release Candidate 1.0.0rc3 with mjpg-streamer-experimental from GitHub - ArduCAM/mjpg-streamer: Fork of http://sourceforge.net/projects/mjpg-streamer/

what I've done!

sudo apt-get update && sudo apt-get upgrade

sudo apt install -y libcamera-dev libjpeg-dev
sudo apt install -y cmake libboost-program-options-dev libdrm-dev libexif-dev

edit
config.txt
Replace start_x=1 with dtoverlay=imx708

edit
octopi.txt
add to end of file
camera="libcamera"
camera_libcamera_options="-r 1280x720"

reboot

test libcamera with
libcamera-hello

Then use this guide:
https://docs.arducam.com/Raspberry-Pi-Camera/Native-camera/OctoPrint/

skip the first part of the guide
start with:"3.2. Test

6 Likes

I can confirm this works on the 1.0.0 RC3 Bullseye image - webcam and snapshot work.
I did notice that the auto focus didnt work with this method where it did with the official Bullseye image.
The camera Settings plugin works to manually control the focus though.

I also tried on the current Buster image and wouldnt work.
Lets hope 1.0.0 is realeased soon with libcamera and streamer baked in.

Thank you Stefan for the help

1 Like

You might want to pipe up in the 1.0.0rc3 issue ticket.

Hey how did you get the manual focus control to show up?
I installed the plugin suggested in that Arducam post and got everything else working (finally!) but the plugin settings shows lots of things but not focus. New to OctoPrint/OctoPi so any help much appreciated!

Thanks @Stefan for all this

Thanks @Stefan, those instructions got the camera working on the 1.0.0 RC3 Bullseye image!

Is any one else able to record a time lapse though? I'm able to view the cam, but attempting to have octoprint generate a Timelapse always fails after the print is done and it's compiling the time lapse. Throws up an ffmpeg error/dialog.

Rendering of timelapse PTFE Organizer_0.6n_0.3mm_PETG_MK3SMMU2S_2h6m_20230115172423 failed with return code -9

ffmpeg version 4.3.5-0+deb11u1+rpt2 Copyright (c) 2000-2022 the FFmpeg developers
,  built with gcc 10 (Raspbian 10.2.1-6+rpi1)
,  configuration: --prefix=/usr --extra-version=0+deb11u1+rpt2 --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-mmal --enable-neon --enable-rpi --enable-v4l2-request --enable-libudev --enable-epoxy --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-vout-drm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared --libdir=/usr/lib/arm-linux-gnueabihf --cpu=arm1176jzf-s --arch=arm
,  WARNING: library configuration mismatch
,  avutil      configuration: --prefix=/usr --extra-version=0+deb11u1+rpt2 --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-mmal --enable-neon --enable-rpi --enable-v4l2-request --enable-libudev --enable-epoxy --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-vout-drm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --libdir=/usr/lib/arm-linux-gnueabihf/neon/vfp --cpu=cortex-a7 --arch=armv6t2 --disable-thumb --enable-shared --disable-doc --disable-programs
,  avcodec     configuration: --prefix=/usr --extra-version=0+deb11u1+rpt2 --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-mmal --enable-neon --enable-rpi --enable-v4l2-request --enable-libudev --enable-epoxy --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-vout-drm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --libdir=/usr/lib/arm-linux-gnueabihf/neon/vfp --cpu=cortex-a7 --arch=armv6t2 --disable-thumb --enable-shared --disable-doc --disable-programs
,  avformat    configuration: --prefix=/usr --extra-version=0+deb11u1+rpt2 --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-mmal --enable-neon --enable-rpi --enable-v4l2-request --enable-libudev --enable-epoxy --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-vout-drm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --libdir=/usr/lib/arm-linux-gnueabihf/neon/vfp --cpu=cortex-a7 --arch=armv6t2 --disable-thumb --enable-shared --disable-doc --disable-programs
,  avdevice    configuration: --prefix=/usr --extra-version=0+deb11u1+rpt2 --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-mmal --enable-neon --enable-rpi --enable-v4l2-request --enable-libudev --enable-epoxy --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-vout-drm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --libdir=/usr/lib/arm-linux-gnueabihf/neon/vfp --cpu=cortex-a7 --arch=armv6t2 --disable-thumb --enable-shared --disable-doc --disable-programs
,  avfilter    configuration: --prefix=/usr --extra-version=0+deb11u1+rpt2 --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-mmal --enable-neon --enable-rpi --enable-v4l2-request --enable-libudev --enable-epoxy --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-vout-drm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --libdir=/usr/lib/arm-linux-gnueabihf/neon/vfp --cpu=cortex-a7 --arch=armv6t2 --disable-thumb --enable-shared --disable-doc --disable-programs
,  avresample  configuration: --prefix=/usr --extra-version=0+deb11u1+rpt2 --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-mmal --enable-neon --enable-rpi --enable-v4l2-request --enable-libudev --enable-epoxy --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-vout-drm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --libdir=/usr/lib/arm-linux-gnueabihf/neon/vfp --cpu=cortex-a7 --arch=armv6t2 --disable-thumb --enable-shared --disable-doc --disable-programs
,  swscale     configuration: --prefix=/usr --extra-version=0+deb11u1+rpt2 --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-mmal --enable-neon --enable-rpi --enable-v4l2-request --enable-libudev --enable-epoxy --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-vout-drm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --libdir=/usr/lib/arm-linux-gnueabihf/neon/vfp --cpu=cortex-a7 --arch=armv6t2 --disable-thumb --enable-shared --disable-doc --disable-programs
,  swresample  configuration: --prefix=/usr --extra-version=0+deb11u1+rpt2 --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-mmal --enable-neon --enable-rpi --enable-v4l2-request --enable-libudev --enable-epoxy --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-vout-drm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --libdir=/usr/lib/arm-linux-gnueabihf/neon/vfp --cpu=cortex-a7 --arch=armv6t2 --disable-thumb --enable-shared --disable-doc --disable-programs
,  postproc    configuration: --prefix=/usr --extra-version=0+deb11u1+rpt2 --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-mmal --enable-neon --enable-rpi --enable-v4l2-request --enable-libudev --enable-epoxy --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-vout-drm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --libdir=/usr/lib/arm-linux-gnueabihf/neon/vfp --cpu=cortex-a7 --arch=armv6t2 --disable-thumb --enable-shared --disable-doc --disable-programs
,  libavutil      56. 51.100 / 56. 51.100
,  libavcodec     58. 91.100 / 58. 91.100
,  libavformat    58. 45.100 / 58. 45.100
,  libavdevice    58. 10.100 / 58. 10.100
,  libavfilter     7. 85.100 /  7. 85.100
,  libavresample   4.  0.  0 /  4.  0.  0
,  libswscale      5.  7.100 /  5.  7.100
,  libswresample   3.  7.100 /  3.  7.100
,  libpostproc    55.  7.100 / 55.  7.100
,Input #0, image2, from '/home/pi/.octoprint/timelapse/tmp/PTFE Organizer_0.6n_0.3mm_PETG_MK3SMMU2S_2h6m_20230115172423-%d.jpg':
,  Duration: 00:00:01.76, start: 0.000000, bitrate: N/A
,    Stream #0:0: Video: mjpeg (Baseline), yuvj420p(pc, bt470bg/unknown/unknown), 4608x2592 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 25 tbn, 25 tbc
,Stream mapping:
,  Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
,Press [q] to stop, [?] for help
,[swscaler @ 0x128a390] deprecated pixel format used, make sure you did set range correctly
,[libx264 @ 0x126a840] using SAR=1/1
,[libx264 @ 0x126a840] using cpu capabilities: ARMv6 NEON
,[libx264 @ 0x126a840] profile High, level 6.0, 4:2:0, 8-bit
,[libx264 @ 0x126a840] 264 - core 160 r3011 cde9a93 - H.264/MPEG-4 AVC codec - Copyleft 2003-2020 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=1 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=abr mbtree=1 bitrate=10000 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
,Output #0, mp4, to '/home/pi/.octoprint/timelapse/.PTFE Organizer_0.6n_0.3mm_PETG_MK3SMMU2S_2h6m_20230115172423-fail.mp4':
,  Metadata:
,    encoder         : Lavf58,.45.100
,    Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 4608x2592 [SAR 1:1 DAR 16:9], q=-1--1, 10000 kb/s, 25 fps, 12800 tbn, 25 tbc
,    Metadata:
,      encoder         : Lavc58.91.100 libx264
,    Side data:
,      cpb: bitrate max/min/avg: 0/0/10000000 buffer size: 0 vbv_delay: N/A
,[Parsed_movie_1 @ 0x126fed0] EOF timestamp not reliable
,frame=    2 fps=0.0 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
,frame=    4 fps=2.7 q=0.0 size=       0kB time=00:00:00.00 bitrat,e=N/A speed=   0x    
,frame=    6 fps=2.7 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
,frame=    8 fps=2.7 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
,frame=   10 fps=2.6 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
,frame=   12 fps=2.6 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
,frame=   14 fps=2.6 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
,frame=   16 fps=2.6 q=0.0 size=       0kB time=00:00:00,.00 bitrate=N/A speed=   0x    
,frame=   18 fps=2.6 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
,frame=   20 fps=2.6 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
,frame=   22 fps=2.6 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
,frame=   24 fps=2.6 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
,frame=   26 fps=2.6 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
,frame=   28 fps=2.7 q=0.0 size=       0kB tim,e=00:00:00.00 bitrate=N/A speed=   0x    
,frame=   30 fps=2.7 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
,frame=   32 fps=2.7 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
,frame=   34 fps=2.7 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
,frame=   36 fps=2.7 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
,frame=   38 fps=2.8 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
,frame=   40 fps=2.8 q=0.0 size=    ,   0kB time=00:00:00.00 bitrate=N/A speed=   0x    
,frame=   42 fps=2.8 q=25.0 size=     256kB time=-00:00:00.07 bitrate=N/A speed=N/A    
,frame=   43 fps=1.5 q=32.0 size=     256kB time=-00:00:00.03 bitrate=N/A speed=N/A    
,frame=   44 fps=1.5 q=32.0 size=     256kB time=00:00:00.00 bitrate=26891487.2kbits/s speed=2.58e-06x    
,frame=   44 fps=1.4 q=32.0 size=     256kB time=00:00:00.00 bitrate=26891487.2kbits/s speed=2.42e-06x   

I have been messing around with ayufan/camera-streamer based on @jneilliii comments on Add support for raspberry pi camera V3.

I was able to get the v3 working without latency I was getting with the earlier process.

I will post my process after I test it with OctoPrint as I tested it on the latest Raspberry Pi 32bit Lite OS.

Make sure to test with the 1.0.0rc3 version of OctoPi image as the base OS will need to be bullseye I think for the camera-streamer app.

The base of the RaspOS 32bit Lite I used is Bullseye.

I manually installed OctoPrint using a guide from this forum and everything is working for me.

Not tested time lapse and I had to create a custom service file to get it to work.

I will be testing the RC3 soon.

I have the same problem, the official TimeLapse doesn't work and the Octolapse Plugin doesn't work with this camera, I also have the problem that the camera connects and disconnects while it is transmitting:

Done bringing up all configured video devices
/root/bin/webcamd: line 116: 8362 Segmentation fault LD_LIBRARY_PATH=. ./m jpg_streamer -o "output_http.so -w $camera_http_webroot $camera_http_options" -i "$input" (wd: /opt/mjpg-streamer)
Scanning again in two minutes

Does anyone know why this could be?
Thanks in advance

I tested RC3 this week using the following process:

sudo systemctl octoprint stop && sudo systemctl disable octoprint
sudo systemctl webcamd stop && sudo systemctl disable webcamd
sudo systemctl ffmpeg_hls stop && sudo systemctl disable ffmpeg_hls
sudo apt-get update && sudo apt-get -y dist-upgrade
sudo reboot
git clone --recursive -j8 GitHub - ayufan/camera-streamer: High-performance low-latency camera streamer for Raspberry PI's
sudo apt-get -y install libavformat-dev libcamera-dev liblivemedia-dev
cd camera-streamer/
make
sudo make install (This takes a while)
sudo reboot
cd camera-streamer/service
sudo nano camera-streamer-pi708-12MP.service
paste below

;
; Official Raspberry Pi v3 12MP camera based on the Sony IMX708 chip
; https://www.raspberrypi.com/products/camera-module-3/
;
[Unit]
Description=camera-streamer web camera
After=network.target
ConditionPathExists=/sys/bus/i2c/drivers/imx708/10-001a/video4linux

[Service]
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

DynamicUser=yes
SupplementaryGroups=video i2c
Restart=always
RestartSec=10
Nice=10
IOSchedulingClass=idle
IOSchedulingPriority=7
CPUWeight=20
AllowedCPUs=1-2
MemoryMax=250M

[Install]
WantedBy=multi-user.target

Ctrl + X to close and Y to save
sudo systemctl enable $PWD/camera-streamer-pi708-12MP.service && sudo systemctl start camera-streamer-pi708-12MP
sudo systemctl enable octoprint && sudo systemctl start octoprint

Webcam feeds works fine using default Webcam settings in Octoprint.

3 Likes

I've written a script based on Dark360's comments. It will install everything and reconfigure boot and systemd to use camera-streamer.

cam3install.sh

[Update 2023-02-05: Updated release in post 72 with 1080p and autofocus.]

#!/bin/bash

# Script to add Raspberry Pi Camera Module 3 to octopi 1.0 RC3
# Combining work from octoprint forums:
# https://community.octoprint.org/t/pi-camera-v3-not-working/49022/16
# https://community.octoprint.org/t/add-support-for-raspberry-pi-camera-v3/49052/5
#
# Tested on a clean install of Jan 20, 2023 Nightly build:
# 2023-01-20_2022-09-22-octopi-bullseye-arm64-lite-1.0.0
#

sudo systemctl stop webcamd && sudo systemctl disable webcamd
sudo systemctl stop octoprint && sudo systemctl disable octoprint
sudo systemctl stop ffmpeg_hls && sudo systemctl disable ffmpeg_hls

sudo apt-get update && sudo apt-get -y dist-upgrade

# do we need to reboot here ? I don't think so

sudo apt-get install -y libavformat-dev libcamera-dev liblivemedia-dev libjpeg-dev
sudo apt install -y cmake libboost-program-options-dev libdrm-dev libexif-dev


git clone --recursive -j8 https://github.com/ayufan/camera-streamer.git
cd camera-streamer/
make
sudo make install

# create 708 service
cat > service/camera-streamer-pi708-12MP.service << EOF
;
; Official Raspberry Pi v3 12MP camera based on the Sony IMX708 chip
; https://www.raspberrypi.com/products/camera-module-3/
;
[Unit]
Description=camera-streamer web camera
After=network.target
ConditionPathExists=/sys/bus/i2c/drivers/imx708/10-001a/video4linux

[Service]
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

DynamicUser=yes
SupplementaryGroups=video i2c
Restart=always
RestartSec=10
Nice=10
IOSchedulingClass=idle
IOSchedulingPriority=7
CPUWeight=20
AllowedCPUs=1-2
MemoryMax=250M

[Install]
WantedBy=multi-user.target

EOF

# update config.txt
sudo sed -i 's/start_x=1/dtoverlay=imx708/g' /boot/config.txt


#update octopi.txt
cat << EOF | sudo tee -a /boot/octopi.txt > /dev/null

#enable libcamera
camera="libcamera"
camera_libcamera_options="-r 1280x720"
EOF


# enable services

sudo systemctl enable $PWD/service/camera-streamer-pi708-12MP.service
sudo systemctl enable octoprint


#sudo reboot


The script pasted above is what I am using at the time of this post.
The link is to a file in github that I will update as changes are made.

[Update 2023-02-05: Updated release in post 72 with 1080p and autofocus.]

7 Likes

Hi, I've used the script above and the camera is indeed working in Octoprint now(required a couple restarts to show up, but it works), however the image is always out of focus. I cannot find any information anywhere on how to trigger the autofocus built into the module, does anyone know?

Mine seems to be focused correctly, but I wasn't convinced it was autofocusing so much as dumb luck :slightly_smiling_face:

If I figure it out I'll post a followup and update the script. If anyone else figures it out, please feel free to update the script as well.

I've also noticed that the resolution doesn't match what is specified in the service file so there may be an issue passing parameters.

I figured out why you had to reboot a couple times. The service is skipped if the driver hasn't loaded before systemd tries to start it.

I've commented out the ConditionPathExists line and added an ExecPreStart instead. That seems to ensure it tries to restart.

#ConditionPathExists=/sys/bus/i2c/drivers/imx708/10-001a/video4linux

[Service]
ExecStartPre=/usr/bin/test -e /sys/bus/i2c/drivers/imx708/10-001a/video4linux

I've updated the script in github with this change.

2 Likes