-
Notifications
You must be signed in to change notification settings - Fork 652
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RPi Camera 3 compatibility #2683
Comments
I just try RPI3b (MotionEyeOS) + RPI Camera 3, It's not work and still find the solution. |
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
Now, edit your
Depending on your debian distribution you might have to also install Now restart motioneye and you can configure your camera as a local camera on The information that led me to this solution was found here |
I tried this but unfortunately it doesn't work. A couple things I've noticed, though.
I edited my |
@MidnightLink I edited my post to correct the file and add the I think your issue is that you can't be running |
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! |
Best way might be to just pick any cameras, then shutdown motioneye and edit
Using bullseye on a pi zero w. |
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. |
Thanks @gpambrozio - I have it working to a point now - I can see the camera's feed. Unfortunately: 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? |
@johnm-w I tried just changing |
I have proceeded according to these instructions. The camera can now be integrated into MotionEye and a picture is displayed.
i also couldn't find out yet why the vido is so jerky ... I also noticed that after starting MotionEye the camera is addressed completely wrong. The settings from the file this is how it looks directly after the import.
After starting MotionEye everything is gone again.
Service-Status:
|
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. |
@gpambrozio My setup :
Some additional advices/observations:
|
For those who have gotten this workaround to work:
I just keep getting the following errors no matter what i try:
|
Update: This workaround worked on the 32-bit version of Bullseye using the Dev branch. |
Hey together, what am I doing wrong?
but no picture in the preview. |
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? |
Did you install the motioneye dev branch? https://github.com/motioneye-project/motioneye/tree/dev |
Hey @notabotscott thank you very much, the wrong installation was the problem. |
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. |
None of these worked for me on a rpi4 running latest 64 bit os. Really wish I could use this new camera. |
I have few cameras lying idle because of the issue and lack of time to dig into the issues. |
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.
Change the FPS to what you want. 1920x1080 is maximum resolution for the RPI hw codec as I think it's used here. |
@strips are you using this as a replacement for motioneye or 'just' (great idea :) ) as a streaming source / camera FOR motioneye? |
@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. |
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. |
@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. |
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 |
@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? |
All working now, thank you! |
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. Lg und Grüsse aus Ö ;-) |
You are welcome.
…On Sun, Dec 3, 2023, 11:06 AM D-an-W ***@***.***> wrote:
He copied just my answer... You need to escape the slashes.
… <#m_419337762933316581_>
All working now, thank you!
—
Reply to this email directly, view it on GitHub
<#2683 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/APZW37PPU2V7P4K6QNHN2TLYHRFKJAVCNFSM6AAAAAATVG7SCGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZXGQZTCMRXGA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
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? |
This solution works except autofocus, is any way to make the autofocus working? |
There are also easier ways to get a module3 stream into motion or motionplus. |
I was able to control the focus manually from the camera window by adding the action buttons:
Create zoom_out_1 script in the same folder:
Make them executable:
Now you should be able to control the camera focus manually straight from the camera window. |
@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 Dec 18 15:52:40 birdcam motion[765]: [1:ml1:Camera1] [ERR] [VID] v4l2_mmap_set: Error starting stream. VIDIOC_STREAMON: Invalid argument |
hello everyone, the instructions from @gpambrozio worked for me but I had to move 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. |
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 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. |
@Nuuki9 under buster the camera is listed under MMAL Camera, not V4L2 Camera. |
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. |
If you enable KMS ( Lacking time to look into this right now: Does someone know whether this really is a |
@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
|
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: |
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 libcamera-hello is giving msg sudo v4l2-ctl --device=/dev/video1 --all Need support struggling on this from long time. Not and expert but love to work with PI |
Tried this command getting msg |
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 <#1> , char 8: unknown option to `s'
—
Reply to this email directly, view it on GitHub <#2683 (comment)> , 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: ***@***.*** ***@***.***> >
|
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. |
Btw, an alternative to |
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. |
@raspberrypicoder1 apt install libcamera-v4l2 libcamera-tools
sed -i 's|^ExecStart=/usr/local/bin/meyectl|ExecStart=/usr/bin/libcamerify /usr/local/bin/meyectl|' /etc/systemd/system/motioneye.service
systemctl daemon-reload
systemctl restart motioneye |
Hi, it took me a while to find these commands but now my camera 3 works with motioneye, thanks. |
It is not enabled by default? This guide seems complete: https://www.tomshardware.com/how-to/raspberry-pi-camera-module-3-python-picamera-2 |
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. |
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:
This 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. |
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?
which need to be set either by code i.e. |
Will MotionEye, in its current state, be compatible with the new RPi cam 3?
https://www.raspberrypi.com/news/new-autofocus-camera-modules/
The text was updated successfully, but these errors were encountered: