motioneye-project / motioneye

A web frontend for the motion daemon.
GNU General Public License v3.0
3.87k stars 651 forks source link

Motioneye freezes with "mjpg client timed out" every few days #1544

Open Dinth opened 4 years ago

Dinth commented 4 years ago

Im running Motioneye official docker container. Normally it works perfectly fine with 4-5 network cameras but every few days Motioneye all streams break down. Some cameras are showing image frozen several hours ago and some streams are completely offline. Logs show

   ERROR: mjpg client timed out receiving data for camera 3 on port 8083
   ERROR: mjpg client timed out receiving data for camera 1 on port 8081
   ERROR: mjpg client timed out receiving data for camera 1 on port 8081
   ERROR: mjpg client timed out receiving data for camera 1 on port 8081
   ERROR: mjpg client timed out receiving data for camera 1 on port 8081
   ERROR: mjpg client timed out receiving data for camera 1 on port 8081
wzbart commented 4 years ago

Im running Motioneye official docker container. Normally it works perfectly fine with 4-5 network cameras but every few days Motioneye all streams break down. Some cameras are showing image frozen several hours ago and some streams are completely offline. Logs show

   ERROR: mjpg client timed out receiving data for camera 3 on port 8083
   ERROR: mjpg client timed out receiving data for camera 1 on port 8081
   ERROR: mjpg client timed out receiving data for camera 1 on port 8081
   ERROR: mjpg client timed out receiving data for camera 1 on port 8081
   ERROR: mjpg client timed out receiving data for camera 1 on port 8081
   ERROR: mjpg client timed out receiving data for camera 1 on port 8081

Have you found the solution? I'm running in to very same issue.

Dinth commented 4 years ago

No i havent so far. I have removed a couple of cameras from motion eye leaving just three. The situation has improved slightly. It would be nice to have some kind of watchdog build into motioneye which checks if ffmpeg processes are working.

Legolaszstudio commented 3 years ago

It's funny how it hasn't been fixed yet.....

MichielvanBeers commented 3 years ago

Agreed with @Dinth. Is there anyway how we can for example make our own script that checks the motioneye log for this error? Since motioneye is aware that the issue takes place, we should be able to restart the service, right?

starbasessd commented 3 years ago

Are you getting it? I have run docker on a VM, but never had it crash. What version of motion & motionEye & OS is showing in the docker motionEye WebGUI?

MichielvanBeers commented 3 years ago

Not sure if that question was directed at me, but I currently have it running stable by triggering a cronjob every night that reboots the device. I run the latest version:

motionEye Version | 0.42.1 Motion Version | 4.2.2 OS Version | motionEyeOS 20200606

Woodpeckercz commented 3 years ago

Not sure if that question was directed at me, but I currently have it running stable by triggering a cronjob every night that reboots the device. I run the latest version:

motionEye Version | 0.42.1 Motion Version | 4.2.2 OS Version | motionEyeOS 20200606

I don't know how to create cron jobs yet, would you mind sharing your code for restarting the camera every night ? Seems like my camera looses connection every 24-48h.

MichielvanBeers commented 3 years ago

Yeah no problem:

Make sure that SSH is turned on in the Service settings. Login via SSH on your motioneye server with root and the password that you've set for the admin user in the webinterface.

After logged in, type crontab -e and paste the following line in the crontab page: 0 4 * * * reboot now >/dev/null 2>&1 . Press ctrl + X and save the changes. Your device should now reboot everyday at 4:00 am if all is well.

Woodpeckercz commented 2 years ago

Yeah no problem:

Make sure that SSH is turned on in the Service settings. Login via SSH on your motioneye server with root and the password that you've set for the admin user in the webinterface.

After logged in, type crontab -e and paste the following line in the crontab page: 0 4 * * * reboot now >/dev/null 2>&1 . Press ctrl + X and save the changes. Your device should now reboot everyday at 4:00 am if all is well.

Thank you so much.

leprechaun17 commented 11 months ago

crontab -e

How do you perform this when motioneye is installed as a docker container on unraid? I do not see any settings allowing me to enable SSH in my current installation.

MichielvanBeers commented 11 months ago

@leprechaun17 you should run the command inside of the Docker container. I don't use Unraid but the command line and then it would go like this. Keep in mind that Docker containers are stateless and that restarting it, will remove the changes you've made. You can find some Unraid specific info here.