blakeblackshear / frigate

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

[Config Support]: Can't seem to disable RTMP #4173

Closed ZuluWhiskey closed 2 years ago

ZuluWhiskey commented 2 years ago

Describe the problem you are having

Despite me configuring RTMP to be disabled at both a global and per camera level, RTMP still seems to be enabled and I cannot work out why.

I have shared my config and the output of the debug page which seems to show RTMP being enabled. I only noticed it was enabled when I looked on Home Assistant and saw that I had a live camera showing from Frigate.

Version

0.11.1-2EADA21

Frigate config file

mqtt:
  host: 172.16.0.2
  port: 1883

detectors:
  coral:
    type: edgetpu
    device: usb

snapshots:
  enabled: True
  retain:
    default: 2

record:
  enabled: True
  events:
    retain:
      default: 1
      mode: active_objects

rtmp:
  enabled: False

detect:
  stationary:
    interval: 0
    threshold: 50

objects:
  track:
    - person

cameras:
  hallway:
    mqtt:
      enabled: True
      timestamp: False
      bounding_box: False
      crop: True
      height: 500
      quality: 100
    record:
      enabled: False
    rtmp:
      enabled: False
    ffmpeg:
      inputs:
        - path: rtsp://user:pass@192.168.1.29/stream1
          roles:
            - detect
    detect:
      width: 1920
      height: 1080
    motion:
      mask:
        - 0,68,621,63,621,0,0,0
  driveway_roof:
    rtmp:
      enabled: False
    ffmpeg:
      inputs:
        - path: rtsps://10.0.0.5:7441/4Iml1A3Gy6bFCDfR?enableSrtp
          roles:
            - detect
    detect:
      width: 640
      height: 360
    motion:
      mask:
        - 125,152,122,57,148,0,0,0,0,360,155,360
        - 457,30,496,0,640,0,640,166
    zones:
      driveway:
        coordinates: 442,39,640,175,566,252,611,295,544,360,248,360,166,144
    objects:
      track:
        - person
        - motorcycle
        - dog
    snapshots:
      required_zones:
        - driveway
    record:
      enabled: False
      events:
        required_zones:
          - driveway

  driveway_garage:
    rtmp:
      enabled: False
    ffmpeg:
      inputs:
        - path: rtsp://user:pass@192.168.1.23:554/Streaming/channels/102
          roles:
            - detect
        - path: rtsp://user:pass@192.168.1.23:554/Streaming/channels/101
          roles:
            - record
    detect:
      width: 1280
      height: 720
    motion:
      mask:
        - 243,228,741,159,966,165,1280,260,1280,0,0,0,0,289
    zones:
      driveway:
        coordinates: 0,720,0,411,667,230,1217,418,1089,720
    objects:
      track:
        - person
        - motorcycle
        - dog
      filters:
        person:
          #min_score: 0.5
          #threshold: 0.6
          mask:
            - 659,676,915,688,918,436,611,478
    snapshots:
      required_zones:
        - driveway
    record:
      enabled: True
      events:
        retain:
          default: 2
          mode: motion
        required_zones:
          - driveway

Relevant log output

