blakeblackshear / frigate

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

[Support]: Recording is broken / no mp4 files in /media/frigate/recordings/ #3008

Closed heapxor closed 2 years ago

heapxor commented 2 years ago

Describe the problem you are having

even the Recording is on only snapshots are generated, no recordings are created. image

image

Version

0.10.1-83481af

Frigate config file

{
  "birdseye": {
    "enabled": true,
    "height": 720,
    "mode": "objects",
    "quality": 8,
    "width": 1280
  },
  "cameras": {
    "entrance_cam": {
      "best_image_timeout": 60,
      "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",
          "-stimeout",
          "5000000",
          "-use_wallclock_as_timestamps",
          "1"
        ],
        "inputs": [
          {
            "global_args": [],
            "hwaccel_args": [],
            "input_args": [],
            "path": "rtsp://xx:xxx@10.0.1.xx:554",
            "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 -stimeout 5000000 -use_wallclock_as_timestamps 1 -i rtsp://admin:k0k0t1n4@10.0.1.109:554 -c copy -f flv rtmp://127.0.0.1/live/entrance_cam -r 5 -s 1280x720 -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": "",
        "threshold": 25
      },
      "mqtt": {
        "bounding_box": true,
        "crop": true,
        "enabled": true,
        "height": 270,
        "quality": 70,
        "required_zones": [],
        "timestamp": true
      },
      "name": "entrance_cam",
      "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": null,
          "post_capture": 5,
          "pre_capture": 5,
          "required_zones": [],
          "retain": {
            "default": 180,
            "mode": "motion",
            "objects": {}
          }
        },
        "expire_interval": 60,
        "retain": {
          "days": 0,
          "mode": "all"
        },
        "retain_days": null
      },
      "rtmp": {
        "enabled": true
      },
      "snapshots": {
        "bounding_box": true,
        "clean_copy": true,
        "crop": false,
        "enabled": true,
        "height": null,
        "quality": 70,
        "required_zones": [],
        "retain": {
          "default": 180,
          "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
      },
      "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": null
    },
    "width": 1280
  },
  "detectors": {
    "cpu1": {
      "device": "usb",
      "num_threads": 3,
      "type": "cpu"
    },
    "cpu2": {
      "device": "usb",
      "num_threads": 3,
      "type": "cpu"
    },
    "cpu3": {
      "device": "usb",
      "num_threads": 3,
      "type": "cpu"
    }
  },
  "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": 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": "10.0.1.xxx",
    "password": "mqtt",
    "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"
  },
  "objects": {
    "filters": null,
    "mask": "",
    "track": [
      "person"
    ]
  },
  "record": {
    "enabled": false,
    "events": {
      "max_seconds": 300,
      "objects": null,
      "post_capture": 5,
      "pre_capture": 5,
      "required_zones": [],
      "retain": {
        "default": 180,
        "mode": "motion",
        "objects": {}
      }
    },
    "expire_interval": 60,
    "retain": {
      "days": 0,
      "mode": "all"
    },
    "retain_days": null
  },
  "rtmp": {
    "enabled": true
  },
  "snapshots": {
    "bounding_box": true,
    "clean_copy": true,
    "crop": false,
    "enabled": false,
    "height": null,
    "quality": 70,
    "required_zones": [],
    "retain": {
      "default": 180,
      "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
  }
}

Relevant log output

[2022-03-24 00:02:21] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:57344]
[2022-03-24 00:02:22] frigate.mqtt                   INFO    : Turning off recordings for entrance_cam via mqtt
[2022-03-24 00:02:28] frigate.mqtt                   INFO    : Turning on recordings for entrance_cam via mqtt
[2022-03-24 00:04:13] frigate.mqtt                   INFO    : Turning off snapshots for entrance_cam via mqtt
[2022-03-24 00:04:14] frigate.mqtt                   INFO    : Turning off recordings for entrance_cam via mqtt
[2022-03-24 00:04:16] frigate.mqtt                   INFO    : Turning off detection for entrance_cam via mqtt
[2022-03-24 00:04:17] frigate.mqtt                   INFO    : Turning on detection for entrance_cam via mqtt
[2022-03-24 00:04:18] frigate.mqtt                   INFO    : Turning off detection for entrance_cam via mqtt
[2022-03-24 00:04:19] frigate.mqtt                   INFO    : Turning on snapshots for entrance_cam via mqtt
[2022-03-24 00:04:19] frigate.mqtt                   INFO    : Turning on recordings for entrance_cam via mqtt
[2022-03-24 00:04:20] frigate.mqtt                   INFO    : Turning on detection for entrance_cam via mqtt
[2022-03-24 00:04:27] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:57344]
[2022-03-24 00:05:05] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:57596]
[2022-03-24 00:05:20] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:47458]
[2022-03-24 00:05:22] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:47458]
[2022-03-24 00:06:20] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:47646]
[2022-03-24 00:06:21] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:47646]
[2022-03-24 00:07:36] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:47718]
[2022-03-24 00:07:37] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:47718]
[2022-03-24 00:07:54] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:57596]
[2022-03-24 00:09:05] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:58000]
[2022-03-24 00:09:10] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:58000]

FFprobe output from your camera

?

Frigate stats

No response

Operating system

HassOS

Install method

HassOS Addon

Coral version

CPU (no coral)

Network connection

Wired

Camera make and model

hikvision

Any other information that may be helpful

No response

NickM-27 commented 2 years ago

Have any events been created?

I recall giving a recommended config setup a couple days ago:

record:
  retain:
    days: 0 # how long to keep all recordings 
  events:
    retain:
      default: 365 # how long to keep recordings that have events

snapshots:
  retain:
    default: 365 # how long to keep snapshots

If you want to have 24/7 recordings saved then you will need to change the 0 to how many days of complete recordings that you would like to have kept. With your existing config recordings will only be saved when an event is saved.

heapxor commented 2 years ago

i dont want to have 24/7 recordings saved, i want to save only recordings with movement.... that was asked.

at the moment no recordings are saved at all. Even there are events = Snapshots (jpg) only. Clips (=recordings/ mp4 files) are not there for these events (Snapshots)

image

NickM-27 commented 2 years ago

@heapxor Thanks that is helpful, can you also show a screenshot of the events page?

heapxor commented 2 years ago

it is working properly i think only clips are missing

image

image

heapxor commented 2 years ago

so it apparently stopped to work on 3rd of March no idea why.

NickM-27 commented 2 years ago

@heapxor Can you do a couple things I think should hopefully sort things out or at least give a better idea:

  1. Confirm in your config.yaml that recording is enabled
    entrance_cam:
    record:
    enabled: true # <- ensure this is set to true
  2. Do a restart of the frigate addon. The frigate addon memory usage should start low and slowly increase as it reads recording data to memory.

Note that at any point that recordings are enabled / working it will not add clips to existing events and a new one will need to be created to ensure it is working as expected 👍

heapxor commented 2 years ago

@NickM-27 i dont get it ....

1) are u talking about frigate.yml? that was never there ... as far as i know, its ON via UI image and its set to ON as i also posted mqtt log ...

2) i did restart .

Yes thats logical that it wont add clips to old Events.... so i am still testing and trying to create new events...

heapxor commented 2 years ago

I did all above and the recordings dir is empty its basically not RECORDING At all.

NickM-27 commented 2 years ago

@heapxor I have seen weird behavior before if it is off in the config and then set it to on in the UI / MQTT will not get it to start. I would say try setting it to true in the config.

NickM-27 commented 2 years ago

I did all above and the recordings dir is empty its basically not RECORDING At all.

All recordings will be saved in memory and only added to the recordings directory if it matches the event retention settings and is part of an event (with your config).

heapxor commented 2 years ago

i never touch the config and also i cant have it inside config as i am setting it ON/OFF based on some schedule....

NickM-27 commented 2 years ago

i never touch the config and also i cant have it inside config as i am setting it ON/OFF based on some schedule....

That's fine, I do the same having a schedule. If you set it to true on the config it can still be disabled via MQTT. I think there may be a bug if it is disabled in the config. Please try enabling in the config and then restarting, I believe that will fix this and may show a bug.

heapxor commented 2 years ago

I did all above and the recordings dir is empty its basically not RECORDING At all.

All recordings will be saved in memory and only added to the recordings directory if it matches the event retention settings and is part of an event (with your config).

sorry i dont get it ... u are complicating things. The frigate was working year, didnt touch any config anything. IT stopped to work .

heapxor commented 2 years ago

i added this and restarted frigate image

created events ... which are inside Events but recordings are not there... image

heapxor commented 2 years ago

i am more then surprised there is no other debug/logging mechanism ... to find issue ...

heapxor commented 2 years ago

image

NickM-27 commented 2 years ago

image

@heapxor Okay I am confused. That screenshot with the retain 180, is that supposed to be in your frigate.yml?

The config you posted at the top doesn't show that at all:

"record": {
        "enabled": true,
        "events": {
          "max_seconds": 300,
          "objects": null,
          "post_capture": 5,
          "pre_capture": 5,
          "required_zones": [],
          "retain": {
            "default": 10,
            "mode": "motion",
            "objects": {}
          }
        },
        "expire_interval": 60,
        "retain": {
          "days": 0,
          "mode": "all"
        },
        "retain_days": null
      },
heapxor commented 2 years ago

[core-ssh config]$ cat /config/frigate.yml

mqtt:
  host: 10.0.1.1xx
  user: mqtt
  password: mqtt

cameras:
  entrance_cam:
    record:
      enabled: true
    ffmpeg:
      inputs:
        - path: rtsp://xx:xx@10.0.1.xx:554
          roles:
            - detect
            - rtmp

detectors:
  cpu1:
    type: cpu
  cpu2:
    type: cpu
  cpu3:
    type: cpu

# Optional: Record configuration
# NOTE: Can be overridden at the camera level
record:
  retain:
    days: 0
  events:
    retain:
      default: 180

snapshots:
  retain:
    default: 180

.....

in that case its other bug; as far as i can remember when i changed time ago ip add of cam it was also not propagated to frigate->debug UI ... but then something happened and it got (or maybe i set old ip to cam i cant remember)

heapxor commented 2 years ago

Can you please paste here your frigate.yml config?

yes was pasted above

heapxor commented 2 years ago

[core-ssh config]$ ls -al /config/frigate.yml -rw-r--r-- 1 root root 525 Mar 24 00:50 /config/frigate.yml

heapxor commented 2 years ago

okay seems that i pasted old Debug / and after restart correct values got propagated... i am going to update "Debug" section

heapxor commented 2 years ago

@NickM-27 now i updated Debug section at the begging of the thread, and also formatted frigate.yaml conf post.

NickM-27 commented 2 years ago

@heapxor Thanks, everything in there looks correct like it should be working. You can add

logger:
  default: debug

to the frigate.yml and it will create more logs giving context as to what is happening. I would recommend updating that, restarting, then creating a new event and it will hopefully give some clues as to what is going on.

blakeblackshear commented 2 years ago

Edit: I now see that recordings are enabled at the camera level and that should be sufficient.

You do not have recordings enabled in your config file. Try updating your config with

If you do not enable the record feature in the config file, turning it on via mqtt or the UI has not effect.

Enabling recordings is clearly outlined in the documentation here.

Also, I don't recommend adding a default logging config of debug. It generates so many messages, it makes it harder to find actual error messages.

NickM-27 commented 2 years ago

Also, I don't recommend adding a default logging config of debug. It generates so many messages, it makes it harder to find actual error messages.

