mirror of
https://github.com/motioneye-project/motioneye.git
synced 2026-03-02 22:57:06 -05:00
RPi Camera 3 compatibility #2350
Labels
No labels
Android app
Arch Linux
CI/CD
CSS
FreeBSD
HTML/HTTP
Home Assistant addon
JavaScript
Python
Raspberry Pi
Stale No Activity 60 Days
bug
code format
dependencies
dev branch
docker
documentation
duplicate
enhancement
feature
help wanted
i18n/l10n
invalid
legacy motionEye
meta
motion
motionEyeOS
notourproblem
python update
question
question
security
troubleshooting
wontfix
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/motioneye#2350
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Firesphere on GitHub (Jan 9, 2023).
Will MotionEye, in its current state, be compatible with the new RPi cam 3?
https://www.raspberrypi.com/news/new-autofocus-camera-modules/
@hotducker commented on GitHub (Jan 21, 2023):
I just try RPI3b (MotionEyeOS) + RPI Camera 3, It's not work and still find the solution.
@gpambrozio commented on GitHub (Jan 21, 2023):
I found a way to make it work with the current motioneye version on a pi zero w with the new camera module 3.
First, create a file named
motion.shin/home/pi:Now, edit your
motioneye.conffile (should be in/etc/motioneye) and make sure that the line withmotion_binarylooks like this:Depending on your debian distribution you might have to also install
libcamera-toolswithsudo apt-get install libcamera-toolsNow restart motioneye and you can configure your camera as a local camera on
/dev/video0The information that led me to this solution was found here
@MidnightLink commented on GitHub (Jan 21, 2023):
I tried this but unfortunately it doesn't work. A couple things I've noticed, though.
motioneye.shis actuallymotioneye.confand the correct chmod permissions need to be given to themotion.shlibcamera-toolshas to be installedI edited my
camera-1.confand changed the video device to/dev/video0and when runninglibcamera-helloI'm getting a message that the device is in use...so it feels like it's close!@gpambrozio commented on GitHub (Jan 22, 2023):
@MidnightLink I edited my post to correct the file and add the
libcamera-tools(I didn't need that as I have the latest debian and it already includes it).I think your issue is that you can't be running
libcamera-hello(or any other application that tries to use the camera) when you start motioneye@johnm-w commented on GitHub (Jan 26, 2023):
Hi @gpambrozio - can you explain how to do this? In MotionEye, Add Camera, I select "Local V4L2 Camera" from the "Camera Type" dropdown, then it lists several options for "Camera". With the module 2 camera, I had to try each one until I found the one that worked, but I can't manually enter a device path.
Also, please can you let me know the exact OS you're running? I tried your fix on Buster & Bullseye with no luck (on an RPi4).
Thanks!
@gpambrozio commented on GitHub (Jan 27, 2023):
Best way might be to just pick any cameras, then shutdown motioneye and edit
camera-1.conf(probably in/etc/motioneye) and make sure that thevideodeviceline isvideodevice /dev/video0. The start motioneye again.Using bullseye on a pi zero w.
@MisterEmm commented on GitHub (Jan 27, 2023):
Tried this earlier on a Pi 3B with the latest Bullseye release, fresh install of motioneye, followed the steps above and it works well, I can see the view from the camera via the web interface. For now it doesn't seem to want to let me make any changes, keeps saying "Refresh Recommended" if I try to change resolution or something. I can see the changes reflected in camera-1.conf but the display doesn't change. Will have another poke at it tomorrow, but grateful to have got this far thanks to the previous posts.
@johnm-w commented on GitHub (Jan 27, 2023):
Thanks @gpambrozio - I have it working to a point now - I can see the camera's feed. Unfortunately:
I don't see all the camera's controls in the Video Device section (like I do with the camera module 2) and performance isn't great.
And like @MisterEmm , If I make any changes via the web app: "An error occurred. Refreshing is recommended." - but refreshing does appear to persist settings
I've also had very similar results running:
libcamera-vid -t 0 --inline -o - | cvlc stream:///dev/stdin --sout '#rtp{sdp=rtsp://:8554/stream1}' :demux=h264
(https://www.raspberrypi.com/documentation/computers/camera_software.html#libcamera-vid)
Then adding the camera as a network camera in motioneye using:
rtsp://localhost:8554/stream1
then selecting the UDP option that appears.
Neither option seems as quite as good as when I'm using the v2 camera - but maybe I just need to experiment/tweak more. Or hopefully someone with the right skills can update motioneye.
Also, @gpambrozio please could you explain what your motion.sh script does?
@gpambrozio commented on GitHub (Jan 27, 2023):
@johnm-w
motion.shis a wrapper to make motion uselibcamerifyas described in this document. Without that/dev/video0doesn't work as motion expects it.I tried just changing
motion_binarytolibcamerify motionbut that doesn't work so I created this simple script to trick motioneye.@ReneMuetti commented on GitHub (Jan 28, 2023):
I have proceeded according to these instructions. The camera can now be integrated into MotionEye and a picture is displayed.
https://github.com/motioneye-project/motioneye/issues/2683#issuecomment-1399367885
but unfortunately errors are still written to the log file:
i also couldn't find out yet why the vido is so jerky ...
and how I activate the nightvision mode I have also not yet figured out
I also noticed that after starting MotionEye the camera is addressed completely wrong. The settings from the file
/usr/share/libcamera/ipa/raspberrypi/imx708_wide.jsonwere all deleted again.this is how it looks directly after the import.
After starting MotionEye everything is gone again.
Service-Status:
@mgrn0 commented on GitHub (Feb 11, 2023):
unfortunately I could not get my camera module 3 to work via any of the suggestions above with a raspberry pi 4 / b running bullseye. Really hope the new cameras will be supported without workarounds in motioneye soon.
@MaRaGaWa commented on GitHub (Mar 14, 2023):
@gpambrozio
It works ! Many thanks !
My setup :
Some additional advices/observations:
@notabotscott commented on GitHub (Mar 22, 2023):
For those who have gotten this workaround to work:
I just keep getting the following errors no matter what i try:
@notabotscott commented on GitHub (Mar 23, 2023):
Update: This workaround worked on the 32-bit version of Bullseye using the Dev branch.
Legacy camera support was not needed.
Cameras were added as V4L2.
@B4n4n3 commented on GitHub (Mar 26, 2023):
Hey together, what am I doing wrong?
motioneye.confby following the instructions.camera-1.conf->videodevice /dev/video0but no picture in the preview.
@dber01 commented on GitHub (Mar 27, 2023):
Camera works with Raspberry Pi 4, Bullseye OS 32-bit lite and motionEye (dev) up to 4608 / 2592 (legacy camera not enabled). Only one issue, neither storage (/var/lib/motioneye/Camera1 empty) nor FTP upload seems to work. Anybody facing same issue?
@notabotscott commented on GitHub (Mar 27, 2023):
Did you install the motioneye dev branch? https://github.com/motioneye-project/motioneye/tree/dev
Also, did you install libcamera-tools?
sudo apt install libcamera-tools@B4n4n3 commented on GitHub (Mar 31, 2023):
Hey @notabotscott
thank you very much, the wrong installation was the problem.
I had already installed the libcamera tools.
But i had to install the motioneye dev branch.
@BobSmithPi commented on GitHub (May 7, 2023):
Thank you for this workaround. I was able to get my camera module 3 working fine except for adding parameters in the config. Is there any way to change brightness, exposure and lens-position? I've tried adding them different ways in the config file and nothing seems to work. Any help would be greatly appreciated.
@bigOconstant commented on GitHub (May 15, 2023):
None of these worked for me on a rpi4 running latest 64 bit os. Really wish I could use this new camera.
@m4rky-m4rk commented on GitHub (May 16, 2023):
I have few cameras lying idle because of the issue and lack of time to dig into the issues.
@strips commented on GitHub (May 16, 2023):
I never got the libcamerify to work but still feel it should have. Might give it a new try one day. Anyways the motion project is old and will never support the new cameras using libcamera. MotionEye should maybe start looking at transitioning to motionPlus (when python3 has reached maturity) as it seems a replacement wich is actively developed. motionPlus works with libcamera.
I found this solution online and you need screen and ngnix installed. I created a shell script to start by boot in crontab. This has been stable now for some months. This is the first time I ever used ngnix. The two processes use maybe 5% CPU in average. It can support a good FPS but I keep it low for motion detection.
# cat /root/start_rpicam3_stream.sh# crontab -l# cat /etc/nginx/nginx.confnetcam_url rtmp://localhost/live/streamChange the FPS to what you want. 1920x1080 is maximum resolution for the RPI hw codec as I think it's used here.
@mgrn0 commented on GitHub (May 16, 2023):
@strips are you using this as a replacement for motioneye or 'just' (great idea :) ) as a streaming source / camera FOR motioneye?
@strips commented on GitHub (May 16, 2023):
@mgrn0, I'm using this with motionEye. Effectively creating a network stream from the camera and configuring motionEye to use the stream as a source. All running on the same RPI4.
@bigOconstant commented on GitHub (May 16, 2023):
I'm kinda confused on what you are using screen for here and why it's needed. But I like the concept of connecting to it as a network stream. That's a great idea I'll play with this this weekend.
@strips commented on GitHub (May 16, 2023):
@bigOconstant screen is a simple (ugly) way to run a background process. Could probably use nohup or set up proper daemon instead. I tried nohup but one of the commands did not like the limited environment and went back to screen.
@strips commented on GitHub (May 19, 2023):
I got libcamerify to partially work by compiling Motion from source. My next issue was that MotionEye did not seem to detect the running process of Motion when using the wrapper and got a lot of crash loops. So close, I decided to see if I could fix this in the code to eliminate the need for an external wrapper script. In my own fork I have implemented support for libcamerify and it can be configured in motioneye.conf. So far it seems to work pretty good. The only issue seems to be setting parameters for the camera. I'll probably create a PR for my fix. Anyways the code is here: https://github.com/strips/motioneye/tree/feature/libcamerify
@github-0 commented on GitHub (May 20, 2023):
@strips Thanks for the instructions for libcamera+ffmpeg combo as I couldn't get the libcamerify method to work with camera module 3 (1.1 worked fine) and what's more, with libcamerify there is no way(?) to set camera parameters which is a must in my use case.
I had to add -re parameter to ffmpeg -y -re -i /root/stream -s 1920x1080 -r 5 -c:v copy -b:v 1500k -maxrate 5000k -bufsize 10000k -g 60 -f flv rtmp://localhost/live/stream as otherwise ffmpeg was not reading the input in real time, reached end of file and quit.
One question about the named pipe (fifo) though - it seems this file (/root/stream) keeps increasing in size. How did you solve this?
@strips commented on GitHub (May 21, 2023):
@github-0 np!
I found the link where I found the workaround: https://www.wetransco.de/debian-bullseye-libcamera-and-motion-on-a-raspberry-pi-with-the-new-camera-module-v3-a-great-workaround/
Using rtsp-simple-server should/could be a much simpler approach. I tested this for an hour before switching to libcarmerify and it worked at least as well. The advantage is that it's only one binary/command to run. If needed I could post the config file I made.
@bigOconstant commented on GitHub (May 21, 2023):
Thanks @strips I got it to work with your script in the same fashion and your 60 second sleep make it work after a minute on restart which is great.
Full instructions for others would involve, starting from blank rasbian os, installing nxinx, follow the install motion-eye instructions from dev branch, adding the nginx config file and then doing whats in the above comment and it works.
@RippinAndTerran commented on GitHub (Jun 10, 2023):
Hey @strips if you had the chance to upload your config file for rtsp-simple-server that would be amazing! I am pretty new at all of this and after a few days of trying things it is hard to tell where I need to dedicate my efforts to get it up and running. I am about to go down the ngnix road but since rtsp-simple-server is supposed to be easier I am a little apprehensive since I can't even get that to work.
@techd4ve commented on GitHub (Jun 14, 2023):
Hi Guys! Thanks for the workaround, it worked really well.
I also have the "apply" error bug but thing could be worse.
Do you may know how I can adjust the focus of the Cam module 3?
My Problem is that something is in front of the cam (left side ca. 25% of the image and top 40% of the image) and because of that, the Autofocus is not adjusted correctly. Is there any change I can set up a certain point for the autofocus or set it to manuell focus on that certain point?
I tried something with the tuning file but I didn't seem to work (maybe I also did it wrong)
Anybody an Idea how to fix it?
@renatomserra commented on GitHub (Jun 30, 2023):
thanks for the solution @strips with this approach does the HD picture on motion function work or is it just the video stream?
@strips commented on GitHub (Jul 3, 2023):
@RippinAndTerran
Sorry for the long delay. I put the file on github below. I haven't used MediaMTX since I tested it but I'lll probably go back to it. I'm having issues with libcamerify and keep having to restart the daemon.
github.com/strips/stuff@c8b10f50fa/hakkebo_rpi/MotionEyeConfig/mediamtx/mediamtx.yml@strips commented on GitHub (Jul 3, 2023):
@RenatoSerra22
Which of the 3 solutions are you referring to :-)
Workaround with ffmpeg and nginx
Works pretty well but a lot of moving parts. HD picture works in stream and motion. But when triggering a motion it slows down and lags alot.
Workaround with rtsp-simple-server / MediaMTX
Works pretty well and replaces both ffmpeg and nginx processes in the first workaround. HD picture works in stream and motion. But when triggering a motion it slows down and lags alot. The added benefit MediaMTX has a lot og options to control the camera. Seems they have exposed most of the settings in libcamera API. Still I have not testes many of the options.
Libcamerify compatabilitylayer
Rather unstable. I keep having to restart the motionEye daemon. Not really sure but it might be enough to just restart the motion process. It might be my motionEye patch that does not work properly and motionEye is not able to detect the issue and restart motion.
Personally I will go back to number 3.
@kendoka15 commented on GitHub (Jul 5, 2023):
@strips Thanks for the ffmpeg+nginx method, works well. Something I noticed is that your libcamera-vid command for some reason includes --hdr 1 which gave me subtle horizontal lines in good lighting and highly visible ones in low light especially when boosting the gain. I removed it and all is fine.
Libcamerify didn't work for me because from what I gather I couldn't have access to all the libcamera settings. I haven't tried MediaMTX yet as I needed a solution pretty quickly but if everything is controllable including shutter speed and gain I'll be trying it soon.
I ended up feeding the stream from the camera Pi Zero W to a Pi 4 I'm also using for Home Assistant and Samba as the Pi Zero 2 W I was previously using with MotionEye OS couldn't run MotionEye at 1080p 10fps without overheating (the camera has to work well in 40C weather). MotionEye OS previously worked fine in those conditions at 720p but either the resolution bump is too much or there was some hardware accelerated special sauce in MotionEye OS that isn't there in MotionEye.
Anyway, thanks again
@D-an-W commented on GitHub (Sep 22, 2023):
Got it working thanks, I had to change the permissions of the
motion.shfile before it would show the camera however.I used 755, not sure if thats the best choice?
@Stepyon commented on GitHub (Oct 29, 2023):
Autofocus doesn't work for me at all with "libcamerify" script workaround. Have you found how to make it working?
@Ghosti10 commented on GitHub (Nov 9, 2023):
Ok guys , the trick is super easy.
The Module3 Cam has issues with motioneye.
but it is working perfcet with Spyglass. Here is the trick: Install spyglass, start run.py -r 800x600 which is creating a stream. (http://127.0.0.1:8080/stream) check this out for installation: https://robertmarks.cloud/posts/2023/02/setting-up-pi-camera-module-3-in-mainsailos/ (credits to Rob Marks)
then install Motioneye: https://github.com/motioneye-project/motioneye/wiki/Install-on-Raspbian-Bullseye
then DO NOT ADD MJPEG Cam in motioneye. Add a NETWORK Camera in motioneye,
and you have a perfect working motioneye with motion detection . And YES, autofocus is working as well. Enjoy
@pingufreak commented on GitHub (Nov 18, 2023):
Much easier:
https://github.com/motioneye-project/motioneye/issues/2812#issuecomment-1817391735
@clds84 commented on GitHub (Nov 23, 2023):
Trying this now, but I don't have a 'pi' directory following /home to create a motion.sh file. Referencing other pi projects, pi would be a user, right? Is this critical if I'd be referencing it's path in the motioneye.conf file as something like /home/motion.sh?
@pingufreak commented on GitHub (Nov 23, 2023):
Hi,
just change the systemd config as described.
Kr
Pingufreak
On Thu, Nov 23, 2023, 6:27 AM clds84 @.***> wrote:
@Ghosti10 commented on GitHub (Nov 25, 2023):
@clds84: i tried this solution first, but motion detection was not proper. Hopefully your solution will work for you. :)
@Juanderer98 commented on GitHub (Nov 27, 2023):
I gave this a try but had problems toward the end. I had set up a raspian Bullseye 64bit system on a RPi4b 4Gb machine and was able to view the RPi camera v3 preview but in following the instructions to install motioneye on Bullseye I wound up installing python 2 pip. Motioneye worked but then spyglass would no longer work. I tried entering:
~/spyglass $ ./run.py -r 1920x1080
in a terminal window, which had worked before the motioneye install, but now it gets an error from an incorrect version (I think) of python. Is there a way to direct the machine to use python3 for spyglass?
@strips commented on GitHub (Nov 28, 2023):
Did you try Motioneye dev branch? It's based on Python 3. Not sure with the builds but I think they are based on the default (old) python2 version.
@Peuz85 commented on GitHub (Nov 30, 2023):
RaspiOs bookworm 64 bit with raspicam v3 (finally works)
sudo apt update && sudo apt upgrade -ysudo apt --no-install-recommends install ca-certificates curl python3 python3-dev libcurl4-openssl-dev gcc libssl-devgrep -q '\[global\]' /etc/pip.conf 2> /dev/null || printf '%b' '[global]\n' | sudo tee -a /etc/pip.conf > /dev/nullsudo sed -i '/^\[global\]/a\break-system-packages=true' /etc/pip.confsudo curl -sSfO 'https://bootstrap.pypa.io/get-pip.py'sudo python3 get-pip.pyrm get-pip.pysudo python3 -m pip install --pre motioneyesudo apt install -y libcamera-v4l2sudo apt install -y libcamera-toolssudo motioneye_initsudo sed -i 's/\/usr\/local\/bin\/meyectl/\/usr\/bin\/libcamerify \/usr\/local\/bin\/meyectl/' /etc/systemd/system/motioneye.servicesudo systemctl daemon-reloadsudo systemctl enable motioneyesudo reboothttp://yourpiaddress:8765/
It can happen that when changes are made in the MotionEye, the message “unable to open video device” appears.
sudo reboot(takes a little longer) and then it worksHave fun ;-)
@MichaIng commented on GitHub (Nov 30, 2023):
Ah right. Note that this file will be restored on any Python update. There is a CLI option and hence a config option you can use to override the effect of
EXTERNALLY-MANAGED:We need to add this to our install docs.
Some background on this: In theory it is possible, if you install Python modules via
aptand then the same module or its dependencies viapip, to create incompatibilities. Hence Debian decided to place this flag to preventpipinstalls outside ofvenv/virtualenv. However, we literally never faced a case where apipinstall broke another Python module installed viaapt, sincepippulls all needed dependencies, puts them into different directories (/usr/localinstead of/usr) where they override any previously installed APT package. And we are maintaining an own distribution which offers software installs like motionEye and does a lot ofpipinstalls, so we have some significant sample size 😉. It is good to know about the different ways to install Python modules, and that modules installed via APT become redundant/obsolete when you install the same viapip, and that they in theory can conflict (to remember in case one really faces an issue). But blocking it in a way that one needs to search the web for workarounds/solutions is IMO wrong.@D-an-W commented on GitHub (Dec 3, 2023):
@Peuz85, just trying your method thanks!
I see the message below, is that normal?
Also, what type of camera do I select please?
@Peuz85 commented on GitHub (Dec 3, 2023):
I select the first cam in the drop down menu and it works.
I don't see that message... I just installed Motioneye again and didn't get any errors
@D-an-W commented on GitHub (Dec 3, 2023):
Any idea what the error means or how to fix it as the camera doesn't currently work following your guide to the letter?
@pingufreak commented on GitHub (Dec 3, 2023):
He copied just my answer... You need to escape the slashes.
On Sun, Dec 3, 2023, 8:03 AM D-an-W @.***> wrote:
@D-an-W commented on GitHub (Dec 3, 2023):
All working now, thank you!
@Peuz85 commented on GitHub (Dec 3, 2023):
Du hast leider keine schritt für schritt anleitung geschrieben. Mit deiner "anleitung" so wie du sie geschrieben hast, ging leider gar nichts. Zudem kommt bei bookworm immer der fehler mit "... externally Environment" und dies muss man auch erst mal umgehen.
Danke für deine vorarbeit.
Lg und Grüsse aus Ö ;-)
@pingufreak commented on GitHub (Dec 3, 2023):
You are welcome.
On Sun, Dec 3, 2023, 11:06 AM D-an-W @.***> wrote:
@D-an-W commented on GitHub (Dec 3, 2023):
When using the Camera Module 3 and the working method above, what are the best camera and recording settings (Using a Zero 2 W currently) you have found?
@Stepyon commented on GitHub (Dec 4, 2023):
This solution works except autofocus, is any way to make the autofocus working?
@axeljerabek commented on GitHub (Dec 5, 2023):
There are also easier ways to get a module3 stream into motion or motionplus.
Just updated my old article and I have this setup running:
https://www.wetransco.de/debian-bookworm-and-libcamera-module-3/
@Stepyon commented on GitHub (Dec 8, 2023):
I was able to control the focus manually from the camera window by adding the action buttons:

sudo nano /etc/motioneye/zoom_in_1
Create zoom_out_1 script in the same folder:
sudo nano /etc/motioneye/zoom_out_1
Make them executable:
sudo chmod +x zoom_in_1
sudo chmod +x zoom_out_1
Now you should be able to control the camera focus manually straight from the camera window.
@haklan commented on GitHub (Dec 18, 2023):
@Peuz85 I installed motion on Bookworm according to your instruction and trying to setup a RPI HQ camera but I got "UNABLE TO OPEN VIDEODEVICE" in the stream. Reboot does not help. Got "VIDIOC_STREAMON: Invalid argument" in systemctl status. Do you have any ideas?
● motioneye.service - motionEye Server
Loaded: loaded (/etc/systemd/system/motioneye.service; enabled; preset: enabled)
Active: active (running) since Mon 2023-12-18 15:44:51 CET; 8min ago
Main PID: 561 (meyectl)
Tasks: 10 (limit: 765)
CPU: 10min 22.668s
CGroup: /system.slice/motioneye.service
├─561 /usr/bin/python3 /usr/local/bin/meyectl startserver -c /etc/motioneye/motioneye.conf
├─734 /usr/bin/python3 /usr/local/bin/meyectl startserver -c /etc/motioneye/motioneye.conf
└─765 /usr/bin/motion -n -c /etc/motioneye/motion.conf -d 5
Dec 18 15:52:40 birdcam motion[765]: [1:ml1:Camera1] [ERR] [VID] v4l2_mmap_set: Error starting stream. VIDIOC_STREAMON: Invalid argument
Dec 18 15:52:40 birdcam motion[765]: [1:ml1:Camera1] [ERR] [VID] vid_start: V4L2 device failed to open
Dec 18 15:52:50 birdcam motion[765]: [1:ml1:Camera1] [WRN] [ALL] mlp_retry: Retrying until successful connection with camera
Dec 18 15:52:50 birdcam motion[765]: [1:ml1:Camera1] [ERR] [VID] v4l2_fps_set: Error setting fps. Return code -1
Dec 18 15:52:50 birdcam motion[765]: [1:ml1:Camera1] [ERR] [VID] v4l2_mmap_set: Error starting stream. VIDIOC_STREAMON: Invalid argument
Dec 18 15:52:50 birdcam motion[765]: [1:ml1:Camera1] [ERR] [VID] vid_start: V4L2 device failed to open
Dec 18 15:53:00 birdcam motion[765]: [1:ml1:Camera1] [WRN] [ALL] mlp_retry: Retrying until successful connection with camera
Dec 18 15:53:00 birdcam motion[765]: [1:ml1:Camera1] [ERR] [VID] v4l2_fps_set: Error setting fps. Return code -1
Dec 18 15:53:00 birdcam motion[765]: [1:ml1:Camera1] [ERR] [VID] v4l2_mmap_set: Error starting stream. VIDIOC_STREAMON: Invalid argument
Dec 18 15:53:00 birdcam motion[765]: [1:ml1:Camera1] [ERR] [VID] vid_start: V4L2 device failed to open
@JustGlowing commented on GitHub (Jan 2, 2024):
hello everyone, the instructions from @gpambrozio worked for me but I had to move
motion.shin/usr/binand adjust themotioneye.confaccordingly. Hope this helps somebody :-)Edit: While the camera worked, motion detection didn't as libcamerify/motion were going in segmentation fault. I downgraded to Buster and everything worked out of the box.
@Nuuki9 commented on GitHub (Jan 10, 2024):
I previously tried Bookwork using instructions from @gpambrozio and had some success, but autofocus and changing settings didn't work, and I don't think motion detection did either.
Based on comments from @JustGlowing I've just tried Buster but I don't see any cameras listed at all when I select
Local V4L2 Camera.Clearly there are a lot of approaches being taken and all the work being put in is really appreciated. However with such a long thread and with differing methods its hard to nail down which ones work and with what caveats. Would it be feasible for us as a group to briefly write up any working methods in the wiki (or elsewhere), so we have a set of instructions that can be maintained and updated?
I bought the parts to make my mother a birdbox for her 80th, and so far its still on my workbench not working. As spring approaches I'd love to have this up and running for her.
@JustGlowing commented on GitHub (Jan 10, 2024):
@Nuuki9 under buster the camera is listed under MMAL Camera, not V4L2 Camera.
@Nuuki9 commented on GitHub (Jan 10, 2024):
I'm pretty sure I checked that.
Currently Im testing the method @Peuz85 provided - that's actually working perfectly, expect the focus (as noted). I'll try adding the manual focus buttons and testing the motion capture, but hopefully it'll end up working.
@MichaIng commented on GitHub (Jan 23, 2024):
If you enable KMS (
dtoverlay=vc4-kms-v3d), it is listed under V4L2. This is just the default since Bullseye. However, that way it is not working withoutlibcamerify.Lacking time to look into this right now: Does someone know whether this really is a
motionissue, simply not supporting the new libcamera API, so thatmotionplusis required, or is there something else we can do our end to make it functional withmotionwithout an API wrapper/emulator likelibcamerify?@strips commented on GitHub (Feb 4, 2024):
@MichaIng This is the only reference to libcamera in Motion I can find: https://motion-project.github.io/motion_config.html
I believe I read somewhere that Motion will not get native support for libcamera. MotionPlus is the way to go forward. I'm using only MotionPlus now where I was using Motion with MotionEye before. Works pretty good after lots of fiddling with the config files. I miss the ease of MotionEye.
To create the confusion absolute the RPI-guys have renamed libcam to rpicam: https://www.raspberrypi.com/documentation/computers/camera_software.html
@axeljerabek commented on GitHub (Feb 4, 2024):
At the moment, I run motionplus and am quite happy with it. Still, from the Raspberries, I feed the stream directly from the libcamera-apps (or the newer version) into the rtmp module from nginx and feed motion(plus) with this stream as netcam. Makes the softwares a bit more independend and I can actually create the stream on the Raspberry directly as h264 stream and motion records without reencoding, that saves a lot of power on the Raspberry side, so that I even have a few small Raspberry Zeros as camera platforms, since the motion software runs on an Intel Nuc11 which has a lot more power and can pickup the streams of 6 cameras. As said, not to be reencoded, that is one big advantage, and also the Raspberries are not overcomputing any motion parts. Still you are free where you run your motion software, can also be on a Raspberry. My setup is partly documented here:
https://www.wetransco.de/2023/12/raspberry-pi-zero-2w-debian-bookworm-und-libcamera-module-2-3-streaming/
@mishramahim commented on GitHub (Feb 10, 2024):
Hi I tried this process MotioneyeOS is working under camera showing unicam using /dev/video0 but it is still showing “unable to open video device”
using aarch64
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debia
libcamera-hello is giving msg
Unable to set format: Device or resource busy
v4l2-ctl --list-devices
unicam (platform:3f801000.csi):
/dev/video0
/dev/video1
/dev/media3
sudo v4l2-ctl --device=/dev/video1 --all
Driver Info:
Driver name : unicam
Card type : unicam
Bus info : platform:3f801000.csi
Driver version : 6.1.73
Capabilities : 0xa5a00001
Video Capture
Metadata Capture
Read/Write
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x25a00000
Metadata Capture
Read/Write
Streaming
Extended Pix Format
Media Driver Info:
Driver name : unicam
Model : unicam
Serial :
Bus info : platform:3f801000.csi
Media version : 6.1.73
Hardware revision: 0x00000000 (0)
Driver version : 6.1.73
Need support struggling on this from long time. Not and expert but love to work with PI
@mishramahim commented on GitHub (Feb 10, 2024):
Tried this command
sudo sed -i 's//usr/local/bin/meyectl//usr/bin/libcamerify /usr/local/bin/meyectl/' /etc/systemd/system/motioneye.service
getting msg
sed: -e expression #1, char 8: unknown option to `s'
@pingufreak commented on GitHub (Feb 10, 2024):
Hi,
you need to escape the / with /.
Kr
pingu
Von: mishramahim @.>
Gesendet: Samstag, 10. Februar 2024 18:47
An: motioneye-project/motioneye @.>
Cc: pingufreak @.>; Comment @.>
Betreff: Re: [motioneye-project/motioneye] RPi Camera 3 compatibility (Issue #2683)
Tried this command
sudo sed -i 's//usr/local/bin/meyectl//usr/bin/libcamerify /usr/local/bin/meyectl/' /etc/systemd/system/motioneye.service
getting msg
sed: -e expression #1 https://github.com/motioneye-project/motioneye/issues/1 , char 8: unknown option to `s'
—
Reply to this email directly, view it on GitHub https://github.com/motioneye-project/motioneye/issues/2683#issuecomment-1937081191 , or unsubscribe https://github.com/notifications/unsubscribe-auth/APZW37KMGJ2SKVLNYYS2F6TYS6XCZAVCNFSM6AAAAAATVG7SCGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZXGA4DCMJZGE .
You are receiving this because you commented. https://github.com/notifications/beacon/APZW37JYGF3ZRBV45PEE3ODYS6XCZA5CNFSM6AAAAAATVG7SCGWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTTOWBWO.gif Message ID: @.*** @.***> >
@mishramahim commented on GitHub (Feb 15, 2024):
It was working with the solution shared but camera stop working after 5 to 6hrs of operation and it start showing issues. Raspberry Pi 2 W Zero was heating up I shifted to 4B with good heatsink but is is still working 5 to 6 hours.
Any other method of using camera module 3 with bookwork Raspberry pi 4B
@mishramahim commented on GitHub (Feb 18, 2024):
Hi can anyone help My camera is getting detected but not working. I used other camera(RPI 1.3) with same cable and same is working fine.


@MichaIng commented on GitHub (May 13, 2024):
Btw, an alternative to
libcamerifyis to create a local network stream viarpicam-vid(previouslyraspivid) and attach that as network camera to motionEye: https://www.raspberrypi.com/documentation/computers/camera_software.html#network-streamingBut not sure about performance implications.
@raspberrypicoder1 commented on GitHub (May 15, 2024):
I've just read through this, and am really confused. Can anyone give a step-by-step tutorial for Raspberry Pi OS 64bit, on a raspberry pi 4? I am using the camera module 3.
@MichaIng commented on GitHub (Jul 3, 2024):
@raspberrypicoder1
After following the motionEye install instructions: https://github.com/motioneye-project/motioneye?tab=readme-ov-file#installation
@letkan commented on GitHub (Jul 4, 2024):
Hi, it took me a while to find these commands but now my camera 3 works with motioneye, thanks.
The next thing to figure out is how to enable autofocus in this context (not being a programmer).
Any help would be appreciated.
@MichaIng commented on GitHub (Jul 4, 2024):
It is not enabled by default?
This guide seems complete: https://www.tomshardware.com/how-to/raspberry-pi-camera-module-3-python-picamera-2
Not sure whether this is in scope for motionEye. Probably if someone is just in mood and has the time to implement a nice GUI to toggle it, using this or another picamera Python module. On my end, I'll implement
libcamerifyfirst, so that it is offered to be installed automatically, when libcamera API is detected on Raspberry Pi, and probably calling the internalmotioninstances withlibcamerify, instead of the wholemeyectlprocess. But not sure yet which one is better, performance-wise of for other reasons. The benefit of wrappingmeyectlitself is, that the RPi camera module appears as regular V4L2 camera 🤔.@letkan commented on GitHub (Jul 9, 2024):
As per my test, autofocus is not implemented by default. The guide you mention is complete but the requirements are both libcamera and picamera2 and I haven't seen a way to use them with Motioneye.
Meanwhile I switched to Motionplus which plays much nicer with this camera and allows option for continuous autofocus and all. To me it looks like the way forward is libcamera instead of v4l2. I don't like loosing the nice web interface of Motioneye to config files but overall, the final setup works better in my case. Motionplus has a web interface also but it is rudimentary by comparison.
@shooftie commented on GitHub (Jul 9, 2024):
RPi 3 Model A+ (aarch64) – DietPi v9.6.1 – RPi Camera Module v3 Noir
I tried everything in this thread and the only thing that worked for me was:
devbranch (I did this viadietpi-software)apt install libcamera-v4l2 libcamera-toolssed -i 's/\/usr\/local\/bin\/meyectl/\/usr\/bin\/libcamerify \/usr\/local\/bin\/meyectl/' /etc/systemd/system/motioneye.serviceThis was the key for me.
Pretty sure that this was a fresh install of Diet-Pi, too. I will give it another flash and report back if otherwise.
@letkan commented on GitHub (Jul 9, 2024):
I'm on the same OS/version, are you saying with the above settings (which I've also used) you got autofocus working without any other config settings, "out-of-the-box", so to speak?
For libcamera:autofocus there are 3 states:
which need to be set either by code i.e.
picam2.set_controls({"AfMode": controls.AfModeEnum.Continuous})or in a .conf file as in Motionplus. That's what I've learned so far.
@Hedi2525 commented on GitHub (Oct 15, 2024):
How do you install the Dev Branch without using the dietpi software?
Thanks in advance.
@xandark commented on GitHub (Apr 3, 2025):
You can install the latest motioneye right from git like this:
sudo python3 -m pip install --break-system-packages git+https://github.com/motioneye-project/motioneye.gitMakes the installation easy again.