seydx / camera.ui

NVR like user Interface for RTSP capable cameras

Home Page:https://github.com/seydx/camera.ui

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FFMPEG crashes on recording

Rahulsharma0810 opened this issue · comments

Describe the bug
FFMPEG Crashes on recording after detected motion.

To Reproduce
Add Camera with below confs

        {
            "name": "CameraUI",
            "port": 8080,
            "atHomeSwitch": true,
            "logLevel": "debug",
            "mqtt": {
                "active": false,
                "tls": false,
                "port": 1883
            },
            "http": {
                "active": false,
                "port": 7272,
                "localhttp": false
            },
            "smtp": {
                "active": false,
                "port": 2727,
                "space_replace": "+"
            },
            "ftp": {
                "active": false,
                "useFile": false,
                "port": 5050
            },
            "ssl": {
                "active": false
            },
            "options": {
                "videoProcessor": "ffmpeg"
            },
            "cameras": [
                {
                    "name": "Living Room Camera",
                    "manufacturer": "TP-Link",
                    "model": "C200",
                    "privacySwitch": true,
                    "motion": true,
                    "doorbell": true,
                    "motionTimeout": 15,
                    "motionDoorbell": true,
                    "unbridge": true,
                    "hsv": true,
                    "prebuffering": false,
                    "prebufferLength": 4,
                    "hksvConfig": {
                        "source": "-i rtsp://user:pass%40271@192.168.0.51:554/stream1",
                        "vcodec": "copy",
                        "audio": false
                    },
                    "videoConfig": {
                        "source": "-i rtsp://user:pass%40271@192.168.0.51:554/stream1",
                        "subSource": "-i rtsp://user:pass%40271@192.168.0.51:554/stream2",
                        "stillImageSource": "-i rtsp://user:pass%40271@192.168.0.51:554/stream1",
                        "rtspTransport": "tcp",
                        "vcodec": "h264_videotoolbox",
                        "acodec": "libfdk_aac",
                        "audio": false,
                        "debug": true,
                        "debugReturn": false
                    },
                    "smtp": {
                        "email": "Living Room Camera"
                    },
                    "videoanalysis": {
                        "active": true
                    },
                    "mqtt": {}
                }
            ],
            "platform": "CameraUI"
        }
    ],

Expected behavior
A clear and concise description of what you expected to happen.

Logs

[5/11/2022, 5:25:32 PM] [CameraUI] VIDEOANALYSIS: New message: Data: [{"zone":"region0","percent":26.64322853088379,"sensitivity":74,"dwell":60,"forceClose":3}] - Motion: detected - Camera: Living Room Camera
[5/11/2022, 5:25:32 PM] [CameraUI] Living Room Camera: {"error":false,"message":"Handling through extern controller.."}
[5/11/2022, 5:25:32 PM] [CameraUI] MQTT client not connected, skip MQTT (notification)..
[5/11/2022, 5:25:32 PM] [CameraUI] Living Room Camera: Motion ON
[5/11/2022, 5:25:32 PM] [CameraUI] Living Room Camera: Snapshot requested: 1280 x 720
[5/11/2022, 5:25:32 PM] [CameraUI] Living Room Camera: Snapshot command: ffmpeg -hide_banner -loglevel error -i rtsp://user:pass%40271@192.168.0.51:554/stream1 -frames:v 1 -f image2 -
[5/11/2022, 5:25:32 PM] [CameraUI] Living Room Camera: Video fragments requested from HSV
[5/11/2022, 5:25:32 PM] [CameraUI] Living Room Camera: Start recording...
[5/11/2022, 5:25:32 PM] [CameraUI] Living Room Camera: Recording command: ffmpeg -hide_banner -rtsp_transport tcp -i rtsp://user:pass%40271@192.168.0.51:554/stream1 -f mp4 -vcodec copy -an -movflags frag_keyframe+empty_moov+default_base_moof -max_muxing_queue_size 1024 tcp://127.0.0.1:37230
[5/11/2022, 5:25:32 PM] [CameraUI] Living Room Camera: [rtsp @ 0x55cc436e7880] method SETUP failed: 406 Not Acceptable
[5/11/2022, 5:25:32 PM] [CameraUI] Living Room Camera: rtsp://user:pass%40271@192.168.0.51:554/stream1: Server returned 4XX Client Error, but not one of 40{0,1,3,4}
[5/11/2022, 5:25:32 PM] [CameraUI]  ERROR  Living Room Camera: FFmpeg recording process exited with error! (null)
[5/11/2022, 5:25:36 PM] [CameraUI] Living Room Camera: Fetching snapshot took 3.963 seconds.
[5/11/2022, 5:25:36 PM] [CameraUI] Living Room Camera: Sending snapshot: 1280x720
[5/11/2022, 5:25:36 PM] [CameraUI] Living Room Camera: Resize command: ffmpeg -i pipe: -frames:v 1 -filter:v scale='min(1280,iw)':'min(720,ih)':force_original_aspect_ratio=decrease -f image2 -
[5/11/2022, 5:25:40 PM] [CameraUI] Living Room Camera: New motion detected, resetting motion in 60s..
[5/11/2022, 5:25:40 PM] [CameraUI] Living Room Camera: Motion data: [{"zone":"region0","percent":27.27777862548828,"sensitivity":74,"dwell":60,"forceClose":3}]}
[5/11/2022, 5:25:40 PM] [CameraUI] Living Room Camera: Closing recording process
[5/11/2022, 5:25:40 PM] [CameraUI] Living Room Camera: Resetting motion sensor, because HSV closed the recording process
[5/11/2022, 5:25:40 PM] [CameraUI] MQTT client not connected, skip MQTT (notification)..
[5/11/2022, 5:25:40 PM] [CameraUI] Living Room Camera: Motion OFF
[HDS ::ffff:192.168.0.61] Recording download stream 1 is still awaiting generator although stream was closed 10s ago! This is a programming mistake by the camera implementation which prevents freeing up resources.

Environment

  • Node.js Version: v16.15.0
  • Camera UI Version: homebridge-camera-ui v5.0.27
  • Operating System: Docker
  • Browser: Chrome

Fixed,

The issue is with the Special character in the password @ this should be added in the Readme, the Homekit recording fails with added special characters in the password.

commented

Thx will add it into readme/wiki