mirror of
https://github.com/motioneye-project/motioneye.git
synced 2026-03-02 22:57:06 -05:00
Motioneye and Libcamera #2429
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#2429
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 @Schnitzer50 on GitHub (Aug 22, 2023).
Hello Motioneyeteam!
How long will it be before Motioneye also supports the new camera drivers for RPi?
Sonnige Grüße aus Ulm, Germany
@zagrim commented on GitHub (Aug 23, 2023):
Libcamera support is still "under construction", and that applies to the yet unreleased ME 0.43 with Python3 support. The topic has been discussed here: #2425 (and here: #2683).
As far as I've understood things correctly, there are some workarounds mentioned in #2683, but no complete solution yet. There is a PR (https://github.com/motioneye-project/motioneye/pull/2765) linked to the other issue and it is waiting for testing, with some instructions on how that could be done (but I admit they might not be good instructions in case one is not that tech-savvy).
@pingufreak commented on GitHub (Nov 18, 2023):
Hello Bello 🐶,
working with Debian Bookworm with current patchlevel:
In motionEye add the first camera.
Example:
Local V4L2 Camera
/base/soc/.../.../ov5647...
Please update the wiki, I can't do a pull-request on it 🙈 🙉 🙊:
Install on Debian 12 (Bookworm)
Greetings from Trier (Germany)
7 Edits 😀
Have a nice day!
pingufreak
@Martypose commented on GitHub (Nov 23, 2023):
@pingufreak
im gonna try your solution for bookworm in a pi4 8gb with a rpi cam ov5647
hope it works cause im losing my mind with motioneye haha
@Juanderer98 commented on GitHub (Nov 27, 2023):
@pingufreak,
Thank you for your suggestions... I (and others) have been struggling with this issue. I tried your suggestion on a fresh install of 64bit raspian bookworm on a RPi 4b 4Gb model. after trying to execute the third line I get:
...
**error: externally-managed-environment
This environment is externally managed**
...
I assume that this is a new "feature" of Debian Bookworm, that I haven't figured out yet. Is there a way to get motioneye to install directly, or a simple way to set up a venv?
Thank you for any suggestions...
@Juanderer98 commented on GitHub (Nov 27, 2023):
@pingufreak
I tried entering the third line:
python3 -m pip install 'https://github.com/motioneye-project/motioneye/archive/dev.tar.gz' --break-system-packages
in hopes of getting around the venv issue. It seemed to be working, but then got the following error. I'm not sure what next to try...
...
Collecting pycurl
Downloading pycurl-7.45.2.tar.gz (234 kB)
------------------------------------- 234.2/234.2 kB 491.7 kB/s eta 0:00:00
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
python setup.py egg_info did not run successfully.
exit code: 1
[26 lines of output]
Traceback (most recent call last):
File "/tmp/pip-install-gp3rsl8m/pycurl_3fffa710a6074f8d9ede04a2314e9dfb/setup.py", line 229, in configure_unix
p = subprocess.Popen((self.curl_config(), '--version'),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/subprocess.py", line 1024, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/lib/python3.11/subprocess.py", line 1901, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'curl-config'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "", line 2, in
File "", line 34, in
File "/tmp/pip-install-gp3rsl8m/pycurl_3fffa710a6074f8d9ede04a2314e9dfb/setup.py", line 970, in
ext = get_extension(sys.argv, split_extension_source=split_extension_source)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/pip-install-gp3rsl8m/pycurl_3fffa710a6074f8d9ede04a2314e9dfb/setup.py", line 634, in get_extension
ext_config = ExtensionConfiguration(argv)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/pip-install-gp3rsl8m/pycurl_3fffa710a6074f8d9ede04a2314e9dfb/setup.py", line 93, in init
self.configure()
File "/tmp/pip-install-gp3rsl8m/pycurl_3fffa710a6074f8d9ede04a2314e9dfb/setup.py", line 234, in configure_unix
raise ConfigurationError(msg)
ConfigurationError: Could not run curl-config: [Errno 2] No such file or directory: 'curl-config'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
Encountered error while generating package metadata.
See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
root@raspberrypi:/home/pi#
@zagrim commented on GitHub (Nov 27, 2023):
@Juanderer98 you seem to be missing
curl-config, which should be available inlibcurl4-openssl-devpackage which you need to install. And given that there are a couple of other additional packages for 64-bit RPis in the dev branch installation instructions (see step 1 here) you might need to install those, too.@pingufreak commented on GitHub (Nov 28, 2023):
Please read the logs / rtfm:
apt install -y curl-config
The other errors: bookworm doesn't come with python2, you really need to
install the dev version of motioneye with pip3.
On Tue, Nov 28, 2023, 4:37 AM Juanderer98 @.***> wrote:
@pingufreak commented on GitHub (Nov 28, 2023):
99,999999% of the time for fixing issues is reading logs / docs and
understanding in detail what's going on. If you just follow this advise,
you can get really good quite fast.
On Tue, Nov 28, 2023, 7:42 AM Ix Yps @.***> wrote:
@Schnitzer50 commented on GitHub (Nov 28, 2023):
Hello everyone, first of all thank you for the detailed information on how to improve MotionEye.For me as a simple user, the instructions are very confusing and I cannot estimate the consequences. Are there no easy update options for Motioneye? I still understand updates via the user interface or terminal instructions for Debian11, and I can also load them from GitHub. Best regards✉️ vom 🖥Am 28.11.2023 um 07:44 schrieb pingufreak @.***>:
99,999999% of the time for fixing issues is reading logs / docs and
understanding in detail what's going on. If you just follow this advise,
you can get really good quite fast.
On Tue, Nov 28, 2023, 7:42 AM Ix Yps @.***> wrote:
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>
@Juanderer98 commented on GitHub (Nov 28, 2023):
@pingufreak
Thank you for your guidance.
99,999999% of the time for fixing issues is reading logs / docs and
understanding in detail what's going on. If you just follow this advise,
you can get really good quite fast.
I'm still trying to find the applicable log file... I found '/var/log/apt/term.log' but this doesn't seem to have the information on errors. By docs, I'm guessing that would be the motioneye wiki, which I'm re-reading. The most recent error is below:
root@raspberrypi:/home/pi# sed -i 's//usr/local/bin/meyectl//usr/bin/libcamerify /usr/local/bin/meyectl/' /etc/systemd/system/motioneye.service
sed: can't read /etc/systemd/system/motioneye.service: No such file or directory
Any suggestions are most welcome.
@Juanderer98 commented on GitHub (Nov 28, 2023):
@pingufreak,
Thank you again for your guidance (and patience). Maybe I'm getting a little closer to understanding your suggestion to read logs / docs, but probably not. Anyway, I'm looking through the manual for the sed command. I'm guessing it is to modify the file motioneye.service in place, by replacing paths but I'm still stuck trying to find the original motioneye.service file. I tried to do 'find files' with the file manager, but no luck...
@ishetkunst commented on GitHub (Feb 20, 2024):
Thanks. This worked!
@Schnitzer50 commented on GitHub (Feb 21, 2024):
Please explain me how to easily update motioneye with libcamera. Thanks for your help.
@Schnitzer50 commented on GitHub (Feb 28, 2024):
My installed Motioneye version is 22.4.1. Is there already a newer version? If so, what is the easiest way to install it?
@CHARL13is commented on GitHub (Mar 1, 2024):
@pingufreak did you manage to write an article in the end? I'm trying to use Motioneye with an RPi 5 (Bookworm) with a Pi v2 NOIR camera but having tried all of the various advice and guides I cannot get this to work. What I could really do with is a step-by-step from a fresh install. It used to be so easy!
@Martypose commented on GitHub (Mar 2, 2024):
I would also appreciate some kind of basic guide for this same setup.
Thank you very much.
@jr3us commented on GitHub (Mar 10, 2024):
I have used the following instructions on my RPi 3b 32 bit bookworm and they worked fine.
I did have to download a tar.gz file directly from GitHub as there was no dev.tar.gz at the link below.
Thanks for the updates!
@birefringence commented on GitHub (Jun 2, 2024):
I have the original v1 camera module connected to a Pi Zero 2 W and the above instructions work in so far as that the module is detected. The picture I see, however, only consists of green stripes. I see some changes when I move the camera. Therefore, I conclude that data is transferred but there seems to be a problem with the pixel format. Everything looks fine directly with libcamera. I tried experimenting with the resolution and motion "palette" setting, but that was unsuccessful.
@fikin commented on GitHub (Jul 5, 2024):
to confirm these instructions worked for me too.
pi zero 2 w + noir 2 + debian bookworm
following main motioneye installation instructions did not render a working camera.
following https://lookslikematrix.de/raspberry-pi/2023/10/14/motion-bookworm.html rendered working motion but not motioneye.
after applying instruction from above, motioneye started working.
@Martypose commented on GitHub (Jul 7, 2024):
Same
Noir v1 IR torch
Bookworm clean install
Pi4 4gb
Working fine
Thanks @pingufreak
EDIT: also working with noir v3 cam
@jinky77 commented on GitHub (Oct 20, 2024):
Hi there! Reviving this thread as I'm also trying to install motioneye using @pingufreak's solution.
I stumbled upon
sed: can't read /etc/systemd/system/motioneye.service: No such file or directorylike @Juanderer98 did. I carefully followed the steps above, although I should mention that I did NOT installed motioneye using the official installation guide.Could any of you guys help me solve this? Thanks!
@Martypose commented on GitHub (Oct 20, 2024):
Create manually that file with
sudo nano /etc/systemd/system/motioneye.service
the content is something like
[Unit]
Description=motionEye Server
After=network.target
[Service]
ExecStartPre=/bin/mkdir -p /run/motioneye
ExecStartPre=/bin/chown root:root /run/motioneye
ExecStart=/usr/bin/libcamerify /homeYOURUSER/motioneye-env/bin/meyectl startserver -c /etc/motioneye/motioneye.conf
User=root
Group=root
Type=simple
Restart=on-failure
[Install]
WantedBy=multi-user.target
The reason you had to create the /etc/systemd/system/motioneye.service file manually is that this file defines how the motionEye service will be managed by systemd, which is the init system used in modern Linux distributions to manage services (including starting, stopping, restarting, and ensuring they run at boot).
Normally, when you install software through package managers (like apt), a service file is automatically created. However, in this case, since you are installing motionEye manually or from a custom method (such as a Python virtual environment), the service file isn't provided by default.
I think.
@jinky77 commented on GitHub (Oct 25, 2024):
Hey @Martypose thank you very much for taking the time to reply. I ended up not needing to manually set
motion.serviceafter all, here is what I did:sudo apt update && apt upgrade -y. I've used Raspberry Pi Imager to flash the SD cardpipinstallation instructions in point 2 since it was already installedlibcamera-v4l2withapt install -y libcamera-v4l2To anyone who might need help with, don't hesitate to write!
Edit: added details following @pookguy88's reply.
@pookguy88 commented on GitHub (Oct 29, 2024):
finally got it to work, I Have Raspberry Pi Zero 2 and the Arducam IMX708 - Raspberry Pi Imager and installed the latest Bookworm 64bit lite
followed @pingufreak's instructions
so I used Raspberry Pi Imager and installed the latest Bookworm 64bit lite. Went through everything and booted up Motioneye, couldn't detect my camera.
After reading @jinky77 's comment him saying pip was already installed, I realized I don't think libcamerify was installed on my Bookworm build
So in the
apt install -y libcamera-v4l2step of the instructions, you need to also have libcamera-tools, so add in:sudo apt-get install libcamera-toolsBecause the next step with the sed command is basically a find and replace and it just assumes you have libcamerify installed
So after doing all that and booting up Motioneye, I finally get it to work.
followed @pingufreak's instructions but for the life of me couldn't it get it work.
@mark4mike commented on GitHub (Nov 2, 2024):
Great thread, I've been trying to get an Arducam IMX708 Camera Module 3 to work with motioneye for a while on a Pi Zero 2 W. Thanks to @pingufreak, @jinky77, and @pookguy88! Just to add to this in case it helps anyone, I had to pretty much do a combo of everyone's steps to some degree and did have to end up installing
pip. Additionally, my camera would not work or get detected until doing the following from Arducam's Wiki:After the reboot I was able to add the camera in motioneye.
If it helps anyone, here were the steps I followed to get mine working:
pipinstalled from the link @jinky77 provided, following the steps based on my architecture. 64-Bit Bookworm in my case:libcamera-v412andlibcamera-tools/boot/firmware/config.txtas I mentioned above and then rebooted.After the last reboot I was able to add my camera like normal. Of course
libcamera-v412, andlibcamera-toolspackages can be installed before installing motionEye but this was just the order I did it in.Thanks all!
Edit: Updated "motionEyeOS" to say "motioneye" as @zagrim pointed out. :)
@zagrim commented on GitHub (Nov 4, 2024):
Thanks for all so far for sharing your solutions! 👍 👍 👍
One small clarification @mark4mike though to avoid confusion in others reading this: MotionEyeOS is a stripped-down Linux distro by itself, and what you were installing is the standalone MotionEye application 😃
@mark4mike commented on GitHub (Nov 4, 2024):
That's right, my mistake. The previous times I had played around with it I had always just flashed SD cards directly with motioneyeOS rather than installing it on Raspberry Pi OS. Thanks for clarifying!
@Matthew1471 commented on GitHub (Nov 28, 2024):
This thread has useful info spread across it and each of the provided advice is missing some commands.. Taking a microSD and putting Bookworm Lite 64 bit on it, using the imager customisation to give it the WiFi password and enable SSH and then booting and running:
Will get you going..
I also like:
Hope this saves someone a lot of time!
@mkalle333 commented on GitHub (Dec 25, 2024):
@Matthew1471
Thank you so much for the summary, it worked flawlessly on my Raspberry Model 4 B with Camera Module 3.
Might I suggest adding
#sudo systemctl enable motioneyeto start motioneye automatically on start/reboot
Or would it have done anyways? I am not sure.
@Matthew1471 commented on GitHub (Jan 21, 2025):
@mkalle333 you're welcome... no need to add enable.. the install script already does that.
I had issues with Wi-Fi on all my Raspberry Pi 4s due to a buggy driver (brcmfmac).. so I've now added this too:
@delanthear commented on GitHub (Jan 31, 2025):
Gah!
This all worked fine for me last week, amazing job pulling it together.
However though, after a reinstall (using Raspberry Pi OS Lite 64 bit this time rather than the full desktop install, could that be it?) I cannot get MotionEye to detect the camera. Any idea of where to look for clues? The camera is working as I just took a shot with it rpicam-stilll.
@Matthew1471 commented on GitHub (Jan 31, 2025):
I had issues sometimes installing packages due to a server error (HTTP 400).. so I'd check each command succeeded. Did you try a reboot after (so it's not in use with rpicam-still etc)? I use only Lite so it definitely works with Lite.. make sure you didn't select Legacy Lite?
@delanthear commented on GitHub (Feb 1, 2025):
Yeah, a re-image with the desktop version and it still not working. I followed these instructions exactly, with the same Pi and Camera before and it was fine, but not now.
Just looking at the output from the above commands, is any of this interesting?
After the apt-get -y dist-upgrade
and looks like it replaces libcamera0.3 with 0.4
this: (which I suspect has nothing to do with it)
I can see the camera here fine:
and the camera is working:
From what I can tell, the service config is set up to use libcamerify correctly:
Perhaps I damaged the camera somehow between when it was working before and now, but then why would I be able to take stills with it?
I'm far too clueless with linux to actually debug what's going on here, but from what I can see I can't find any errors or clues as to why it wouldn't be working. The dropdown just says (no cameras)
@Matthew1471 commented on GitHub (Feb 1, 2025):
@delanthear okay, I'm able to reproduce this.. so last night after your message I noticed there was some pending packages to update for libcamera (I auto upgrade every evening).. I let them update overnight.. rebooted the machine today and I also have the no camera message on a previously working install.
One of these being upgraded has broken motion... for existing and new installs.
Broken:
Working camera that I have yet to reboot:
Which looks to be due to a failing assertion inside libcamera (https://libcamera.org/api-html/controls_8h_source.html). Note that
libcamerahas gone from v0.3 to v0.4 - and motion is erroring because of it.http://archive.raspberrypi.com/debian/dists/bookworm/main/binary-armhf/Packages:
This should get you back (and block future updates back to 0.4 for libcamera-tools and libcamera-v4l2):
rpicam-apps-litewill remain uninstalled (I don't need it).. if you do just need to add the old deb for that too.@delanthear commented on GitHub (Feb 1, 2025):
Works! :D
@Matthew1471 commented on GitHub (Feb 5, 2025):
More people are having issues with libcamera0.4 and motion and there's now more details here:
https://github.com/raspberrypi/libcamera/issues/235
https://bugs.libcamera.org/show_bug.cgi?id=253
@bit-bash commented on GitHub (Feb 15, 2025):
Using an RPi 5 with RP Camera V3 with bookworm 64bit lite.
Had some issues after following: https://github.com/motioneye-project/motioneye/issues/2812#issuecomment-2506840345
Couldn't get the camera to work.
Turns out I actually have to do this line:
# apt-get -y install libcamera-v4l2 libcamera-toolsThat is, I uncommented it then my camera works. In the original post, I thought this line was commented out because it was part of the libcamera downgrading process.
I've got the very latest bookworm updates, so I didn't have to downgrade libcamera0.4 - it's now working.
@Matthew1471 commented on GitHub (Feb 17, 2025):
Yes the workaround is no longer required as they fixed it in the original repo : https://github.com/raspberrypi/libcamera/issues/235#issuecomment-2647863551
I'll remove my workaround from my instructions.
@delanthear commented on GitHub (Feb 17, 2025):
Ah great. Is there an easy way to regress the workaround?
On Mon, 17 Feb 2025, 18:56 Matthew, @.***> wrote:
@Rudios81 commented on GitHub (Feb 21, 2025):
I have been trying and debugging the Motioneye over the last 2 days, started to give up just when I stumbled on this thread.
In the end, I had to alter the motioneye.service file as indicated by @pingufreak making use of libcamerify
For some reason, it did not work when using the motion_binary declaration in the motioneye.conf file, neihter did the trick from some other thread, creating a motion.sh in my user home folder trying to start motion using libcamerify.
So altering the motioneye.service file by including libcamerify made my setu work!
RaspberryPI 4B+
RaspberryPI cam 3
@Matthew1471 commented on GitHub (Feb 21, 2025):
That's what
sed -i 's/\/usr\/local\/bin\/meyectl/\/usr\/bin\/libcamerify \/usr\/local\/bin\/meyectl/' /etc/systemd/system/motioneye.servicedoes in my instructions.. you may wish to check the other tweaks as there's a few other things to get things like Wi-Fi stable: https://github.com/motioneye-project/motioneye/issues/2812#issuecomment-2506840345@Rudios81 commented on GitHub (Feb 21, 2025):
That are indeed the changes I made.
I am working with a wired RPI4, so no wireless issues there.
On the other hand, been banging my head for 2 days now to get my new PI Zero 2W connected without any lick, maybe these tweaks are helpful for that, I'll take a look, thanks for suggesting.
@Matthew1471 commented on GitHub (Feb 21, 2025):
Don't run the 5 GHz only command on the Pi Zero 2W.. it does not support 5 GHz and you'll just get yourself disconnected (which if you're running headless is pretty annoying).. I use a lot of Pi4s just for the 5 GHz because I am running MotionEye as remote cameras and then having a central point. The reliability of 2.4 GHz for anything more than IOT is pretty bad these days given the congestion and interference on it.
If you had issues past few days make sure you do an
apt-get updateandapt-get dist-upgradeas there was a dodgy libcamera issue that has since been fixed but depending on when you installed you may still have the bad version.The
Fix motioneye dependenciessection uses the versions available in the Pi OS Debian repo rather than onpipas it's recommended to let package managers take care of system packages and only use pip for virtual environments.. the override pip limitation proposed is to turn off that restriction (motioneyeis itself a pip package that isn't in the debian repo) but my preference is always to do the right thing as much as possible and break it in limited and specific ways.@Matthew1471 commented on GitHub (Feb 21, 2025):
Sorry @delanthear for not replying sooner.. it's a one-liner to revert the
holdwe placed on a dependency being allowed to update:apt-mark unhold libpisp-commonThis tells
apt-getthat the dependencylibpisp-commonis allowed to update again and so everything else that wants updates that depends on that also being updated should then also update.Then assuming you'd like to update to all the new things:
@DifferentComputers commented on GitHub (May 30, 2025):
Just want to chime in here to say that after literally days of trying to get an ArduCam 8mp IMX219 working with MotionEye on Raspberry Pi OS lite, this command finally did the trick. Thank you!
Just for the search engines:
Linux Dash 6.12.25+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.12.25-1+rpt1 (2025-04-30) aarch64 GNU/Linux
[0:12:48.209860306] [2125] INFO Camera camera.cpp:1205 configuring streams: (0) 1640x1232-YUV420 (1) 1640x1232-SBGGR10_CSI2P
[0:12:48.210591034] [2128] INFO RPI vc4.cpp:622 Sensor: /base/soc/i2c0mux/i2c@1/imx219@10 - Selected sensor format: 1640x1232-SBGGR10_1X10 - Sel
@houserockr commented on GitHub (Jul 28, 2025):
This works like a charm! Thank you so much!!!
All it took was to start
meyectlthroughlibcamerify, unbelievable!Question tho:
I cannot change the resolution of my ov5647 camera from within the motioneye UI.
I mean, I can, but the picture will have the same resolution and motioneye just crops it weirdly.
Is there any way to pass arguments like
--widthand--heightfrom motioneye to whatever is called from libcamera?