blakeblackshear / frigate

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

[Support]: RTMP stream not working on VLC (Or Home-Assistant) #1973

Closed maxi1134 closed 2 years ago

maxi1134 commented 2 years ago

Solution:

Removing MotionEye from the equation, thus reducing the load on the camera fixed my issue.

Describe the problem you are having

Hi there!

I am trying to get RTMP streams from Frigate to reduce the load on my cameras. Unfortunately, it seems like the stream is not working either on VLC ( URL: rtmp://FRIGATEIP/live/front_door )

Any help would be appreciated!

Version

0.9.0-8CA1280

Frigate config file

objects:
  track:
    - person
detect:
  # Optional: Number of frames without a detection before frigate considers an object to be gone. (default: 5x the frame rate)
  max_disappeared: 25
detectors:
  coral:
    type: edgetpu
    device: usb
database:
  path: /config/frigate.db
mqtt:
  # Required: host name
  host: 192.168.0.15
  # Optional: port (default: shown below)
  port: 1883
  # Optional: topic prefix (default: shown below)
  # WARNING: must be unique if you are running multiple instances
  topic_prefix: frigate
  # Optional: client id (default: shown below)
  # WARNING: must be unique if you are running multiple instances
  client_id: frigate
  # Optional: user
  user: mqtt_user
  # Optional: password
  # NOTE: Environment variables that begin with 'FRIGATE_' may be referenced in {}.
  #       eg. password: '{FRIGATE_MQTT_PASSWORD}'
  password: password
  # Optional: interval in seconds for publishing stats (default: shown below)
  stats_interval: 60
cameras:
  # Name of your camera
  front_door:
    ffmpeg:
      input_args:
        - -avoid_negative_ts
        - make_zero
        - -fflags
        - nobuffer
        - -flags
        - low_delay
        - -strict
        - experimental
        - -fflags
        - +genpts+discardcorrupt
        - -use_wallclock_as_timestamps
        - "1"
        - -c:v
        - h264_cuvid
      inputs:
         - path: rtmp://192.168.0.210/bcs/channel0_main.bcs?channel=0&stream=0&user=admin&password=Password
           roles:
            - detect
            - record
            - rtmp

      output_args:
        rtmp: -c copy -f flv
    detect:
      width: 2560
      height: 1920
      fps: 5
    zones:
      entrance:
        coordinates: 2560,1920,2560,0,1661,0,1410,359,950,442,0,1253,0,1920
    snapshots:
      # Optional: Enable writing jpg snapshot to /media/frigate/clips (default: shown below)
      # This value can be set via MQTT and will be updated in startup based on retained value
      enabled: True
      # Optional: print a timestamp on the snapshots (default: shown below)
      timestamp: False
      # Optional: draw bounding box on the snapshots (default: shown below)
      bounding_box: True
      # Optional: crop the snapshot (default: shown below)
      crop: False
      required_zones: ["entrance"]
      # Optional: height to resize the snapshot to (default: original size)
      # Optional: Restrict snapshots to objects that entered any of the listed zones (default: no required zones)
      # Optional: Camera override for retention settings (default: global values)
      retain:
        # Required: Default retention days (default: shown below)
        default: 10
        # Optional: Per object retention days
        objects:
          person: 15
    record:
        # Optional: Enable recording (default: shown below)
        enabled: true
        # Optional: Number of days to retain (default: shown below)
        retain_days: 0
        # Optional: Event recording settings
        events:
          # Optional: Enable event recording retention settings (default: shown below)
          # Optional: Maximum length of time to retain video during long events. (default: shown below)
          # NOTE: If an object is being tracked for longer than this amount of time, the cache
          #       will begin to expire and the resulting clip will be the last x seconds of the event unless retain_days under record is > 0.
          max_seconds: 600
          # Optional: Number of seconds before the event to include in the event (default: shown below)
          pre_capture: 10
          # Optional: Number of seconds after the event to include in the event (default: shown below)
          post_capture: 10
          # Optional: Objects to save event for. (default: all tracked objects)
          objects:
            - person
          # Optional: Restrict event to objects that entered any of the listed zones (default: no required zones)
          required_zones: ["entrance"]
          # Optional: Retention settings for event
          retain:
            # Required: Default retention days (default: shown below)
            default: 10
            # Optional: Per object retention days
            objects:
              person: 15
    objects:
      filters:
         bicycle:
           mask:
             - 0,1920,813,1920,1304,966,1049,433,0,1441
         car:
           mask:
             - 777,461,991,344,1384,319,1708,0,0,0,0,1084
         person:
           mask:
            # - 1820,678,1878,0,1324,0,0,0,0,1208,0,1920,402,1920,597,1566,48,1276,164,1161,412,1192,448,1176,628,1205,1104,806,1388,644
             - 1822,718,1878,0,1324,0,0,0,0,1207,0,1920,402,1920,597,1566,713,1455,745,1388,794,1331,815,1327,820,1279,1102,922,1239,924,1381,670
  # Name of your camera
  geovision:
    ffmpeg:
      input_args:
        - -avoid_negative_ts
        - make_zero
        - -fflags
        - nobuffer
        - -flags
        - low_delay
        - -strict
        - experimental
        - -fflags
        - +genpts+discardcorrupt
        - -use_wallclock_as_timestamps
        - "1"
        - -c:v
        - h264_cuvid
        #- hevc_cuvid
      inputs:
         - path: rtsp://192.168.50.3:8554/CH001.sdp
           roles:
            - detect
            - record

      output_args:
        detect: -vf transpose=1 -f rawvideo -pix_fmt yuv420p
        rtmp: -c copy -f flv
    detect:
      width: 1080
      height: 1920
      fps: 5
    snapshots:
      # Optional: Enable writing jpg snapshot to /media/frigate/clips (default: shown below)
      # This value can be set via MQTT and will be updated in startup based on retained value
      enabled: True
      # Optional: print a timestamp on the snapshots (default: shown below)
      timestamp: False
      # Optional: draw bounding box on the snapshots (default: shown below)
      bounding_box: True
      # Optional: crop the snapshot (default: shown below)
      crop: False
      required_zones: []
      # Optional: height to resize the snapshot to (default: original size)
      # Optional: Restrict snapshots to objects that entered any of the listed zones (default: no required zones)
      # Optional: Camera override for retention settings (default: global values)
      retain:
        # Required: Default retention days (default: shown below)
        default: 10
        # Optional: Per object retention days
        objects:
          person: 15
    record:
        # Optional: Enable recording (default: shown below)
        enabled: true
        # Optional: Number of days to retain (default: shown below)
        retain_days: 0
        # Optional: Event recording settings
        events:
          # Optional: Enable event recording retention settings (default: shown below)
          # Optional: Maximum length of time to retain video during long events. (default: shown below)
          # NOTE: If an object is being tracked for longer than this amount of time, the cache
          #       will begin to expire and the resulting clip will be the last x seconds of the event unless retain_days under record is > 0.
          max_seconds: 600
          # Optional: Number of seconds before the event to include in the event (default: shown below)
          pre_capture: 10
          # Optional: Number of seconds after the event to include in the event (default: shown below)
          post_capture: 10
          # Optional: Objects to save event for. (default: all tracked objects)
          objects:
            - person
          # Optional: Restrict event to objects that entered any of the listed zones (default: no required zones)
          required_zones: []
          # Optional: Retention settings for event
          retain:
            # Required: Default retention days (default: shown below)
            default: 10
            # Optional: Per object retention days
            objects:
              person: 15
    #objects:
    objects:
      filters:
        person:
          mask: 
            - 359,1920,0,1920,0,0,44,0,190,0,310,0,111,633,239,1001,442,1165,434,1255
  facecam:
    ffmpeg:
      input_args:
        - -avoid_negative_ts
        - make_zero
        - -fflags
        - nobuffer
        - -flags
        - low_delay
        - -strict
        - experimental
        - -fflags
        - +genpts+discardcorrupt
        - -use_wallclock_as_timestamps
        - "1"
        - -c:v
        - h264_cuvid
        #- hevc_cuvid
      inputs:
         - path: rtsp://admin:1Asdasd1@192.168.50.9:8554/12
           roles:
            - detect   
            - record

      output_args:
        detect: -vf transpose=1 -f rawvideo -pix_fmt yuv420p
        rtmp: -c copy -f flv
    detect:
      width: 1296
      height: 2304
      fps: 5
    snapshots:
      # Optional: Enable writing jpg snapshot to /media/frigate/clips (default: shown below)
      # This value can be set via MQTT and will be updated in startup based on retained value
      enabled: True
      # Optional: print a timestamp on the snapshots (default: shown below)
      timestamp: False
      # Optional: draw bounding box on the snapshots (default: shown below)
      bounding_box: True
      # Optional: crop the snapshot (default: shown below)
      crop: False
      required_zones: []
      # Optional: height to resize the snapshot to (default: original size)
      # Optional: Restrict snapshots to objects that entered any of the listed zones (default: no required zones)
      # Optional: Camera override for retention settings (default: global values)
      retain:
        # Required: Default retention days (default: shown below)
        default: 10
        # Optional: Per object retention days
        objects:
          person: 15
    record:
        # Optional: Enable recording (default: shown below)
        enabled: true
        # Optional: Number of days to retain (default: shown below)
        retain_days: 0
        # Optional: Event recording settings
        events:
          # Optional: Enable event recording retention settings (default: shown below)
          # Optional: Maximum length of time to retain video during long events. (default: shown below)
          # NOTE: If an object is being tracked for longer than this amount of time, the cache
          #       will begin to expire and the resulting clip will be the last x seconds of the event unless retain_days under record is > 0.
          max_seconds: 600
          # Optional: Number of seconds before the event to include in the event (default: shown below)
          pre_capture: 10
          # Optional: Number of seconds after the event to include in the event (default: shown below)
          post_capture: 10
          # Optional: Objects to save event for. (default: all tracked objects)
          objects:
            - person
          # Optional: Restrict event to objects that entered any of the listed zones (default: no required zones)
          required_zones: []
          # Optional: Retention settings for event
          retain:
            # Required: Default retention days (default: shown below)
            default: 10
            # Optional: Per object retention days
            objects:
              person: 15
    #objects:
    objects:
      filters:
        person:
          mask:
            - 1296,2304,1296,1584,1296,1425,646,1413,0,1455,0,2304
  patiocam:
    ffmpeg:
      input_args:
        - -avoid_negative_ts
        - make_zero
        - -fflags
        - nobuffer
        - -flags
        - low_delay
        - -strict
        - experimental
        - -fflags
        - +genpts+discardcorrupt
        - -use_wallclock_as_timestamps
        - "1"
        - -c:v
        - h264_cuvid
        #- hevc_cuvid
      inputs:
         - path: rtsp://admin:Password@192.168.50.8/live
           roles:
            - detect
            - record

      output_args:
        rtmp: -c copy -f flv
    detect:
      width: 1920
      height: 1080
      fps: 5
    snapshots:
      # Optional: Enable writing jpg snapshot to /media/frigate/clips (default: shown below)
      # This value can be set via MQTT and will be updated in startup based on retained value
      enabled: True
      # Optional: print a timestamp on the snapshots (default: shown below)
      timestamp: False
      # Optional: draw bounding box on the snapshots (default: shown below)
      bounding_box: True
      # Optional: crop the snapshot (default: shown below)
      crop: False
      required_zones: []
      # Optional: height to resize the snapshot to (default: original size)
      # Optional: Restrict snapshots to objects that entered any of the listed zones (default: no required zones)
      # Optional: Camera override for retention settings (default: global values)
      retain:
        # Required: Default retention days (default: shown below)
        default: 10
        # Optional: Per object retention days
        objects:
          person: 15
    record:
        # Optional: Enable recording (default: shown below)
        enabled: true
        # Optional: Number of days to retain (default: shown below)
        retain_days: 0
        # Optional: Event recording settings
        events:
          # Optional: Enable event recording retention settings (default: shown below)
          # Optional: Maximum length of time to retain video during long events. (default: shown below)
          # NOTE: If an object is being tracked for longer than this amount of time, the cache
          #       will begin to expire and the resulting clip will be the last x seconds of the event unless retain_days under record is > 0.
          max_seconds: 600
          # Optional: Number of seconds before the event to include in the event (default: shown below)
          pre_capture: 10
          # Optional: Number of seconds after the event to include in the event (default: shown below)
          post_capture: 10
          # Optional: Objects to save event for. (default: all tracked objects)
          objects:
            - person
          # Optional: Restrict event to objects that entered any of the listed zones (default: no required zones)
          required_zones: []
          # Optional: Retention settings for event
          retain:
            # Required: Default retention days (default: shown below)
            default: 10
            # Optional: Per object retention days
            objects:
              person: 15
    objects:
      filters:
        person:
          mask:
            - 1296,2304,1296,1584,1296,1425,646,1413,0,1455,0,2304

Relevant log output

[2021-10-09 21:46:41] frigate.app                    INFO    : Starting Frigate (0.9.0-8ca1280)
[2021-10-09 21:46:41] frigate.app                    WARNING : Camera geovision has rtmp enabled, but rtmp is not assigned to an input.
[2021-10-09 21:46:41] frigate.app                    WARNING : Camera facecam has rtmp enabled, but rtmp is not assigned to an input.
[2021-10-09 21:46:41] frigate.app                    WARNING : Camera patiocam has rtmp enabled, but rtmp is not assigned to an input.
Starting migrations
[2021-10-09 21:46:41] peewee_migrate                 INFO    : Starting migrations
There is nothing to migrate
[2021-10-09 21:46:41] peewee_migrate                 INFO    : There is nothing to migrate
[2021-10-09 21:46:41] frigate.mqtt                   INFO    : MQTT connected
[2021-10-09 21:46:41] detector.coral                 INFO    : Starting detection process: 233
[2021-10-09 21:46:41] frigate.app                    INFO    : Output process started: 235
[2021-10-09 21:46:41] frigate.edgetpu                INFO    : Attempting to load TPU as usb
[2021-10-09 21:46:41] ws4py                          INFO    : Using epoll
[2021-10-09 21:46:41] frigate.app                    INFO    : Camera processor started for front_door: 242
[2021-10-09 21:46:41] frigate.app                    INFO    : Camera processor started for geovision: 255
[2021-10-09 21:46:41] frigate.app                    INFO    : Camera processor started for facecam: 256
[2021-10-09 21:46:41] frigate.app                    INFO    : Camera processor started for patiocam: 257
[2021-10-09 21:46:41] frigate.app                    INFO    : Capture process started for front_door: 259
[2021-10-09 21:46:41] frigate.app                    INFO    : Capture process started for geovision: 263
[2021-10-09 21:46:41] frigate.app                    INFO    : Capture process started for facecam: 268
[2021-10-09 21:46:41] frigate.app                    INFO    : Capture process started for patiocam: 271
[2021-10-09 21:46:41] ws4py                          INFO    : Using epoll
[2021-10-09 21:46:44] frigate.edgetpu                INFO    : TPU found
[2021-10-09 21:46:45] frigate.video                  INFO    : front_door: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-10-09 21:46:45] frigate.video                  INFO    : front_door: ffmpeg process is not running. exiting capture thread...
[2021-10-09 21:47:01] watchdog.front_door            ERROR   : FFMPEG process crashed unexpectedly for front_door.
[2021-10-09 21:47:01] watchdog.front_door            ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2021-10-09 21:47:01] watchdog.front_door            ERROR   : You may have invalid args defined for this camera.
[2021-10-09 21:47:01] ffmpeg.front_door.detect       ERROR   : av_interleaved_write_frame(): Broken pipe
[2021-10-09 21:47:01] ffmpeg.front_door.detect       ERROR   : Finishing stream 2:0 without any data written to it.
[2021-10-09 21:47:01] ffmpeg.front_door.detect       ERROR   : [flv @ 0x55b97ad60a40] Failed to update header with correct duration.
[2021-10-09 21:47:01] ffmpeg.front_door.detect       ERROR   : [flv @ 0x55b97ad60a40] Failed to update header with correct filesize.
[2021-10-09 21:47:01] ffmpeg.front_door.detect       ERROR   : Error writing trailer of rtmp://127.0.0.1/live/front_door: Broken pipe
[2021-10-09 21:47:17] frigate.video                  INFO    : front_door: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-10-09 21:47:17] frigate.video                  INFO    : front_door: ffmpeg process is not running. exiting capture thread...
[2021-10-09 21:47:21] watchdog.front_door            ERROR   : FFMPEG process crashed unexpectedly for front_door.
[2021-10-09 21:47:21] watchdog.front_door            ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2021-10-09 21:47:21] watchdog.front_door            ERROR   : You may have invalid args defined for this camera.
[2021-10-09 21:47:21] ffmpeg.front_door.detect       ERROR   : av_interleaved_write_frame(): Connection reset by peer
[2021-10-09 21:47:21] ffmpeg.front_door.detect       ERROR   : [flv @ 0x557e223c8780] Failed to update header with correct duration.
[2021-10-09 21:47:21] ffmpeg.front_door.detect       ERROR   : [flv @ 0x557e223c8780] Failed to update header with correct filesize.
[2021-10-09 21:47:21] ffmpeg.front_door.detect       ERROR   : Error writing trailer of rtmp://127.0.0.1/live/front_door: Connection reset by peer
[2021-10-09 21:47:27] frigate.video                  INFO    : front_door: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-10-09 21:47:27] frigate.video                  INFO    : front_door: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-10-09 21:47:27] frigate.video                  INFO    : front_door: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-10-09 21:47:27] frigate.video                  INFO    : front_door: ffmpeg process is not running. exiting capture thread...
[2021-10-09 21:47:31] watchdog.front_door            ERROR   : FFMPEG process crashed unexpectedly for front_door.
[2021-10-09 21:47:31] watchdog.front_door            ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2021-10-09 21:47:31] watchdog.front_door            ERROR   : You may have invalid args defined for this camera.
[2021-10-09 21:47:31] ffmpeg.front_door.detect       ERROR   : av_interleaved_write_frame(): Connection reset by peer
[2021-10-09 21:47:31] ffmpeg.front_door.detect       ERROR   : [flv @ 0x55bdcda42000] Failed to update header with correct duration.
[2021-10-09 21:47:31] ffmpeg.front_door.detect       ERROR   : [flv @ 0x55bdcda42000] Failed to update header with correct filesize.
[2021-10-09 21:47:31] ffmpeg.front_door.detect       ERROR   : Error writing trailer of rtmp://127.0.0.1/live/front_door: Connection reset by peer
[2021-10-09 21:47:39] frigate.video                  INFO    : front_door: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-10-09 21:47:39] frigate.video                  INFO    : front_door: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-10-09 21:47:39] frigate.video                  INFO    : front_door: ffmpeg process is not running. exiting capture thread...
[2021-10-09 21:47:41] watchdog.front_door            ERROR   : FFMPEG process crashed unexpectedly for front_door.
[2021-10-09 21:47:41] watchdog.front_door            ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2021-10-09 21:47:41] watchdog.front_door            ERROR   : You may have invalid args defined for this camera.
[2021-10-09 21:47:41] ffmpeg.front_door.detect       ERROR   : av_interleaved_write_frame(): Connection reset by peer
[2021-10-09 21:47:41] ffmpeg.front_door.detect       ERROR   : [flv @ 0x5582e9434600] Failed to update header with correct duration.
[2021-10-09 21:47:41] ffmpeg.front_door.detect       ERROR   : [flv @ 0x5582e9434600] Failed to update header with correct filesize.
[2021-10-09 21:47:41] ffmpeg.front_door.detect       ERROR   : Error writing trailer of rtmp://127.0.0.1/live/front_door: Connection reset by peer
[2021-10-09 21:47:45] frigate.video                  INFO    : front_door: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-10-09 21:47:45] frigate.video                  INFO    : front_door: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-10-09 21:47:45] frigate.video                  INFO    : front_door: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-10-09 21:47:45] frigate.video                  INFO    : front_door: ffmpeg process is not running. exiting capture thread...
[2021-10-09 21:47:51] frigate.video                  INFO    : facecam: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-10-09 21:47:51] frigate.video                  INFO    : facecam: ffmpeg process is not running. exiting capture thread...
[2021-10-09 21:47:51] watchdog.facecam               ERROR   : FFMPEG process crashed unexpectedly for facecam.
[2021-10-09 21:47:51] watchdog.facecam               ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2021-10-09 21:47:51] watchdog.facecam               ERROR   : You may have invalid args defined for this camera.
[2021-10-09 21:47:51] ffmpeg.facecam.detect          ERROR   : [rtsp @ 0x55f8d6085d40] Missing PPS in sprop-parameter-sets, ignoring
[2021-10-09 21:47:51] ffmpeg.facecam.detect          ERROR   : rtsp://admin:Jesus420@192.168.50.9:8554/12: Connection timed out
[2021-10-09 21:47:51] ffmpeg.facecam.detect          ERROR   :     Last message repeated 2 times
[2021-10-09 21:47:51] watchdog.front_door            ERROR   : FFMPEG process crashed unexpectedly for front_door.
[2021-10-09 21:47:51] watchdog.front_door            ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2021-10-09 21:47:51] watchdog.front_door            ERROR   : You may have invalid args defined for this camera.
[2021-10-09 21:47:51] ffmpeg.front_door.detect       ERROR   : av_interleaved_write_frame(): Connection reset by peer
[2021-10-09 21:47:51] ffmpeg.front_door.detect       ERROR   : Finishing stream 2:0 without any data written to it.
[2021-10-09 21:47:51] ffmpeg.front_door.detect       ERROR   : [flv @ 0x55b9e901df40] Failed to update header with correct duration.
[2021-10-09 21:47:51] ffmpeg.front_door.detect       ERROR   : [flv @ 0x55b9e901df40] Failed to update header with correct filesize.
[2021-10-09 21:47:51] ffmpeg.front_door.detect       ERROR   : Error writing trailer of rtmp://127.0.0.1/live/front_door: Connection reset by peer
[2021-10-09 21:47:55] frigate.video                  INFO    : front_door: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-10-09 21:47:55] frigate.video                  INFO    : front_door: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-10-09 21:47:55] frigate.video                  INFO    : front_door: ffmpeg process is not running. exiting capture thread...
[2021-10-09 21:48:01] watchdog.front_door            ERROR   : FFMPEG process crashed unexpectedly for front_door.
[2021-10-09 21:48:01] watchdog.front_door            ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2021-10-09 21:48:01] watchdog.front_door            ERROR   : You may have invalid args defined for this camera.
[2021-10-09 21:48:01] ffmpeg.front_door.detect       ERROR   : av_interleaved_write_frame(): Connection reset by peer
[2021-10-09 21:48:01] ffmpeg.front_door.detect       ERROR   : Finishing stream 2:0 without any data written to it.
[2021-10-09 21:48:01] ffmpeg.front_door.detect       ERROR   : [flv @ 0x5577dbc09180] Failed to update header with correct duration.
[2021-10-09 21:48:01] ffmpeg.front_door.detect       ERROR   : [flv @ 0x5577dbc09180] Failed to update header with correct filesize.
[2021-10-09 21:48:01] ffmpeg.front_door.detect       ERROR   : Error writing trailer of rtmp://127.0.0.1/live/front_door: Connection reset by peer
[2021-10-09 21:48:05] frigate.video                  INFO    : front_door: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-10-09 21:48:05] frigate.video                  INFO    : front_door: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-10-09 21:48:05] frigate.video                  INFO    : front_door: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-10-09 21:48:05] frigate.video                  INFO    : front_door: ffmpeg process is not running. exiting capture thread...
[2021-10-09 21:48:11] watchdog.front_door            ERROR   : FFMPEG process crashed unexpectedly for front_door.
[2021-10-09 21:48:11] watchdog.front_door            ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2021-10-09 21:48:11] watchdog.front_door            ERROR   : You may have invalid args defined for this camera.
[2021-10-09 21:48:11] ffmpeg.front_door.detect       ERROR   : av_interleaved_write_frame(): Connection reset by peer
[2021-10-09 21:48:11] ffmpeg.front_door.detect       ERROR   : Finishing stream 2:0 without any data written to it.
[2021-10-09 21:48:11] ffmpeg.front_door.detect       ERROR   : [flv @ 0x560c869f3780] Failed to update header with correct duration.
[2021-10-09 21:48:11] ffmpeg.front_door.detect       ERROR   : [flv @ 0x560c869f3780] Failed to update header with correct filesize.

FFprobe output from your camera

I tried running this with no luck

Frigate stats

{
    "detection_fps": 48,
    "detectors": {
        "coral": {
            "detection_start": 1633815647.068297,
            "inference_speed": 15.29,
            "pid": 233
        }
    },
    "facecam": {
        "camera_fps": 5.1,
        "capture_pid": 267,
        "detection_fps": 16.6,
        "pid": 256,
        "process_fps": 5.1,
        "skipped_fps": 0
    },
    "front_door": {
        "camera_fps": 5,
        "capture_pid": 259,
        "detection_fps": 15.9,
        "pid": 241,
        "process_fps": 4.1,
        "skipped_fps": 0
    },
    "geovision": {
        "camera_fps": 5.1,
        "capture_pid": 263,
        "detection_fps": 9.3,
        "pid": 255,
        "process_fps": 5.1,
        "skipped_fps": 0
    },
    "patiocam": {
        "camera_fps": 5,
        "capture_pid": 272,
        "detection_fps": 6.2,
        "pid": 257,
        "process_fps": 4.9,
        "skipped_fps": 0
    },
    "service": {
        "storage": {
            "/dev/shm": {
                "free": 1046.4,
                "mount_type": "tmpfs",
                "total": 1073.7,
                "used": 27.3
            },
            "/media/frigate/clips": {
                "free": 2618686.6,
                "mount_type": "cifs",
                "total": 5996476.9,
                "used": 3377790.3
            },
            "/media/frigate/recordings": {
                "free": 2618686.6,
                "mount_type": "cifs",
                "total": 5996476.9,
                "used": 3377790.3
            },
            "/tmp/cache": {
                "free": 19979.5,
                "mount_type": "tmpfs",
                "total": 20000,
                "used": 20.5
            }
        },
        "uptime": 3388,
        "version": "0.9.0-8ca1280"
    }
}