{
  "birdseye": {
    "enabled": true,
    "height": 720,
    "mode": "objects",
    "quality": 8,
    "width": 1280
  },
  "cameras": {
    "driveway_garage": {
      "best_image_timeout": 60,
      "birdseye": {
        "enabled": true,
        "mode": "objects"
      },
      "detect": {
        "enabled": true,
        "fps": 5,
        "height": 720,
        "max_disappeared": 25,
        "stationary": {
          "interval": 0,
          "max_frames": {
            "default": null,
            "objects": {}
          },
          "threshold": 50
        },
        "width": 1280
      },
      "ffmpeg": {
        "global_args": [
          "-hide_banner",
          "-loglevel",
          "warning"
        ],
        "hwaccel_args": [],
        "input_args": [
          "-avoid_negative_ts",
          "make_zero",
          "-fflags",
          "+genpts+discardcorrupt",
          "-rtsp_transport",
          "tcp",
          "-timeout",
          "5000000",
          "-use_wallclock_as_timestamps",
          "1"
        ],
        "inputs": [
          {
            "global_args": [],
            "hwaccel_args": [],
            "input_args": [],
            "path": "rtsp://user:pass@192.168.1.23:554/Streaming/channels/102",
            "roles": [
              "detect"
            ]
          },
          {
            "global_args": [],
            "hwaccel_args": [],
            "input_args": [],
            "path": "rtsp://user:pass@192.168.1.23:554/Streaming/channels/101",
            "roles": [
              "record"
            ]
          }
        ],
        "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"
          ]
        }
      },
      "ffmpeg_cmds": [
        {
          "cmd": "ffmpeg -hide_banner -loglevel warning -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -timeout 5000000 -use_wallclock_as_timestamps 1 -i rtsp://user:pass@192.168.1.23:554/Streaming/channels/102 -r 5 -s 1280x720 -f rawvideo -pix_fmt yuv420p pipe:",
          "roles": [
            "detect"
          ]
        },
        {
          "cmd": "ffmpeg -hide_banner -loglevel warning -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -timeout 5000000 -use_wallclock_as_timestamps 1 -i rtsp://user:pass@192.168.1.23:554/Streaming/channels/101 -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an /tmp/cache/driveway_garage-%Y%m%d%H%M%S.mp4",
          "roles": [
            "record"
          ]
        }
      ],
      "live": {
        "height": 720,
        "quality": 8
      },
      "motion": {
        "contour_area": 30,
        "delta_alpha": 0.2,
        "frame_alpha": 0.2,
        "frame_height": 50,
        "improve_contrast": false,
        "mask": [
          "243,228,741,159,966,165,1280,260,1280,0,0,0,0,289"
        ],
        "mqtt_off_delay": 30,
        "threshold": 25
      },
      "mqtt": {
        "bounding_box": true,
        "crop": true,
        "enabled": true,
        "height": 270,
        "quality": 70,
        "required_zones": [],
        "timestamp": true
      },
      "name": "driveway_garage",
      "objects": {
        "filters": {
          "dog": {
            "mask": null,
            "max_area": 24000000,
            "max_ratio": 24000000,
            "min_area": 0,
            "min_ratio": 0,
            "min_score": 0.5,
            "threshold": 0.7
          },
          "motorcycle": {
            "mask": null,
            "max_area": 24000000,
            "max_ratio": 24000000,
            "min_area": 0,
            "min_ratio": 0,
            "min_score": 0.5,
            "threshold": 0.7
          },
          "person": {
            "mask": [
              "659,676,915,688,918,436,611,478"
            ],
            "max_area": 24000000,
            "max_ratio": 24000000,
            "min_area": 0,
            "min_ratio": 0,
            "min_score": 0.5,
            "threshold": 0.7
          }
        },
        "mask": "",
        "track": [
          "person",
          "motorcycle",
          "dog"
        ]
      },
      "record": {
        "enabled": true,
        "events": {
          "objects": null,
          "post_capture": 5,
          "pre_capture": 5,
          "required_zones": [
            "driveway"
          ],
          "retain": {
            "default": 2,
            "mode": "motion",
            "objects": {}
          }
        },
        "expire_interval": 60,
        "retain": {
          "days": 0,
          "mode": "all"
        },
        "retain_days": null
      },
      "rtmp": {
        "enabled": false
      },
      "snapshots": {
        "bounding_box": true,
        "clean_copy": true,
        "crop": false,
        "enabled": true,
        "height": null,
        "quality": 70,
        "required_zones": [
          "driveway"
        ],
        "retain": {
          "default": 2,
          "mode": "motion",
          "objects": {}
        },
        "timestamp": false
      },
      "timestamp_style": {
        "color": {
          "blue": 255,
          "green": 255,
          "red": 255
        },
        "effect": null,
        "format": "%m/%d/%Y %H:%M:%S",
        "position": "tl",
        "thickness": 2
      },
      "ui": {
        "dashboard": true,
        "order": 0
      },
      "zones": {
        "driveway": {
          "coordinates": "0,720,0,411,667,230,1217,418,1089,720",
          "filters": {},
          "objects": []
        }
      }
    },
    "driveway_roof": {
      "best_image_timeout": 60,
      "birdseye": {
        "enabled": true,
        "mode": "objects"
      },
      "detect": {
        "enabled": true,
        "fps": 5,
        "height": 360,
        "max_disappeared": 25,
        "stationary": {
          "interval": 0,
          "max_frames": {
            "default": null,
            "objects": {}
          },
          "threshold": 50
        },
        "width": 640
      },
      "ffmpeg": {
        "global_args": [
          "-hide_banner",
          "-loglevel",
          "warning"
        ],
        "hwaccel_args": [],
        "input_args": [
          "-avoid_negative_ts",
          "make_zero",
          "-fflags",
          "+genpts+discardcorrupt",
          "-rtsp_transport",
          "tcp",
          "-timeout",
          "5000000",
          "-use_wallclock_as_timestamps",
          "1"
        ],
        "inputs": [
          {
            "global_args": [],
            "hwaccel_args": [],
            "input_args": [],
            "path": "rtsps://10.0.0.5:7441/4Iml1A3Gy6bFCDfR?enableSrtp",
            "roles": [
              "record",
              "rtmp",
              "detect"
            ]
          }
        ],
        "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"
          ]
        }
      },
      "ffmpeg_cmds": [
        {
          "cmd": "ffmpeg -hide_banner -loglevel warning -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -timeout 5000000 -use_wallclock_as_timestamps 1 -i rtsps://10.0.0.5:7441/4Iml1A3Gy6bFCDfR?enableSrtp -r 5 -s 640x360 -f rawvideo -pix_fmt yuv420p pipe:",
          "roles": [
            "record",
            "rtmp",
            "detect"
          ]
        }
      ],
      "live": {
        "height": 720,
        "quality": 8
      },
      "motion": {
        "contour_area": 30,
        "delta_alpha": 0.2,
        "frame_alpha": 0.2,
        "frame_height": 50,
        "improve_contrast": false,
        "mask": [
          "125,152,122,57,148,0,0,0,0,360,155,360",
          "457,30,496,0,640,0,640,166"
        ],
        "mqtt_off_delay": 30,
        "threshold": 25
      },
      "mqtt": {
        "bounding_box": true,
        "crop": true,
        "enabled": true,
        "height": 270,
        "quality": 70,
        "required_zones": [],
        "timestamp": true
      },
      "name": "driveway_roof",
      "objects": {
        "filters": {
          "dog": {
            "mask": null,
            "max_area": 24000000,
            "max_ratio": 24000000,
            "min_area": 0,
            "min_ratio": 0,
            "min_score": 0.5,
            "threshold": 0.7
          },
          "motorcycle": {
            "mask": null,
            "max_area": 24000000,
            "max_ratio": 24000000,
            "min_area": 0,
            "min_ratio": 0,
            "min_score": 0.5,
            "threshold": 0.7
          },
          "person": {
            "mask": null,
            "max_area": 24000000,
            "max_ratio": 24000000,
            "min_area": 0,
            "min_ratio": 0,
            "min_score": 0.5,
            "threshold": 0.7
          }
        },
        "mask": "",
        "track": [
          "person",
          "motorcycle",
          "dog"
        ]
      },
      "record": {
        "enabled": false,
        "events": {
          "objects": null,
          "post_capture": 5,
          "pre_capture": 5,
          "required_zones": [
            "driveway"
          ],
          "retain": {
            "default": 1,
            "mode": "active_objects",
            "objects": {}
          }
        },
        "expire_interval": 60,
        "retain": {
          "days": 0,
          "mode": "all"
        },
        "retain_days": null
      },
      "rtmp": {
        "enabled": false
      },
      "snapshots": {
        "bounding_box": true,
        "clean_copy": true,
        "crop": false,
        "enabled": true,
        "height": null,
        "quality": 70,
        "required_zones": [
          "driveway"
        ],
        "retain": {
          "default": 2,
          "mode": "motion",
          "objects": {}
        },
        "timestamp": false
      },
      "timestamp_style": {
        "color": {
          "blue": 255,
          "green": 255,
          "red": 255
        },
        "effect": null,
        "format": "%m/%d/%Y %H:%M:%S",
        "position": "tl",
        "thickness": 2
      },
      "ui": {
        "dashboard": true,
        "order": 0
      },
      "zones": {
        "driveway": {
          "coordinates": "442,39,640,175,566,252,611,295,544,360,248,360,166,144",
          "filters": {},
          "objects": []
        }
      }
    },
    "hallway": {
      "best_image_timeout": 60,
      "birdseye": {
        "enabled": true,
        "mode": "objects"
      },
      "detect": {
        "enabled": true,
        "fps": 5,
        "height": 1080,
        "max_disappeared": 25,
        "stationary": {
          "interval": 0,
          "max_frames": {
            "default": null,
            "objects": {}
          },
          "threshold": 50
        },
        "width": 1920
      },
      "ffmpeg": {
        "global_args": [
          "-hide_banner",
          "-loglevel",
          "warning"
        ],
        "hwaccel_args": [],
        "input_args": [
          "-avoid_negative_ts",
          "make_zero",
          "-fflags",
          "+genpts+discardcorrupt",
          "-rtsp_transport",
          "tcp",
          "-timeout",
          "5000000",
          "-use_wallclock_as_timestamps",
          "1"
        ],
        "inputs": [
          {
            "global_args": [],
            "hwaccel_args": [],
            "input_args": [],
            "path": "rtsp://user:pass@192.168.1.29/stream1",
            "roles": [
              "record",
              "rtmp",
              "detect"
            ]
          }
        ],
        "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"
          ]
        }
      },
      "ffmpeg_cmds": [
        {
          "cmd": "ffmpeg -hide_banner -loglevel warning -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -timeout 5000000 -use_wallclock_as_timestamps 1 -i rtsp://user:pass@192.168.1.29/stream1 -r 5 -s 1920x1080 -f rawvideo -pix_fmt yuv420p pipe:",
          "roles": [
            "record",
            "rtmp",
            "detect"
          ]
        }
      ],
      "live": {
        "height": 720,
        "quality": 8
      },
      "motion": {
        "contour_area": 30,
        "delta_alpha": 0.2,
        "frame_alpha": 0.2,
        "frame_height": 50,
        "improve_contrast": false,
        "mask": [
          "0,68,621,63,621,0,0,0"
        ],
        "mqtt_off_delay": 30,
        "threshold": 25
      },
      "mqtt": {
        "bounding_box": false,
        "crop": true,
        "enabled": true,
        "height": 500,
        "quality": 100,
        "required_zones": [],
        "timestamp": false
      },
      "name": "hallway",
      "objects": {
        "filters": {
          "person": {
            "mask": null,
            "max_area": 24000000,
            "max_ratio": 24000000,
            "min_area": 0,
            "min_ratio": 0,
            "min_score": 0.5,
            "threshold": 0.7
          }
        },
        "mask": "",
        "track": [
          "person"
        ]
      },
      "record": {
        "enabled": false,
        "events": {
          "objects": null,
          "post_capture": 5,
          "pre_capture": 5,
          "required_zones": [],
          "retain": {
            "default": 1,
            "mode": "active_objects",
            "objects": {}
          }
        },
        "expire_interval": 60,
        "retain": {
          "days": 0,
          "mode": "all"
        },
        "retain_days": null
      },
      "rtmp": {
        "enabled": false
      },
      "snapshots": {
        "bounding_box": true,
        "clean_copy": true,
        "crop": false,
        "enabled": true,
        "height": null,
        "quality": 70,
        "required_zones": [],
        "retain": {
          "default": 2,
          "mode": "motion",
          "objects": {}
        },
        "timestamp": false
      },
      "timestamp_style": {
        "color": {
          "blue": 255,
          "green": 255,
          "red": 255
        },
        "effect": null,
        "format": "%m/%d/%Y %H:%M:%S",
        "position": "tl",
        "thickness": 2
      },
      "ui": {
        "dashboard": true,
        "order": 0
      },
      "zones": {}
    }
  },
  "database": {
    "path": "/media/frigate/frigate.db"
  },
  "detect": {
    "enabled": true,
    "fps": 5,
    "height": 720,
    "max_disappeared": null,
    "stationary": {
      "interval": 0,
      "max_frames": {
        "default": null,
        "objects": {}
      },
      "threshold": 50
    },
    "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",
      "-timeout",
      "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": 720,
    "quality": 8
  },
  "logger": {
    "default": "info",
    "logs": {}
  },
  "model": {
    "height": 320,
    "labelmap": {},
    "labelmap_path": null,
    "path": null,
    "width": 320
  },
  "motion": null,
  "mqtt": {
    "client_id": "frigate",
    "host": "172.16.0.2",
    "password": null,
    "port": 1883,
    "stats_interval": 60,
    "tls_ca_certs": null,
    "tls_client_cert": null,
    "tls_client_key": null,
    "tls_insecure": null,
    "topic_prefix": "frigate",
    "user": null
  },
  "objects": {
    "filters": null,
    "mask": "",
    "track": [
      "person"
    ]
  },
  "plus": {
    "enabled": false
  },
  "record": {
    "enabled": true,
    "events": {
      "objects": null,
      "post_capture": 5,
      "pre_capture": 5,
      "required_zones": [],
      "retain": {
        "default": 1,
        "mode": "active_objects",
        "objects": {}
      }
    },
    "expire_interval": 60,
    "retain": {
      "days": 0,
      "mode": "all"
    },
    "retain_days": null
  },
  "rtmp": {
    "enabled": false
  },
  "snapshots": {
    "bounding_box": true,
    "clean_copy": true,
    "crop": false,
    "enabled": true,
    "height": null,
    "quality": 70,
    "required_zones": [],
    "retain": {
      "default": 2,
      "mode": "motion",
      "objects": {}
    },
    "timestamp": false
  },
  "timestamp_style": {
    "color": {
      "blue": 255,
      "green": 255,
      "red": 255
    },
    "effect": null,
    "format": "%m/%d/%Y %H:%M:%S",
    "position": "tl",
    "thickness": 2
  },
  "ui": {
    "use_experimental": false
  }
}