thanks, makes sense that debug with only specific parts would be better 👍

blakeblackshear commented 2 years ago

In your original post, the json config you posted indicates that you did not have record enabled in your config file at that time. I can see that easily by looking at cameras -> entrance_cam -> ffmpeg_cmds -> cmd. It is missing the portion of the ffmpeg command that writes video to the cache.

Can you post your json config from the debug page with the latest /config/frigate.yml you posted?

heapxor commented 2 years ago

@blakeblackshear dont get it ... whats the issue with ffmpeg?

the latest frigate.yml was posthed here https://github.com/blakeblackshear/frigate/issues/3008#issuecomment-1076935923

and from the debug page its here


{
  "birdseye": {
    "enabled": true,
    "height": 720,
    "mode": "objects",
    "quality": 8,
    "width": 1280
  },
  "cameras": {
    "entrance_cam": {
      "best_image_timeout": 60,
      "detect": {
        "enabled": false,
        "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",
          "-stimeout",
          "5000000",
          "-use_wallclock_as_timestamps",
          "1"
        ],
        "inputs": [
          {
            "global_args": [],
            "hwaccel_args": [],
            "input_args": [],
            "path": "rtsp://xxx:xxxx@10.0.1.xxx:554",
            "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 -stimeout 5000000 -use_wallclock_as_timestamps 1 -i rtsp://xxxx:xxxx@10.0.1.xxx:554 -c copy -f flv rtmp://127.0.0.1/live/entrance_cam -r 5 -s 1280x720 -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": "",
        "threshold": 25
      },
      "mqtt": {
        "bounding_box": true,
        "crop": true,
        "enabled": true,
        "height": 270,
        "quality": 70,
        "required_zones": [],
        "timestamp": true
      },
      "name": "entrance_cam",
      "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": null,
          "post_capture": 5,
          "pre_capture": 5,
          "required_zones": [],
          "retain": {
            "default": 180,
            "mode": "motion",
            "objects": {}
          }
        },
        "expire_interval": 60,
        "retain": {
          "days": 0,
          "mode": "all"
        },
        "retain_days": null
      },
      "rtmp": {
        "enabled": true
      },
      "snapshots": {
        "bounding_box": true,
        "clean_copy": true,
        "crop": false,
        "enabled": true,
        "height": null,
        "quality": 70,
        "required_zones": [],
        "retain": {
          "default": 180,
          "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
      },
      "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": null
    },
    "width": 1280
  },
  "detectors": {
    "cpu1": {
      "device": "usb",
      "num_threads": 3,
      "type": "cpu"
    },
    "cpu2": {
      "device": "usb",
      "num_threads": 3,
      "type": "cpu"
    },
    "cpu3": {
      "device": "usb",
      "num_threads": 3,
      "type": "cpu"
    }
  },
  "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": 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": "10.0.1.xxxx",
    "password": "mqtt",
    "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"
  },
  "objects": {
    "filters": null,
    "mask": "",
    "track": [
      "person"
    ]
  },
  "record": {
    "enabled": false,
    "events": {
      "max_seconds": 300,
      "objects": null,
      "post_capture": 5,
      "pre_capture": 5,
      "required_zones": [],
      "retain": {
        "default": 180,
        "mode": "motion",
        "objects": {}
      }
    },
    "expire_interval": 60,
    "retain": {
      "days": 0,
      "mode": "all"
    },
    "retain_days": null
  },
  "rtmp": {
    "enabled": true
  },
  "snapshots": {
    "bounding_box": true,
    "clean_copy": true,
    "crop": false,
    "enabled": false,
    "height": null,
    "quality": 70,
    "required_zones": [],
    "retain": {
      "default": 180,
      "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
  }
}
blakeblackshear commented 2 years ago

The json config doesn't match your yml config. The json config indicates that record is not enabled in your frigate.yml file. This means you are either posting a different file or haven't restarted frigate since you updated frigate.yml.

