mirror of
https://github.com/motioneye-project/motioneye.git
synced 2026-03-02 22:57:06 -05:00
Unable to Open Video Device after Resolution Change #2218
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#2218
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 @fictionalname on GitHub (May 11, 2022).
Hello folks,
I hope you can help with this strange issue.
Hardware : Pi Zero W with a wide angle IR camera with 2 IR lights bolted to the side
Software : DietPi, then MotionEye using their automated process.
Issue :
Please tell me how I can revive the connection to the camera.
If I’ve missed out any important info, please let me know.
Thanks muchly.
@MichaIng commented on GitHub (May 11, 2022):
Does the service log show anything related?
@fictionalname commented on GitHub (May 11, 2022):
Hi Michalng,
Thanks for taking the time to respond!
This is so confusing for me. I had the camera working very breifly again, but now it's not even opening the device, it's just the camera with a line through it. I'm guessing this is cause Motion is't running any more. I ran the command you suggested and I'm getting this :
Clearly it has been running but it's failing to launch now properly now. How can I find out why it is crashing?
I did notice that the GPU/RAM setting had gone back to 96 so I set it back to 128 again, but that hasn't helped.
I'm not sure if it is connected as I'm just grasping at straws here, but I changed the I2C state and SPI state and it seemed to work breifly but I don't really know what they do, and it may have just been the subsequent reboot which kicked it into life.
I have read that there may be some issues with Bullseye and the Pi cameras. Could this be causing the issue? If so, why does it seem to work very briefly then totally stop.
Any suggestions would be greatly appreciated as I've already flattened the SD and reinstalled DietPi to get to this stage, trying to get this to work.
Thanks!
@MichaIng commented on GitHub (May 14, 2022):
I2C and SPI are not required for running cameras on the RPi camera connector, AFAIK also 128 MiB RAM are probably reasonable but not strictly required.
Just to assure the camera with legacy stack is enabled correctly, and let's check for kernel errors as well:
@fictionalname commented on GitHub (May 15, 2022):
Morning,
Thanks for your next suggestion. Here is what I got from the 2 commands:
Supported & detected for the camera and no response at all from the dmseg command which I guess means no error messages?
Thanks.
@fictionalname commented on GitHub (May 15, 2022):
Further info:
I tried uninstalling MotionEye, reboot the reinstall and it is still failing to show the camera.
I noted as part of the install there was a permissions error writing to the /etc/motion folder so as a test I added the root user to the montion group (no change). It was in the install script so I didn't manage to read any other info around that error.
I also noted that the /etc/motioneye folder was the only one in the etc folder not owned by root (it was motion). Again as a test, I changed the owner to root. This had not effect, even after a reboot.
I also read on-line there may be issues with the motion detection so I switched it off in the GUI. I'm not getting additional erros in the log files:
Please let me know if you need any more information.
Thanks muchly.
@MichaIng commented on GitHub (May 19, 2022):
The
/etc/motionpermissions error is part of themotionpackage install step, hence outside of our control, but also not relevant for motionEye: We use own motion configs in/etc/motioneyeinstead, where permissions are granted correctly.Is btw the
motionservice running? AFAIK it could conflct:The error btw occurs here, where we try to detect the motion detection status for the camera via HTTP API request:
github.com/motioneye-project/motioneye@16fd474/motioneye/motionctl.py (L213-L231)@fictionalname commented on GitHub (May 22, 2022):
Hi again,
Thanks for the further suggestion.
I tried running those commands to disable motion but it had no effect.
I have just erased the SD card did the following:
The hardware is a Pi Zero with no additional hardware, other than the IR camera with 2 external IR lights.
After I did this, the MMAL camera was detected for a small amount of time and showed the picture in MotionEye as I would expect.
I made no further changes, and the image from the camera froze and would not update.
The motioneye log looks like this:
The window for the camera image is showing Unable to open video device.
Is this just my setup or are other people having this issue?
Thanks for your help!
@MichaIng commented on GitHub (May 22, 2022):
It always triggers the watchdog timeout, then fails to terminate, then is SIGKILLed, then shows
VIDIOC_S_FMT: : Device or resource busy. Is the old motion process probably still running, blocking the video device? Check in e.g.htop.@fictionalname commented on GitHub (May 22, 2022):
It seems that the only version of motion running is the one associated with MotionEye:
@MichaIng commented on GitHub (May 22, 2022):
Hmm, no
motionprocess is running at all 🤔.There other error is
v4l2_pixfmt_select: Palette selection failed for format UYVY, probably a motion setting is invalid (in combination with this camera). Is there a color/pixel/palette format option which you can change?@fictionalname commented on GitHub (May 22, 2022):
Hmmm, how strange. I can't figure this out at all! It's just a base build of DietPi with MotionEye on top.
It's just the standard Pi IR camera like this : https://shop.pimoroni.com/products/night-vision-camera-module-for-raspberry-pi?variant=12516582817875
Where would I change these settings?
@MichaIng commented on GitHub (May 22, 2022):
I mean in the motionEye camera settings.
Found a match in the RPi forum, also IR camera: https://forums.raspberrypi.com/viewtopic.php?t=317258
Good suggestion to check whether something else is accessing the video device:
And: https://forums.raspberrypi.com/viewtopic.php?t=323606
Probably there are generally issues with the legacy camera stack on Bullseye 🤔. When using libcamera and V4L2 tools, probably it works to add it as V4L2 camera. But I remember from other reports here that somehow a large number of devices is then listed for a single camera and none of them works. Still, worth to give it a try:
@don-dolarson commented on GitHub (Jun 11, 2023):
I'd like to share with my findings as I was fighting 3 days to get things cooperate and finally got it to work.
My problem was a grey preview window with "unable to open device" text, no matter what I did, until now.
Raspberry Pi Model B Rev 2, Raspberry OS Buster 2023-05-03, AZ-Delivery 5mp OV5647 ribbon camera.
https://github.com/motioneye-project/motioneye/tree/dev#installation
motionEye Version | 0.43.0
Motion Version | 4.5.1
OS Version | Raspbian 10
Whenever system starts, running services are:

It results in:
After running:
Running services are:
Resulting in:
Raspberry Pi Model B Rev 2 (same CPU as Zero W) is too weak for this task however. Updating repos and upgrading/installing packages takes forever, CPU is constantly at 100% usage when not recording (!) but preview video is set at a reasonable 24fps. When recording it 99% of time crashes with:
So... I grabbed Raspberry Pi 3B, flashed sdcard with latest Raspberry Pi OS Bullseye 64-bit build from 2023-05-03, upgraded packages, reproduced all steps above and guess what. IT WORKS too, the same way it does on Buster. Just enable the legacy camera in raspi-config, add MMAL VideoCore Camera, stop motion service and voila.
I've tested the most important things of motion and motioneye, and that is motion and recording/taking pictures. So far no problem.
Things doesn't work after a restart since motion service starts automatically so I believe cron task at bootup to stop motion needs in action here. I've couple of weeks linux experience so my knowledge is limited so tell me guys, is there a better option than running cron at every bootup to stop motion service?
PS. H.264/OMX codec doesn't work but changing it to H.264 solves the ffmpeg error (ffmpeg package installed ofc).
ffmpeg is already the newest version (7:4.3.6-0+deb11u1+rpt1).@FlorianCassayre commented on GitHub (May 9, 2025):
Indeed, stopping
motionseems to have done the trick. Thanks for pointing that out.