blakeblackshear / frigate

NVR with realtime local object detection for IP cameras
https://frigate.video
MIT License
18.94k stars 1.73k forks source link

[Config Support]: Error and Restart #3293

Closed RobertusIT closed 2 years ago

RobertusIT commented 2 years ago

Describe the problem you are having

Frigate restart every time, and there are a lot of error for my camera.

Version

0.10.1-83481AF

Frigate config file

{
  "birdseye": {
    "enabled": true,
    "height": 720,
    "mode": "objects",
    "quality": 8,
    "width": 1280
  },
  "cameras": {
    "campanello": {
      "best_image_timeout": 60,
      "detect": {
        "enabled": true,
        "fps": 5,
        "height": 1920,
        "max_disappeared": 25,
        "stationary": {
          "interval": 0,
          "max_frames": {
            "default": null,
            "objects": {}
          },
          "threshold": 50
        },
        "width": 2560
      },
      "ffmpeg": {
        "global_args": [
          "-hide_banner",
          "-loglevel",
          "warning"
        ],
        "hwaccel_args": [
          "-hwaccel",
          "vaapi",
          "-hwaccel_device",
          "/dev/dri/renderD128",
          "-hwaccel_output_format",
          "yuv420p"
        ],
        "input_args": "-avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -stimeout 5000000 -use_wallclock_as_timestamps 1",
        "inputs": [
          {
            "global_args": [],
            "hwaccel_args": [],
            "input_args": [],
            "path": "rtsp://admin:pass@192.168.178.46:554/cam/realmonitor?channel=1&subtype=0",
            "roles": [
              "record",
              "rtmp",
              "detect"
            ]
          }
        ],
        "output_args": {
          "detect": "-f rawvideo -pix_fmt yuv420p",
          "record": "-f segment -segment_time 60 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c:v copy -c:a aac",
          "rtmp": "-c copy -f flv"
        }
      },
      "ffmpeg_cmds": [
        {
          "cmd": "ffmpeg -hide_banner -loglevel warning -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format yuv420p -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -stimeout 5000000 -use_wallclock_as_timestamps 1 -i rtsp://admin:pass@192.168.178.46:554/cam/realmonitor?channel=1&subtype=0 -f segment -segment_time 60 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c:v copy -c:a aac /tmp/cache/campanello-%Y%m%d%H%M%S.mp4 -c copy -f flv rtmp://127.0.0.1/live/campanello -r 5 -s 2560x1920 -f rawvideo -pix_fmt yuv420p pipe:",
          "roles": [
            "record",
            "rtmp",
            "detect"
          ]
        }
      ],
      "live": {
        "height": 1920,
        "quality": 1
      },
      "motion": {
        "contour_area": 30,
        "delta_alpha": 0.2,
        "frame_alpha": 0.2,
        "frame_height": 50,
        "improve_contrast": false,
        "mask": "",
        "threshold": 25
      },
      "mqtt": {
        "bounding_box": true,
        "crop": true,
        "enabled": true,
        "height": 270,
        "quality": 70,
        "required_zones": [],
        "timestamp": true
      },
      "name": "campanello",
      "objects": {
        "filters": {
          "person": {
            "mask": null,
            "max_area": 24000000,
            "min_area": 0,
            "min_score": 0.5,
            "threshold": 0.7
          }
        },
        "mask": "",
        "track": [
          "person"
        ]
      },
      "record": {
        "enabled": true,
        "events": {
          "max_seconds": 300,
          "objects": [
            "person"
          ],
          "post_capture": 5,
          "pre_capture": 5,
          "required_zones": [],
          "retain": {
            "default": 10,
            "mode": "motion",
            "objects": {}
          }
        },
        "expire_interval": 60,
        "retain": {
          "days": 0,
          "mode": "all"
        },
        "retain_days": 0
      },
      "rtmp": {
        "enabled": true
      },
      "snapshots": {
        "bounding_box": true,
        "clean_copy": true,
        "crop": false,
        "enabled": true,
        "height": null,
        "quality": 70,
        "required_zones": [],
        "retain": {
          "default": 10,
          "mode": "motion",
          "objects": {
            "person": 10
          }
        },
        "timestamp": false
      },
      "timestamp_style": {
        "color": {
          "blue": 255,
          "green": 255,
          "red": 255
        },
        "effect": null,
        "format": "%m/%d/%Y %H:%M:%S",
        "position": "tl",
        "thickness": 2
      },
      "zones": {}
    },
    "ingresso": {
      "best_image_timeout": 60,
      "detect": {
        "enabled": true,
        "fps": 7,
        "height": 480,
        "max_disappeared": 35,
        "stationary": {
          "interval": 0,
          "max_frames": {
            "default": null,
            "objects": {}
          },
          "threshold": 70
        },
        "width": 640
      },
      "ffmpeg": {
        "global_args": [
          "-hide_banner",
          "-loglevel",
          "warning"
        ],
        "hwaccel_args": [
          "-hwaccel",
          "vaapi",
          "-hwaccel_device",
          "/dev/dri/renderD128",
          "-hwaccel_output_format",
          "yuv420p"
        ],
        "input_args": [
          "-avoid_negative_ts",
          "make_zero",
          "-fflags",
          "nobuffer+genpts+discardcorrupt",
          "-flags",
          "low_delay",
          "-strict",
          "experimental",
          "-analyzeduration",
          "1000M",
          "-probesize",
          "1000M",
          "-rw_timeout",
          "5000000"
        ],
        "inputs": [
          {
            "global_args": [],
            "hwaccel_args": [],
            "input_args": [],
            "path": "http://192.168.178.35/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=pass",
            "roles": [
              "rtmp",
              "record"
            ]
          },
          {
            "global_args": [],
            "hwaccel_args": [],
            "input_args": [],
            "path": "http://192.168.178.35/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=admin&password=pass",
            "roles": [
              "detect"
            ]
          }
        ],
        "output_args": {
          "detect": [
            "-f",
            "rawvideo",
            "-pix_fmt",
            "yuv420p"
          ],
          "record": "-f segment -segment_time 60 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c:v copy -c:a aac",
          "rtmp": [
            "-c",
            "copy",
            "-f",
            "flv"
          ]
        }
      },
      "ffmpeg_cmds": [
        {
          "cmd": "ffmpeg -hide_banner -loglevel warning -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format yuv420p -avoid_negative_ts make_zero -fflags nobuffer+genpts+discardcorrupt -flags low_delay -strict experimental -analyzeduration 1000M -probesize 1000M -rw_timeout 5000000 -i http://192.168.178.35/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=pass -f segment -segment_time 60 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c:v copy -c:a aac /tmp/cache/ingresso-%Y%m%d%H%M%S.mp4 -c copy -f flv rtmp://127.0.0.1/live/ingresso",
          "roles": [
            "rtmp",
            "record"
          ]
        },
        {
          "cmd": "ffmpeg -hide_banner -loglevel warning -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format yuv420p -avoid_negative_ts make_zero -fflags nobuffer+genpts+discardcorrupt -flags low_delay -strict experimental -analyzeduration 1000M -probesize 1000M -rw_timeout 5000000 -i http://192.168.178.35/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=admin&password=pass -r 7 -s 640x480 -f rawvideo -pix_fmt yuv420p pipe:",
          "roles": [
            "detect"
          ]
        }
      ],
      "live": {
        "height": 1920,
        "quality": 1
      },
      "motion": {
        "contour_area": 30,
        "delta_alpha": 0.2,
        "frame_alpha": 0.2,
        "frame_height": 50,
        "improve_contrast": false,
        "mask": "",
        "threshold": 25
      },
      "mqtt": {
        "bounding_box": true,
        "crop": true,
        "enabled": true,
        "height": 270,
        "quality": 70,
        "required_zones": [],
        "timestamp": true
      },
      "name": "ingresso",
      "objects": {
        "filters": {
          "person": {
            "mask": null,
            "max_area": 24000000,
            "min_area": 0,
            "min_score": 0.5,
            "threshold": 0.7
          }
        },
        "mask": "",
        "track": [
          "person"
        ]
      },
      "record": {
        "enabled": true,
        "events": {
          "max_seconds": 300,
          "objects": [
            "person"
          ],
          "post_capture": 5,
          "pre_capture": 5,
          "required_zones": [],
          "retain": {
            "default": 10,
            "mode": "motion",
            "objects": {}
          }
        },
        "expire_interval": 60,
        "retain": {
          "days": 0,
          "mode": "all"
        },
        "retain_days": 0
      },
      "rtmp": {
        "enabled": true
      },
      "snapshots": {
        "bounding_box": true,
        "clean_copy": true,
        "crop": false,
        "enabled": true,
        "height": null,
        "quality": 70,
        "required_zones": [],
        "retain": {
          "default": 10,
          "mode": "motion",
          "objects": {
            "person": 10
          }
        },
        "timestamp": false
      },
      "timestamp_style": {
        "color": {
          "blue": 255,
          "green": 255,
          "red": 255
        },
        "effect": null,
        "format": "%m/%d/%Y %H:%M:%S",
        "position": "tl",
        "thickness": 2
      },
      "zones": {}
    }
  },
  "database": {
    "path": "/home/frigate.db"
  },
  "detect": {
    "enabled": true,
    "fps": 5,
    "height": 720,
    "max_disappeared": null,
    "stationary": {
      "interval": 0,
      "max_frames": {
        "default": null,
        "objects": {}
      },
      "threshold": null
    },
    "width": 1280
  },
  "detectors": {
    "coral": {
      "device": "usb",
      "num_threads": 3,
      "type": "edgetpu"
    }
  },
  "environment_vars": {},
  "ffmpeg": {
    "global_args": [
      "-hide_banner",
      "-loglevel",
      "warning"
    ],
    "hwaccel_args": [],
    "input_args": [
      "-avoid_negative_ts",
      "make_zero",
      "-fflags",
      "+genpts+discardcorrupt",
      "-rtsp_transport",
      "tcp",
      "-stimeout",
      "5000000",
      "-use_wallclock_as_timestamps",
      "1"
    ],
    "output_args": {
      "detect": [
        "-f",
        "rawvideo",
        "-pix_fmt",
        "yuv420p"
      ],
      "record": [
        "-f",
        "segment",
        "-segment_time",
        "10",
        "-segment_format",
        "mp4",
        "-reset_timestamps",
        "1",
        "-strftime",
        "1",
        "-c",
        "copy",
        "-an"
      ],
      "rtmp": [
        "-c",
        "copy",
        "-f",
        "flv"
      ]
    }
  },
  "live": {
    "height": 1920,
    "quality": 1
  },
  "logger": {
    "default": "info",
    "logs": {}
  },
  "model": {
    "height": 320,
    "labelmap": {},
    "labelmap_path": null,
    "path": null,
    "width": 320
  },
  "motion": null,
  "mqtt": {
    "client_id": "frigate",
    "host": "192.168.178.56",
    "password": "mqtt_user",
    "port": 1883,
    "stats_interval": 60,
    "tls_ca_certs": null,
    "tls_client_cert": null,
    "tls_client_key": null,
    "tls_insecure": null,
    "topic_prefix": "frigate",
    "user": "mqtt_user"
  },
  "objects": {
    "filters": null,
    "mask": "",
    "track": [
      "person"
    ]
  },
  "record": {
    "enabled": true,
    "events": {
      "max_seconds": 300,
      "objects": [
        "person"
      ],
      "post_capture": 5,
      "pre_capture": 5,
      "required_zones": [],
      "retain": {
        "default": 10,
        "mode": "motion",
        "objects": {}
      }
    },
    "expire_interval": 60,
    "retain": {
      "days": 0,
      "mode": "all"
    },
    "retain_days": 0
  },
  "rtmp": {
    "enabled": true
  },
  "snapshots": {
    "bounding_box": true,
    "clean_copy": true,
    "crop": false,
    "enabled": true,
    "height": null,
    "quality": 70,
    "required_zones": [],
    "retain": {
      "default": 10,
      "mode": "motion",
      "objects": {
        "person": 10
      }
    },
    "timestamp": false
  },
  "timestamp_style": {
    "color": {
      "blue": 255,
      "green": 255,
      "red": 255
    },
    "effect": null,
    "format": "%m/%d/%Y %H:%M:%S",
    "position": "tl",
    "thickness": 2
  }
}