Can you restart the addon, wait one minute, and then post the log output of the addon?

heapxor commented 2 years ago

@blakeblackshear i did that here is it


{
  "birdseye": {
    "enabled": true,
    "height": 720,
    "mode": "objects",
    "quality": 8,
    "width": 1280
  },
  "cameras": {
    "entrance_cam": {
      "best_image_timeout": 60,
      "detect": {
        "enabled": false,
        "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",
          "-stimeout",
          "5000000",
          "-use_wallclock_as_timestamps",
          "1"
        ],
        "inputs": [
          {
            "global_args": [],
            "hwaccel_args": [],
            "input_args": [],
            "path": "rtsp://xxx:x@10.0.1.1x:554",
            "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 -stimeout 5000000 -use_wallclock_as_timestamps 1 -i rtsp://x:x@10.0.1.1x:554 -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an /tmp/cache/entrance_cam-%Y%m%d%H%M%S.mp4 -c copy -f flv rtmp://127.0.0.1/live/entrance_cam -r 5 -s 1280x720 -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": "",
        "threshold": 25
      },
      "mqtt": {
        "bounding_box": true,
        "crop": true,
        "enabled": true,
        "height": 270,
        "quality": 70,
        "required_zones": [],
        "timestamp": true
      },
      "name": "entrance_cam",
      "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": null,
          "post_capture": 5,
          "pre_capture": 5,
          "required_zones": [],
          "retain": {
            "default": 180,
            "mode": "motion",
            "objects": {}
          }
        },
        "expire_interval": 60,
        "retain": {
          "days": 0,
          "mode": "all"
        },
        "retain_days": null
      },
      "rtmp": {
        "enabled": true
      },
      "snapshots": {
        "bounding_box": true,
        "clean_copy": true,
        "crop": false,
        "enabled": true,
        "height": null,
        "quality": 70,
        "required_zones": [],
        "retain": {
          "default": 180,
          "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
      },
      "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": null
    },
    "width": 1280
  },
  "detectors": {
    "cpu1": {
      "device": "usb",
      "num_threads": 3,
      "type": "cpu"
    },
    "cpu2": {
      "device": "usb",
      "num_threads": 3,
      "type": "cpu"
    },
    "cpu3": {
      "device": "usb",
      "num_threads": 3,
      "type": "cpu"
    }
  },
  "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": 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": "10.0.1.xx",
    "password": "mqtt",
    "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"
  },
  "objects": {
    "filters": null,
    "mask": "",
    "track": [
      "person"
    ]
  },
  "record": {
    "enabled": false,
    "events": {
      "max_seconds": 300,
      "objects": null,
      "post_capture": 5,
      "pre_capture": 5,
      "required_zones": [],
      "retain": {
        "default": 180,
        "mode": "motion",
        "objects": {}
      }
    },
    "expire_interval": 60,
    "retain": {
      "days": 0,
      "mode": "all"
    },
    "retain_days": null
  },
  "rtmp": {
    "enabled": true
  },
  "snapshots": {
    "bounding_box": true,
    "clean_copy": true,
    "crop": false,
    "enabled": false,
    "height": null,
    "quality": 70,
    "required_zones": [],
    "retain": {
      "default": 180,
      "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
  }
}
`
heapxor commented 2 years ago

@blakeblackshear seems it works now

[core-ssh ~]$ ls /media/frigate/recordings/ 2022-03

NickM-27 commented 2 years ago

@heapxor are things working as expected now and clips being generated with events?

heapxor commented 2 years ago

@NickM-27 seems so, thank you for your assistance and help.

cubedmeatgoeshere commented 2 years ago

For anyone else with this issue and is running Frigate as a Home Assistant add-on like I am, the problem was that using the 3-dot menu -> Restart Frigate was not actually loading the changes I made to frigate.yml. You need to go into HA Add-ons and restart Frigate from there instead.