blakeblackshear / frigate

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

[Support]: Recording and event time mismatch #3784

Closed Morphy99 closed 1 year ago

Morphy99 commented 2 years ago

Describe the problem you are having

I've only seen this once since upgrading to 0.11.0-37325C7 a few days ago but somehow this has happened:

image

I've checked the events and there are no other recordings for 3:29, neither is there an event at 05:00. There is nothing in the logs at those times either.

Typical that it missed Mr Fox however I have endless footage of cars! image

Version

0.11.0-37325C7

Frigate config file

mqtt:
  host: xxxxx

database:
  # The path to store the SQLite DB (default: shown below)
  path: /db/frigate.db

detectors:
  coral_pci:
    type: edgetpu
    device: pci

objects:
  track:
    - person
    - car
    - cat
    - dog
  filters:
    person:
      threshold: 0.7

record:
  enabled: True
  retain:
    days: 0
  events:
    retain:
      default: 20
      mode: active_objects
    pre_capture: 10
    post_capture: 10

snapshots:
  enabled: True
  timestamp: False
  bounding_box: True
  crop: False
  retain:
    default: 20

cameras:
###############################################################front########################################################################
  front:
    ffmpeg:
      inputs:
        - path: rtmp://xxxxx/bcs/channel0_main.bcs?channel=0&stream=0&user=xxxx&password=xxxx
          roles:
            - detect
            - record
            - rtmp
      input_args:
        - -avoid_negative_ts
        - make_zero
      output_args:
          record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c:v copy -c:a aac
    detect:
      width: 2048 #896
      height: 1536 #672
      fps: 7
    mqtt:
      required_zones: 
        - front_drive
        - front_path
    motion:
      mask:
        - 0,80,780,79,795,0,0,0
        - 577,732,168,1428,0,1380,0,1042,284,618,417,415,616,413,643,681
        - 1272,612,1363,826,1575,782,1509,595,1552,475,1330,457
        - 1255,689,1251,1403,423,1369,664,649
    objects:
      filters:
        car:
          mask:
            - 22,0,2048,0,2048,488,1318,417,587,413,0,446,0,0
            - 670,573,195,1536,0,1536,0,554
            - 1629,1536,2048,1536,2048,627,1220,564
        dog:
          max_area: 10000
        person:
          min_area: 5000
          mask: 
            - 2048,0,2048,384,1220,261,631,268,0,336,0,0
            - 1206,689,1241,1253,539,1220,668,676
            - 1272,612,1363,826,1575,782,1509,595,1552,475,1330,457
            - 1432,1000,1228,1000,1249,1141,1471,1133
    zones:
      front_drive:
        coordinates: 98,1392,859,1515,1668,1490,1309,720,531,710,357,950
        filters:
          person:
            min_area: 50000
          dog:
            min_area: 5000
      front_path:
        coordinates: 1722,1536,2048,1536,2048,1177,1728,722,1365,724
        filters:
          person:
            min_area: 80000
          dog:
            min_area: 5000
      front_nd_51:
        coordinates: 2048,984,2048,735,1847,741
      front_nd_55:
        coordinates: 328,716,0,716,0,1098
      front_road_ns_path:
        coordinates: 961,687,2048,681,2048,602,990,546,311,558,0,583,0,658
      front_road:
        coordinates: 2048,595,2048,421,1529,351,772,322,440,347,0,380,0,569,718,550,1639,567
      front_road_os_path:
        coordinates: 425,270,0,309,0,380,641,317,1260,322,2048,419,2048,376,1648,293,942,247
    record:
      events:
        required_zones:
          - front_drive
          - front_path
          - front_nd_51
          - front_nd_55
          - front_road_ns_path
          - front_road
          - front_road_os_path
    snapshots:
      required_zones:
        - front_drive
        - front_path
        - front_nd_51
        - front_nd_55
        - front_road_ns_path
        - front_road
        - front_road_os_path

###############################################################back patio######################################################################

  back_patio:
    ffmpeg:
      input_args: -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -flags low_delay -strict experimental -analyzeduration 1000M -probesize 1000M -rw_timeout 5000000
      output_args: 
        record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy
      inputs:
        - path: http://xxxxxxx/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=xxxx&password=xxxx
          roles:
            - record
            - rtmp
        - path: http://xxxxxxxx/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=xxxx&password=xxxx
          roles:
            - detect
    detect:
      width: 896
      height: 672
      fps: 7
    mqtt:
      required_zones:
        - back_patio_left
        - back_patio_right
        - back_patio_steps
        - back_patio_shed
    live:
      height: 1080
      quality: 15
    record:
      events:
        retain:
          default: 10
        objects:
          - person
          - cat
          - dog
        required_zones:
          - back_patio_left
          - back_patio_right
          - back_patio_steps
          - back_patio_shed
    snapshots:
      required_zones:
        - back_patio_left
        - back_patio_right
        - back_patio_steps
        - back_patio_shed
    objects:
      track:
        - person
        - cat
        - dog
    zones:
      back_patio_left:
        coordinates: 648,0,322,0,320,303,623,291
        filters:
          person:
            min_area: 10000
            max_area: 50000
            threshold: 0.8
      back_patio_right:
        coordinates: 195,672,896,672,896,246,557,285,295,290
        filters:
          person:
            min_area: 30000
            threshold: 0.8
      back_patio_steps:
        coordinates: 214,531,146,156,0,152,0,48,351,59,256,532
        filters:
          person: 
            min_area: 75000
            threshold: 0.8
      back_patio_shed:
        coordinates: 122,149,230,525,197,672,0,672,0,174
        filters:
          person:
            min_area: 100000
            threshold: 0.8
    motion:
      mask:
        - 396,0,397,46,0,42,0,0
        - 326,41,256,144,133,108,128,40

