motioneye-project / motioneyeos

A Video Surveillance OS For Single-board Computers
Other
7.88k stars 902 forks source link

Motion in motionEyeOS killed after some time when accessed via Homebridge Camera FFmpeg #3016

Open devmarcstorm opened 11 months ago

devmarcstorm commented 11 months ago

Preliminary Docs

I confirm that I have read the CONTRIBUTING guide before opening this issue.

I confirm that I have read the FAQ before opening this issue.

motionEyeOS Version

I am running motionEyeOS version: dev20201026

Board Model

I am using the following board/model: Raspberry Pi 4 Model B Rev 1.4

Camera

I am using the following type of camera: V4L2 Camera

My camera model is: ELP 1megapixel 720p USB camera

Network Connection

My motionEyeOS unit is connected to the network via: Ethernet

Peripherals

I am using the following peripherals that I consider relevant to this issue:

Log Files

I consider the following log files relevant to this issue:

I have changed some host and camera names in the log files.

My Setup

I operate a Homebridge on a 2nd Pi, on which the camera stream is accessed via the "Homebridge Camera FFmpeg" plugin (https://github.com/Sunoo/homebridge-camera-ffmpeg#readme).

Apart from "Video Streaming" and "Text Overlay", I don't currently use any other motionEye functions.

If I connect two cameras, I have to use /dev/video0 and /dev/video1, as the cameras unfortunately have the same USB ID. Currently I only have one camera connected and use /dev/v4l/by-id/.... The problem occurred with both configurations. The cameras did not freeze at the same time.

Problem

After some time (a few hours after the last restart), the stream stops. Both in the motionEye web interface and in the Homekit app. The only option I have found that works is to restart the Pi via the motionEye interface.

What I've tried so far

Thank you for your help and suggestions

starbasessd commented 11 months ago

The logs seem to be mixed. A couple of things needed, noticed. Are you running multiple PIs? Some of the logs indicate the PI may be outside (15C temps). What is the operating temperature range for the camera & hub? If it is an indoor camera, it may be too low. It would also be helpful to have timestamps for the issue in question. Could you run the command:

vcgencmd get_throttled

right after you notice the issue, but before you run a reboot, please?

After you answer these, I may be able to help more.

devmarcstorm commented 11 months ago

Hello and thank you for your help.

I only use one Pi that runs motionEyeOS. I will provide new logs.

The motionEyeOS-Pi is located together with the hub in a room whose indoor temperature is kept above 5° Celsius. The indoor temperature at the current time of year should be between 5°C and 12°C for the Pi and the hub and is currently 10.8°C.

The camera itself is sold as an outdoor camera and is located on the outside wall of the room. I currently measure an outside temperature of -0.5° C.

The problem already occurred a few weeks earlier, when the temperatures were still above 10°C.

I am in the Central European time zone and will restart the Pi as late as possible today (I think otherwise the problem will occur unnoticed during the night) and run the command tomorrow as soon as I notice that the problem reoccurs. I can then also provide the new log files.

Thanks again

starbasessd commented 11 months ago

If you can, before you reboot, run the command

logrotate -f /etc/logrotate.conf

to clear the logs, that would also be helpful.

devmarcstorm commented 11 months ago

Ok, it happened much earlier than I thought. Here is the timeline:

starbasessd commented 11 months ago

motioneye log: 2023-12-04 00:07:33: [motioneye] WARNING: 403 GET /login/?_=1701644853339 (192.168.2.164) 1.53ms motion log: [1:ml1:Camera1] [CRT] [NET] motion_init: Substream not available. Image sizes not modulo 16. I think the username & password for the camera itself may be wrong. If it uses 'special' characters, it will probably fail. Camera resolutions both directions (vert and horiz) need to be evenly divisible by 16, especially for rtsp:// addresses.

devmarcstorm commented 11 months ago

Thank you again for your help.

After the restart at 00:07 CET, I logged in via the web interface to see if the stream was running and entered my password incorrectly once.

I ran v4l2-ctl --list-formats-ext yesterday to get the resolutions supported by my camera.

ioctl: VIDIOC_ENUM_FMT
    Type: Video Capture

    [0]: 'MJPG' (Motion-JPEG, compressed)
        Size: Discrete 1280x720
            Interval: Discrete 0.033s (30.000 fps)
        Size: Discrete 640x480
            Interval: Discrete 0.033s (30.000 fps)
        Size: Discrete 352x288
            Interval: Discrete 0.033s (30.000 fps)
        Size: Discrete 320x240
            Interval: Discrete 0.033s (30.000 fps)
        Size: Discrete 176x144
            Interval: Discrete 0.033s (30.000 fps)
        Size: Discrete 160x120
            Interval: Discrete 0.033s (30.000 fps)
        Size: Discrete 800x600
            Interval: Discrete 0.033s (30.000 fps)
        Size: Discrete 960x720
            Interval: Discrete 0.033s (30.000 fps)
    [1]: 'YUYV' (YUYV 4:2:2)
        Size: Discrete 1280x720
            Interval: Discrete 0.100s (10.000 fps)
        Size: Discrete 640x480
            Interval: Discrete 0.033s (30.000 fps)
        Size: Discrete 352x288
            Interval: Discrete 0.033s (30.000 fps)
        Size: Discrete 320x240
            Interval: Discrete 0.033s (30.000 fps)
        Size: Discrete 176x144
            Interval: Discrete 0.033s (30.000 fps)
        Size: Discrete 160x120
            Interval: Discrete 0.033s (30.000 fps)
        Size: Discrete 800x600
            Interval: Discrete 0.050s (20.000 fps)
        Size: Discrete 960x720
            Interval: Discrete 0.067s (15.000 fps)

boot.log dmesg.log messages.log motion.log motioneye.log vcgencmd get_throttled output: throttled=0x0

Could there be something wrong with my configuration?

My settings for "Video Device"

My settings for "Expert Settings"

My settings for "Video Streaming"

My "Homebridge Camera FFmpeg" configuration on the second Pi running Homebridge