Frigate stats

{"detection_fps":0.0,"detectors":{"coral":{"detection_start":0.0,"inference_speed":8.49,"pid":223}},"driveway_garage":{"camera_fps":5.1,"capture_pid":243,"detection_fps":0.0,"pid":234,"process_fps":5.1,"skipped_fps":0.0},"driveway_roof":{"camera_fps":5.1,"capture_pid":240,"detection_fps":0.0,"pid":232,"process_fps":5.1,"skipped_fps":0.0},"hallway":{"camera_fps":5.1,"capture_pid":236,"detection_fps":0.0,"pid":229,"process_fps":5.1,"skipped_fps":0.0},"service":{"latest_version":"0.11.1","storage":{"/dev/shm":{"free":60.8,"mount_type":"tmpfs","total":67.1,"used":6.3},"/media/frigate/clips":{"free":4311.4,"mount_type":"ext4","total":8350.3,"used":3592.6},"/media/frigate/recordings":{"free":4311.4,"mount_type":"ext4","total":8350.3,"used":3592.6},"/tmp/cache":{"free":970.8,"mount_type":"tmpfs","total":1000.0,"used":29.2}},"temperatures":{},"uptime":1326,"version":"0.11.1-2eada21"}}

Operating system

Debian

Install method

Docker Compose

Coral version

USB

Any other information that may be helpful

No response

NickM-27 commented 2 years ago

What on the debug page makes you think RTMP is not disabled?

Home assistant will use the snapshot url and update once a second if the stream is unavailable so that's likely what you're seeing there

ZuluWhiskey commented 2 years ago

I'll be honest, I'm not an expert with this stuff. It was the presence of this that made me think it was still enabled:

          "rtmp": [
            "-c",
            "copy",
            "-f",
            "flv"
          ]

I assume that being there doesn't mean what I think it does then!

I wasn't aware of HA using snapshots instead, so that would explain what I saw there too - Apologies!

NickM-27 commented 2 years ago

That will always be there regardless as it is just the args that will be used even if it is disabled. Will go ahead and close this