Relevant log output

NA

FFprobe output from your camera

NA

Frigate stats

No response

Operating system

Debian

Install method

Docker CLI

Coral version

PCIe

Network connection

Wired

Camera make and model

Reolink RLC-520

Any other information that may be helpful

No response

NickM-27 commented 2 years ago

Your docker CLI command would be helpful to see.

So to be clear, you're saying that there are no recordings for 3 and the 5 am recordings don't contain this animal?

Morphy99 commented 2 years ago

Your docker CLI command would be helpful to see.

I actually used Portainer to deploy but I've figured out how to find the compose:

version: "2"
services:
  frigate:
    image: blakeblackshear/frigate:stable-amd64
    container_name: frigate
    privileged: true
    devices:
      - /dev/bus/usb
      - /dev/dri/card0
      - /dev/dri/renderD128
    group_add:
      - 107
    volumes:
      - /srv/dev-disk-by-uuid-2cb8c612-80d2-48fc-bda7-57a89736a817/configs/frigate:/config
      - /etc/localtime:/etc/localtime:ro
      - /srv/dev-disk-by-uuid-2cb8c612-80d2-48fc-bda7-57a89736a817/cctv:/media/frigate
      - type: tmpfs
        target: /tmp/cache
        tmpfs:
          size: 1000000000
    ports:
      - 5000:5000
      - 1935:1935
    shm_size: 150M
    restart: unless-stopped
    labels:
      com.centurylinklabs.watchtower.enable: "true"

So to be clear, you're saying that there are no recordings for 3 and the 5 am recordings don't contain this animal?

Yes sorry I cropped the timestamp didn't I. The snapshot and event are 3:29, however, the clip in the event was at 5:00 and with no Fox. I've checked the folder and no recordings at this time either. All my other clips, events, snapshots are in sync. Just this one, very strange.

NickM-27 commented 2 years ago

Interesting, what do your motion masks look like? If they're too big could block the active_objects condition for your recordings. You could also try the all mode for events to see if that makes any difference.

Morphy99 commented 2 years ago

They look like this: motion masks I had to copy them out of the original image for privacy reasons. The motion by this fox would have occurred well away from these though. Sorry, what's the all mode?

NickM-27 commented 2 years ago

all will keep all the segments of recordings while the object is visible instead of just the ones where the object is deemed to be active.

record:
  events:
    retain:
      mode: all

https://docs.frigate.video/configuration/record#what-do-the-different-retain-modes-mean

blakeblackshear commented 2 years ago

When you go to the recordings for that camera, what do you see when watching the footage for the 3AM hour?

Morphy99 commented 2 years ago

When you go to the recordings for that camera, what do you see when watching the footage for the 3AM hour?

There is none. No folder. Just 00 and 05. image

github-actions[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.

Morphy99 commented 2 years ago

I'm testing with mode: all

ghost commented 2 years ago

I see my items also have a different time stamp in frigate compared to the real time image

Pic time stamp in the cam feed is the correct date time.. but frigate is displaying something else.. not even utc covert

NickM-27 commented 2 years ago

I see my items also have a different time stamp in frigate compared to the real time image

Pic time stamp in the cam feed is the correct date time.. but frigate is displaying something else.. not even utc covert

Need to provide the information requested above. What is your docker compose? Does your server have the correct timezone set?

ghost commented 2 years ago

Just running latest frigate 0.11.1 inside Home assistant., not a separate install.

Ha has the right Timezone etc

NickM-27 commented 2 years ago

Just running latest frigate 0.11.1 inside Home assistant., not a separate install.

Ha has the right Timezone etc

It seems like maybe the frigate addon doesn't pass /etc/localtime but then again I'd figure HA just does that for all addons. I'd recommend looking more into the localtime of things in the chain as that is what frigate currently uses.

In 0.12 everything will be based in an agnostic format (some discussion in #4055) and the frontend will be changed so the times are always shown in your current timezone instead of being reliant on the server running frigate

ghost commented 2 years ago

I think I know what's happening.. and it has to do with "IN PROGRESS"

Here is last night a snap I took while 'in progress' which shows the time stamps So 6:25pm the car arrived.. and then at 9:37pm I looked at frigate and took this photo

Screen Shot 2022-11-11 at 9 51 21 am

and now this morning when the car door opened, the same item without the 'in progress' has kept the original frigate date time, but now the clip is from now and not before

Screen Shot 2022-11-11 at 9 51 47 am

its not creating a new item, its blurring the two into the starting item

NickM-27 commented 2 years ago

its not creating a new item, its blurring the two into the starting item

we wouldn't expect it to, the single event is valid as long as the object is visible. I didn't realize that you only had snapshots and not clips, we definitely wouldn't expect the snapshot to line up with when the event started because as the event goes on frigate will take new snapshots based on higher scores that overwrite the existing one for that event (until the event is ended).

github-actions[bot] commented 1 year 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.