Relevant log output

[2022-06-01 12:09:01] frigate.config                 WARNING : The 'retain_days' config option has been DEPRECATED and will be removed in a future version. Please use the 'days' setting under 'retain'
Starting migrations
[2022-06-01 12:09:01] peewee_migrate                 INFO    : Starting migrations
There is nothing to migrate
[2022-06-01 12:09:01] peewee_migrate                 INFO    : There is nothing to migrate
[2022-06-01 12:09:01] frigate.app                    INFO    : Output process started: 219
[2022-06-01 12:09:01] ws4py                          INFO    : Using epoll
[2022-06-01 12:09:01] frigate.app                    INFO    : Camera processor started for ingresso: 225
[2022-06-01 12:09:01] frigate.app                    INFO    : Camera processor started for campanello: 226
[2022-06-01 12:09:01] detector.coral                 INFO    : Starting detection process: 218
[2022-06-01 12:09:01] frigate.app                    INFO    : Capture process started for ingresso: 228
[2022-06-01 12:09:01] frigate.app                    INFO    : Capture process started for campanello: 229
[2022-06-01 12:09:01] frigate.edgetpu                INFO    : Attempting to load TPU as usb
[2022-06-01 12:09:01] ws4py                          INFO    : Using epoll
[2022-06-01 12:09:05] frigate.edgetpu                INFO    : TPU found
[2022-06-01 12:18:50] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:41320]
[2022-06-01 12:18:57] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:41320]
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[2022-06-01 12:18:57] frigate.video                  ERROR   : campanello: Unable to read frames from ffmpeg process.
[2022-06-01 12:18:57] frigate.video                  ERROR   : campanello: ffmpeg process is not running. exiting capture thread...
[s6-finish] sending all processes the TERM signal.
[s6-finish] sending all processes the KILL signal and exiting.
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[2022-06-01 12:19:02] frigate.app                    INFO    : Starting Frigate (0.10.1-83481af)
[2022-06-01 12:19:02] frigate.config                 WARNING : The 'retain_days' config option has been DEPRECATED and will be removed in a future version. Please use the 'days' setting under 'retain'
[2022-06-01 12:19:02] frigate.config                 WARNING : The 'retain_days' config option has been DEPRECATED and will be removed in a future version. Please use the 'days' setting under 'retain'
Starting migrations
[2022-06-01 12:19:02] peewee_migrate                 INFO    : Starting migrations
There is nothing to migrate
[2022-06-01 12:19:02] peewee_migrate                 INFO    : There is nothing to migrate
[2022-06-01 12:19:02] frigate.app                    INFO    : Output process started: 218
[2022-06-01 12:19:02] ws4py                          INFO    : Using epoll
[2022-06-01 12:19:02] frigate.app                    INFO    : Camera processor started for ingresso: 224
[2022-06-01 12:19:02] frigate.app                    INFO    : Camera processor started for campanello: 225
[2022-06-01 12:19:02] frigate.app                    INFO    : Capture process started for ingresso: 227
[2022-06-01 12:19:02] frigate.app                    INFO    : Capture process started for campanello: 229
[2022-06-01 12:19:02] ws4py                          INFO    : Using epoll
[2022-06-01 12:19:02] detector.coral                 INFO    : Starting detection process: 217
[2022-06-01 12:19:02] frigate.edgetpu                INFO    : Attempting to load TPU as usb
[2022-06-01 12:19:05] frigate.edgetpu                INFO    : TPU found
[2022-06-01 13:12:11] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:41322]
[2022-06-01 13:12:13] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:41322]
[2022-06-01 13:12:14] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:41324]
[2022-06-01 13:12:15] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:38592]
[2022-06-01 13:12:17] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:38592]
[2022-06-01 13:13:10] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:41324]
[2022-06-01 20:44:43] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:41328]
[2022-06-01 20:44:50] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:41328]
[2022-06-02 08:04:13] ffmpeg.ingresso.record_rtmp    ERROR   : http://192.168.178.35/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=pass: Connection timed out
[2022-06-02 08:04:14] ffmpeg.ingresso.record_rtmp    ERROR   : [flv @ 0x55eb19b61d80] Failed to update header with correct duration.
[2022-06-02 08:04:14] ffmpeg.ingresso.record_rtmp    ERROR   : [flv @ 0x55eb19b61d80] Failed to update header with correct filesize.
[2022-06-02 08:04:14] watchdog.ingresso              INFO    : Terminating the existing ffmpeg process...
[2022-06-02 08:04:14] watchdog.ingresso              INFO    : Waiting for ffmpeg to exit gracefully...
[2022-06-02 08:04:24] watchdog.ingresso              INFO    : No frames received from ingresso in 20 seconds. Exiting ffmpeg...
[2022-06-02 08:04:24] watchdog.ingresso              INFO    : Waiting for ffmpeg to exit gracefully...
[2022-06-02 08:04:24] watchdog.campanello            INFO    : No frames received from campanello in 20 seconds. Exiting ffmpeg...
[2022-06-02 08:04:24] watchdog.campanello            INFO    : Waiting for ffmpeg to exit gracefully...
[2022-06-02 08:04:24] frigate.video                  ERROR   : campanello: Unable to read frames from ffmpeg process.
[2022-06-02 08:04:24] frigate.video                  ERROR   : campanello: ffmpeg process is not running. exiting capture thread...
[2022-06-02 08:04:34] watchdog.campanello            ERROR   : Ffmpeg process crashed unexpectedly for campanello.
[2022-06-02 08:04:34] watchdog.campanello            ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2022-06-02 08:04:34] ffmpeg.campanello.detect       ERROR   : [aac @ 0x55c32ca6ba00] Too many bits 8832.000000 > 6144 per frame requested, clamping to max
[2022-06-02 08:04:34] ffmpeg.campanello.detect       ERROR   : [segment @ 0x55c32ca6d280] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
[2022-06-02 08:04:34] ffmpeg.campanello.detect       ERROR   : [flv @ 0x55c32ca69600] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
[2022-06-02 08:04:34] ffmpeg.campanello.detect       ERROR   : [rtsp @ 0x55c32ca44f00] RTP: PT=60: bad cseq 7648 expected=5b4e
[2022-06-02 08:04:34] ffmpeg.campanello.detect       ERROR   : [flv @ 0x55c32ca69600] Failed to update header with correct duration.
[2022-06-02 08:04:34] ffmpeg.campanello.detect       ERROR   : [flv @ 0x55c32ca69600] Failed to update header with correct filesize.
[2022-06-02 08:04:54] watchdog.ingresso              INFO    : FFmpeg didnt exit. Force killing...
[2022-06-02 08:04:54] frigate.video                  ERROR   : ingresso: Unable to read frames from ffmpeg process.
[2022-06-02 08:04:54] frigate.video                  ERROR   : ingresso: ffmpeg process is not running. exiting capture thread...
[2022-06-02 08:05:04] watchdog.ingresso              ERROR   : Ffmpeg process crashed unexpectedly for ingresso.
[2022-06-02 08:05:04] watchdog.ingresso              ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2022-06-02 08:05:04] ffmpeg.ingresso.detect         ERROR   : [flv @ 0x55c538508a80] Packet corrupt (stream = 0, dts = 71095317), dropping it.
[2022-06-02 08:05:04] ffmpeg.ingresso.detect         ERROR   : [flv @ 0x55c538508a80] Packet mismatch 104815754 11 -1207151131
[2022-06-02 08:54:45] frigate.video                  ERROR   : ingresso: Unable to read frames from ffmpeg process.
[2022-06-02 08:54:45] frigate.video                  ERROR   : ingresso: ffmpeg process is not running. exiting capture thread...
[2022-06-02 08:54:54] watchdog.ingresso              ERROR   : Ffmpeg process crashed unexpectedly for ingresso.
[2022-06-02 08:54:54] watchdog.ingresso              ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2022-06-02 08:54:54] ffmpeg.ingresso.detect         ERROR   : http://192.168.178.35/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=admin&password=pass: Connection timed out
[2022-06-02 08:55:14] watchdog.campanello            INFO    : No frames received from campanello in 20 seconds. Exiting ffmpeg...
[2022-06-02 08:55:14] watchdog.campanello            INFO    : Waiting for ffmpeg to exit gracefully...
[2022-06-02 08:55:14] frigate.video                  ERROR   : campanello: Unable to read frames from ffmpeg process.
[2022-06-02 08:55:14] frigate.video                  ERROR   : campanello: ffmpeg process is not running. exiting capture thread...
[2022-06-02 08:55:24] watchdog.campanello            ERROR   : Ffmpeg process crashed unexpectedly for campanello.
[2022-06-02 08:55:24] watchdog.campanello            ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2022-06-02 08:55:24] ffmpeg.campanello.detect       ERROR   : [aac @ 0x55ecf6313e40] Too many bits 8832.000000 > 6144 per frame requested, clamping to max
[2022-06-02 08:55:24] ffmpeg.campanello.detect       ERROR   : [segment @ 0x55ecf6312fc0] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
[2022-06-02 08:55:24] ffmpeg.campanello.detect       ERROR   : [flv @ 0x55ecf6312040] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
[2022-06-02 08:55:24] ffmpeg.campanello.detect       ERROR   : [segment @ 0x55ecf6312fc0] Non-monotonous DTS in output stream 0:0; previous: 46298348, current: 46298348; changing to 46298349. This may result in incorrect timestamps in the output file.
[2022-06-02 08:55:24] ffmpeg.campanello.detect       ERROR   : [flv @ 0x55ecf6312040] Failed to update header with correct duration.
[2022-06-02 08:55:24] ffmpeg.campanello.detect       ERROR   : [flv @ 0x55ecf6312040] Failed to update header with correct filesize.