Operating system

Other Linux

Install method

Docker Compose

Coral version

USB

Network connection

Wired

Camera make and model

PTZ: ‎RLC-423, FACECAM: Some chinese minicam, PatioCam: Wyzecam V2 with Official RTSP firmware, Geovision: gv-VD2400

Any other information that may be helpful

No response

blakeblackshear commented 2 years ago

Can you be more specific than "not working"? Does it load at all? Are you exposing port 1935?

maxi1134 commented 2 years ago

At first, I thought it wouldn't load at all.

Now it seems that it loads after a long while but freezes after ~45-75 seconds, then I need to reload the url in VLC.

Port 1935 is opened in UFW.

blakeblackshear commented 2 years ago

You can see in the logs that the cameras are frequently timing out and/or missing packets. These types of issues will result in ffmpeg exiting and restarting and cause consistency issues like you are seeing in the RTMP feed. RTMP doesn't seem to be very resilient to these types of issues, so you might want to try disabling it in frigate to see if it stabilizes a bit.

tubalainen commented 2 years ago

Is it a wifi connected camera? If so, does the issue persist if you connect it to a network cable? Do you have multiple connections to the camera? Like "Frigate, Blue Iris, Home Assistant, RpiSurv etc ). I had similar issues with some of my cameras and I noticed that the cameras cannot cope with too many parallel connections.