Frigate stats

{"campanello":{"camera_fps":5.1,"capture_pid":229,"detection_fps":0.0,"pid":225,"process_fps":5.1,"skipped_fps":0.0},"detection_fps":0.0,"detectors":{"coral":{"detection_start":0.0,"inference_speed":8.32,"pid":217}},"ingresso":{"camera_fps":7.0,"capture_pid":227,"detection_fps":0.0,"pid":224,"process_fps":7.0,"skipped_fps":0.0},"service":{"storage":{"/dev/shm":{"free":58.3,"mount_type":"tmpfs","total":67.1,"used":8.8},"/media/frigate/clips":{"free":182564.7,"mount_type":"cifs","total":491106.5,"used":308541.8},"/media/frigate/recordings":{"free":182564.7,"mount_type":"cifs","total":491106.5,"used":308541.8},"/tmp/cache":{"free":3564.0,"mount_type":"ext4","total":12573.6,"used":8348.6}},"temperatures":{},"uptime":94720,"version":"0.10.1-83481af"}}

Operating system

Proxmox

Install method

Docker Compose

Coral version

USB

Any other information that may be helpful

Reolink RLC-410 and Amcrest ad410 Doorbell

NickM-27 commented 2 years ago

Which camera is the one having the issue? Seems to be the ad410. I have that camera as well and don't see any issues with the default settings.

Is this camera connected with 2.4 GHz or 5 GHz WiFi network and how is the signal strength? WiFi devices can have issues at times if the data is not being transmitted well.

RobertusIT commented 2 years ago

Which camera is the one having the issue? Seems to be the ad410. I have that camera as well and don't see any issues with the default settings.

Is this camera connected with 2.4 GHz or 5 GHz WiFi network and how is the signal strength? WiFi devices can have issues at times if the data is not being transmitted well.

Yes is an AD410, is connected via Wifi 5ghz and signal is very strong, because router is other side the door, so very very close

But frigate restart every time and isn't stable.

My settings are wrong ?

For my AD410 are:

  campanello:
    ffmpeg:
      hwaccel_args:
        - -hwaccel
        - vaapi
        - -hwaccel_device
        - /dev/dri/renderD128
        - -hwaccel_output_format
        - yuv420p

      input_args: 
        -avoid_negative_ts make_zero 
        -fflags +genpts+discardcorrupt 
        -rtsp_transport tcp 
        -stimeout 5000000 
        -use_wallclock_as_timestamps 1 

      output_args:
        detect: -f rawvideo -pix_fmt yuv420p
        record: -f segment -segment_time 60 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c:v copy -c:a aac
        rtmp: -c copy -f flv   

      inputs:
        - path: rtsp://admin:mypass@192.168.178.46:554/cam/realmonitor?channel=1&subtype=0
          roles:
            - detect
            - record
            - rtmp
    detect:
      enabled: true
      width: 2560
      height: 1920
      fps: 5