There´s a proxy software, but it doesnt work well with Reolink RTMP streams for some reason. Works great with RTSP though. More info on the proxy can be found here: https://github.com/blakeblackshear/frigate/discussions/1623

maxi1134 commented 2 years ago

@blakeblackshear Thanks for reading! I was hoping to use the RTMP to be able to get the camera with the Lovelace card in my Lovelace interface to access clips. I already have a motion eye stream that is near latency-free but cannot seem to use that one as a video source for the card.

A different solution for my use case would be to allow the use of arbitrary camera entities on the Lovelace card while seeing the clips for a Frigate camera.

@tubalainen Thanks for reading! The camera is currently Wired with POE, with no WIFI elements in the way for this stream. As for using the RTSP stream, I get a lot of smearing on that one, hence why I use RTMP

I could try cutting motion-eye and see if the issue persists, would that be wise?

tubalainen commented 2 years ago

I could try cutting motion-eye and see if the issue persists, would that be wise?

Yes, give that a spin and see if it helps. Reboot the camera after disabling motion-eye.

masonevans commented 2 years ago

@maxi1134 - You could try experimenting with the max data rate & the frequency of iframes in your camera setup. I had a similar issue and found that the higher the data rate, the more often I needed to have the camera send an iframe to ffmpeg so that it wouldn't drop the RTSP stream.

maxi1134 commented 2 years ago

Hey guys!

Thanks for all the tips.

Taking MotionEye down seems to have fixed this issue!

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.