NickM-27 commented 2 years ago

I would recommend disabling RTMP for the doorbell camera (remove the - rtmp role and set

rtmp:
  enabled: false

for the doorbell camera. Just for now as a test since it seems that may be what is causing the issue.

Also I would still recommend the 2.4 GHz over 5GHz as even multiple camera streams will not saturate 2.4 GHz bandwidth.

RobertusIT commented 2 years ago

I would recommend disabling RTMP for the doorbell camera (remove the - rtmp role and set

rtmp:
  enabled: false

for the doorbell camera. Just for now as a test since it seems that may be what is causing the issue.

Also I would still recommend the 2.4 GHz over 5GHz as even multiple camera streams will not saturate 2.4 GHz bandwidth.

I'm trying in this way, like you said:

  campanello:
    ffmpeg:
      hwaccel_args:
        - -hwaccel
        - vaapi
        - -hwaccel_device
        - /dev/dri/renderD128
        - -hwaccel_output_format
        - yuv420p

      input_args: 
        -avoid_negative_ts make_zero 
        -fflags +genpts+discardcorrupt 
        -rtsp_transport tcp 
        -stimeout 5000000 
        -use_wallclock_as_timestamps 1 

      output_args:
        detect: -f rawvideo -pix_fmt yuv420p
        record: -f segment -segment_time 60 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c:v copy -c:a aac
        rtmp: -c copy -f flv   

      inputs:
        - path: rtsp://admin:pass@192.168.178.46:554/cam/realmonitor?channel=1&subtype=0
          roles:
            - detect
            - record
#            - rtmp
    detect:
      enabled: true
      width: 2560
      height: 1920
      fps: 5
    rtmp:
      enabled: false
NickM-27 commented 2 years ago

Looks correct, have things improved?

RobertusIT commented 2 years ago

Looks correct, have things improved?

not for now, is random and not always that there is an event, so need to test for a day or two

RobertusIT commented 2 years ago

Looks correct, have things improved?

I see some errors, below are the log:

[2022-06-04 05:07:48] ffmpeg.ingresso.record_rtmp    ERROR   : [flv @ 0x55b8ba154e80] Packet mismatch -1448812582 131679 1694968087
[2022-06-04 05:07:48] ffmpeg.ingresso.record_rtmp    ERROR   : [flv @ 0x55b8ba154e80] Packet mismatch -1687275790 2559327 1697527414
[2022-06-04 05:07:48] ffmpeg.ingresso.record_rtmp    ERROR   : [flv @ 0x55b8ba154e80] Packet mismatch 1801154498 76895 1697604309
[2022-06-04 05:07:48] ffmpeg.ingresso.record_rtmp    ERROR   : [flv @ 0x55b8ba154e80] Packet mismatch 345582608 2609759 1700214068
[2022-06-04 05:07:48] ffmpeg.ingresso.record_rtmp    ERROR   : [flv @ 0x55b8ba154e80] Packet mismatch -1759033204 131679 1700345747
[2022-06-04 05:07:48] ffmpeg.ingresso.record_rtmp    ERROR   : [flv @ 0x55b8ba154e80] Unable to seek to the next packet
[2022-06-04 05:07:48] ffmpeg.ingresso.record_rtmp    ERROR   : http://192.168.178.35/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=pass: Invalid data found when processing input
[2022-06-04 05:07:48] ffmpeg.ingresso.record_rtmp    ERROR   : [flv @ 0x55b8ba34e740] Failed to update header with correct duration.
[2022-06-04 05:07:48] ffmpeg.ingresso.record_rtmp    ERROR   : [flv @ 0x55b8ba34e740] Failed to update header with correct filesize.
[2022-06-04 05:07:48] watchdog.ingresso              INFO    : Terminating the existing ffmpeg process...
[2022-06-04 05:07:48] watchdog.ingresso              INFO    : Waiting for ffmpeg to exit gracefully...
[2022-06-04 05:07:52] frigate.video                  ERROR   : ingresso: Unable to read frames from ffmpeg process.
[2022-06-04 05:07:52] frigate.video                  ERROR   : ingresso: ffmpeg process is not running. exiting capture thread...
[2022-06-04 05:07:58] watchdog.ingresso              ERROR   : Ffmpeg process crashed unexpectedly for ingresso.
[2022-06-04 05:07:58] watchdog.ingresso              ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2022-06-04 05:07:58] ffmpeg.ingresso.detect         ERROR   : http://192.168.178.35/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=admin&password=pass: Connection timed out
[2022-06-04 05:07:58] ffmpeg.ingresso.record_rtmp    ERROR   : [tcp @ 0x55f808612040] Connection to tcp://192.168.178.35:80 failed: Connection timed out
[2022-06-04 05:07:58] ffmpeg.ingresso.record_rtmp    ERROR   : http://192.168.178.35/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=pass: Connection timed out
[2022-06-04 05:07:58] watchdog.ingresso              INFO    : Terminating the existing ffmpeg process...
[2022-06-04 05:07:58] watchdog.ingresso              INFO    : Waiting for ffmpeg to exit gracefully...
[2022-06-04 05:08:13] frigate.video                  ERROR   : campanello: Unable to read frames from ffmpeg process.
[2022-06-04 05:08:13] frigate.video                  ERROR   : campanello: ffmpeg process is not running. exiting capture thread...
[2022-06-04 05:08:19] watchdog.campanello            ERROR   : Ffmpeg process crashed unexpectedly for campanello.
[2022-06-04 05:08:19] watchdog.campanello            ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2022-06-04 05:08:19] ffmpeg.campanello.detect       ERROR   : [aac @ 0x55b77f796780] Too many bits 8832.000000 > 6144 per frame requested, clamping to max
[2022-06-05 02:00:12] frigate.video                  ERROR   : ingresso: Unable to read frames from ffmpeg process.
[2022-06-05 02:00:12] frigate.video                  ERROR   : ingresso: ffmpeg process is not running. exiting capture thread...
[2022-06-05 02:00:20] watchdog.ingresso              ERROR   : Ffmpeg process crashed unexpectedly for ingresso.
[2022-06-05 02:00:20] watchdog.ingresso              ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2022-06-05 02:00:20] ffmpeg.ingresso.detect         ERROR   : http://192.168.178.35/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=admin&password=pass: Connection timed out
[2022-06-05 02:00:20] ffmpeg.ingresso.record_rtmp    ERROR   : http://192.168.178.35/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=pass: Connection timed out
[2022-06-05 02:00:20] ffmpeg.ingresso.record_rtmp    ERROR   : [flv @ 0x561bf69fcd80] Failed to update header with correct duration.
[2022-06-05 02:00:20] ffmpeg.ingresso.record_rtmp    ERROR   : [flv @ 0x561bf69fcd80] Failed to update header with correct filesize.
[2022-06-05 02:00:20] watchdog.ingresso              INFO    : Terminating the existing ffmpeg process...
[2022-06-05 02:00:20] watchdog.ingresso              INFO    : Waiting for ffmpeg to exit gracefully...
[2022-06-05 02:00:25] frigate.video                  ERROR   : ingresso: Unable to read frames from ffmpeg process.
[2022-06-05 02:00:25] frigate.video                  ERROR   : ingresso: ffmpeg process is not running. exiting capture thread...
[2022-06-05 02:00:30] watchdog.ingresso              ERROR   : Ffmpeg process crashed unexpectedly for ingresso.
[2022-06-05 02:00:30] watchdog.ingresso              ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2022-06-05 02:00:30] ffmpeg.ingresso.detect         ERROR   : [tcp @ 0x560de21c5dc0] Connection to tcp://192.168.178.35:80 failed: Connection timed out
[2022-06-05 02:00:30] ffmpeg.ingresso.detect         ERROR   : http://192.168.178.35/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=admin&password=pass: Connection timed out
[2022-06-05 02:00:30] ffmpeg.ingresso.record_rtmp    ERROR   : [tcp @ 0x559d4ae23040] Connection to tcp://192.168.178.35:80 failed: Connection timed out
[2022-06-05 02:00:30] ffmpeg.ingresso.record_rtmp    ERROR   : http://192.168.178.35/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=pass: Connection timed out
[2022-06-05 02:00:30] watchdog.ingresso              INFO    : Terminating the existing ffmpeg process...
[2022-06-05 02:00:30] watchdog.ingresso              INFO    : Waiting for ffmpeg to exit gracefully...
[2022-06-05 02:00:35] frigate.video                  ERROR   : ingresso: Unable to read frames from ffmpeg process.
[2022-06-05 02:00:35] frigate.video                  ERROR   : ingresso: ffmpeg process is not running. exiting capture thread...
[2022-06-05 02:00:40] watchdog.ingresso              ERROR   : Ffmpeg process crashed unexpectedly for ingresso.
[2022-06-05 02:00:40] watchdog.ingresso              ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2022-06-05 02:00:40] ffmpeg.ingresso.detect         ERROR   : [tcp @ 0x55aba068adc0] Connection to tcp://192.168.178.35:80 failed: Connection timed out
[2022-06-05 02:00:40] ffmpeg.ingresso.detect         ERROR   : http://192.168.178.35/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=admin&password=pass: Connection timed out
[2022-06-05 02:00:40] ffmpeg.ingresso.record_rtmp    ERROR   : [tcp @ 0x559eae5f8040] Connection to tcp://192.168.178.35:80 failed: Connection timed out
[2022-06-05 02:00:40] ffmpeg.ingresso.record_rtmp    ERROR   : http://192.168.178.35/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=pass: Connection timed out
[2022-06-05 02:00:40] watchdog.ingresso              INFO    : Terminating the existing ffmpeg process...
[2022-06-05 02:00:40] watchdog.ingresso              INFO    : Waiting for ffmpeg to exit gracefully...
[2022-06-05 05:17:46] frigate.video                  ERROR   : ingresso: Unable to read frames from ffmpeg process.
[2022-06-05 05:17:46] frigate.video                  ERROR   : ingresso: ffmpeg process is not running. exiting capture thread...
[2022-06-05 05:17:50] watchdog.ingresso              ERROR   : Ffmpeg process crashed unexpectedly for ingresso.
[2022-06-05 05:17:50] watchdog.ingresso              ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2022-06-05 05:17:50] ffmpeg.ingresso.detect         ERROR   : http://192.168.178.35/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=admin&password=pass: Connection timed out
[2022-06-05 05:17:50] ffmpeg.ingresso.record_rtmp    ERROR   : http://192.168.178.35/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=pass: Connection timed out
[2022-06-05 05:17:50] ffmpeg.ingresso.record_rtmp    ERROR   : [flv @ 0x559d4e453d00] Failed to update header with correct duration.
[2022-06-05 05:17:50] ffmpeg.ingresso.record_rtmp    ERROR   : [flv @ 0x559d4e453d00] Failed to update header with correct filesize.
[2022-06-05 05:17:50] watchdog.ingresso              INFO    : Terminating the existing ffmpeg process...
[2022-06-05 05:17:50] watchdog.ingresso              INFO    : Waiting for ffmpeg to exit gracefully...
[2022-06-05 05:18:10] watchdog.campanello            INFO    : No frames received from campanello in 20 seconds. Exiting ffmpeg...
[2022-06-05 05:18:10] watchdog.campanello            INFO    : Waiting for ffmpeg to exit gracefully...
[2022-06-05 05:18:10] frigate.video                  ERROR   : campanello: Unable to read frames from ffmpeg process.
[2022-06-05 05:18:10] frigate.video                  ERROR   : campanello: ffmpeg process is not running. exiting capture thread...
[2022-06-05 05:18:20] watchdog.campanello            ERROR   : Ffmpeg process crashed unexpectedly for campanello.
[2022-06-05 05:18:20] watchdog.campanello            ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2022-06-05 05:18:20] ffmpeg.campanello.detect       ERROR   : [aac @ 0x56042c3b17c0] Too many bits 8832.000000 > 6144 per frame requested, clamping to max
[2022-06-05 05:18:20] ffmpeg.campanello.detect       ERROR   : [rtsp @ 0x56042c38ad00] CSeq 2903 expected, 0 received.
[2022-06-05 05:18:20] ffmpeg.campanello.detect       ERROR   : [segment @ 0x56042c3ac800] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
[2022-06-05 05:18:20] ffmpeg.campanello.detect       ERROR   : [segment @ 0x56042c3ac800] Non-monotonous DTS in output stream 0:0; previous: 1335859801, current: 1335859801; changing to 1335859802. This may result in incorrect timestamps in the output file.
[2022-06-05 05:18:20] ffmpeg.campanello.detect       ERROR   : [segment @ 0x56042c3ac800] Non-monotonous DTS in output stream 0:0; previous: 1335861284, current: 1335861284; changing to 1335861285. This may result in incorrect timestamps in the output file.
[2022-06-05 05:18:20] ffmpeg.campanello.detect       ERROR   : [segment @ 0x56042c3ac800] Non-monotonous DTS in output stream 0:0; previous: 1335861310, current: 1335861310; changing to 1335861311. This may result in incorrect timestamps in the output file.
[2022-06-05 05:18:20] ffmpeg.campanello.detect       ERROR   : [segment @ 0x56042c3ac800] Non-monotonous DTS in output stream 0:0; previous: 1335863857, current: 1335863857; changing to 1335863858. This may result in incorrect timestamps in the output file.
[2022-06-05 05:18:20] ffmpeg.campanello.detect       ERROR   : [segment @ 0x56042c3ac800] Non-monotonous DTS in output stream 0:0; previous: 1335871493, current: 1335871493; changing to 1335871494. This may result in incorrect timestamps in the output file.
[2022-06-06 00:15:14] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:46194]
[2022-06-06 00:16:42] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:46194]
[2022-06-06 09:03:58] frigate.video                  ERROR   : ingresso: Unable to read frames from ffmpeg process.
[2022-06-06 09:03:58] frigate.video                  ERROR   : ingresso: ffmpeg process is not running. exiting capture thread...
[2022-06-06 09:04:02] watchdog.ingresso              ERROR   : Ffmpeg process crashed unexpectedly for ingresso.
[2022-06-06 09:04:02] watchdog.ingresso              ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2022-06-06 09:04:02] ffmpeg.ingresso.detect         ERROR   : http://192.168.178.35/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=admin&password=pass: Connection timed out
[2022-06-06 09:04:07] frigate.video                  ERROR   : ingresso: Unable to read frames from ffmpeg process.
[2022-06-06 09:04:07] frigate.video                  ERROR   : ingresso: ffmpeg process is not running. exiting capture thread...
[2022-06-06 09:04:12] watchdog.ingresso              ERROR   : Ffmpeg process crashed unexpectedly for ingresso.
[2022-06-06 09:04:12] watchdog.ingresso              ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2022-06-06 09:04:12] ffmpeg.ingresso.detect         ERROR   : http://192.168.178.35/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=admin&password=pass: Connection timed out
[2022-06-06 09:04:12] watchdog.campanello            INFO    : No frames received from campanello in 20 seconds. Exiting ffmpeg...
[2022-06-06 09:04:12] watchdog.campanello            INFO    : Waiting for ffmpeg to exit gracefully...
[2022-06-06 09:04:12] frigate.video                  ERROR   : campanello: Unable to read frames from ffmpeg process.
[2022-06-06 09:04:12] frigate.video                  ERROR   : campanello: ffmpeg process is not running. exiting capture thread...
[2022-06-06 09:04:22] watchdog.campanello            ERROR   : Ffmpeg process crashed unexpectedly for campanello.
[2022-06-06 09:04:22] watchdog.campanello            ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2022-06-06 09:04:22] ffmpeg.campanello.detect       ERROR   : [aac @ 0x55a1f44bcc40] Too many bits 8832.000000 > 6144 per frame requested, clamping to max
[2022-06-06 09:04:22] ffmpeg.campanello.detect       ERROR   : [segment @ 0x55a1f44a4240] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
[2022-06-06 09:04:22] ffmpeg.campanello.detect       ERROR   : [rtsp @ 0x55a1f4441d00] RTP: PT=60: bad cseq 206b expected=092c
stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.