blakeblackshear / frigate

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

[Support]: Recordings timeline with wrong event times #3991

Closed dougmaitelli closed 2 days ago

dougmaitelli commented 2 years ago

Describe the problem you are having

For some reason, on the recordings view, the time on the current date always start at the top as 23:00. The event thumbnails show on the timeline on the right times, but the event recordings show on the wrong times starting from the top.

Example: image

Current time: 17:00 There is an event at 16:49 The thumbnail shows on the timeline between 16:00 and 17:00

HOWEVER, if I click 16:00 it shows me the recording from 08:00. The actual recording for 16:00 is on 23:00. Clicking on 23:00 -> shows 16:00 Clicking on 22:00 -> shows 15:00 Clicking on 21:00 -> shows 14:00 Clicking on 20:00 -> shows 13:00 So on...

Again, current time is 17:00, so 20, 21, 22, 23 didn't even have happened yet.

Version

0.11.0

Frigate config file

N/A

Relevant log output

N/A

FFprobe output from your camera

N/A

Frigate stats

{
   "backyard":{
      "camera_fps":5.1,
      "capture_pid":238,
      "detection_fps":5.2,
      "pid":224,
      "process_fps":5.1,
      "skipped_fps":0
   },
   "detection_fps":10.6,
   "detectors":{
      "coral_pci":{
         "detection_start":0,
         "inference_speed":6.83,
         "pid":215
      }
   },
   "front_door":{
      "camera_fps":5.1,
      "capture_pid":236,
      "detection_fps":5.4,
      "pid":222,
      "process_fps":5.1,
      "skipped_fps":0
   },
   "service":{
      "latest_version":"0.11.0",
      "storage":{
         "/dev/shm":{
            "free":247.6,
            "mount_type":"tmpfs",
            "total":268.4,
            "used":20.9
         },
         "/media/frigate/clips":{
            "free":465493.2,
            "mount_type":"zfs",
            "total":536870.9,
            "used":71377.7
         },
         "/media/frigate/recordings":{
            "free":465493.2,
            "mount_type":"zfs",
            "total":536870.9,
            "used":71377.7
         },
         "/tmp/cache":{
            "free":991.6,
            "mount_type":"tmpfs",
            "total":1000,
            "used":8.4
         }
      },
      "temperatures":{
         "apex_0":60.05
      },
      "uptime":677656,
      "version":"0.11.0-3846a13"
   }
}

Operating system

Proxmox

Install method

Docker Compose

Coral version

PCIe

Network connection

Wired

Camera make and model

N/A

Any other information that may be helpful

No response

NickM-27 commented 2 years ago

What does your docker compose file look like?

dougmaitelli commented 2 years ago

What does your docker compose file look like?

version: "3.9"
services:
  frigate:
    image: blakeblackshear/frigate:stable
    privileged: true
    restart: unless-stopped
    shm_size: '256mb'
    environment:
      FRIGATE_RTSP_PASSWORD: ...
    ports:
      - 5000:5000
      - 1935:1935 # RTMP feeds
    devices:
      - /dev/apex_0:/dev/apex_0
      - /dev/dri/renderD128:/dev/dri/renderD128
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /root/frigate/config.yml:/config/config.yml:ro
      - /mnt/frigate:/media/frigate
      - type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
        target: /tmp/cache
        tmpfs:
          size: 1000000000
  double-take:
    image: jakowenko/double-take
    restart: unless-stopped
    ports:
      - 3000:3000
    volumes:
      - /mnt/frigate/double-take:/.storage
NickM-27 commented 2 years ago

Does the device running frigate have its timeline set correctly? Localtime is passed through but seems that the time zone is incorrect.

dougmaitelli commented 2 years ago

Does the device running frigate have its timeline set correctly? Localtime is passed through but seems that the time zone is incorrect.

Yeah, timezone was wrong, just changed it to PST and rebooted and the recordings UI is correct now.

So this fixed my issue, but I still believe there is some issue in the UI, if the event recordings were offset by the timezone, shouldn't the event thumbnails on the timeline also have been offset?

Thanks for the help

NickM-27 commented 2 years ago

I wouldn't say it's a bug, the times in the dev are saved as unix and the times shown are coming from the clients time zone.

dougmaitelli commented 2 years ago

I wouldn't say it's a bug, the times in the dev are saved as unix and the times shown are coming from the clients time zone.

So, the same issue would happen if I access my frigate remotely from a different timezone? (since in that case the browser / client timezone would not match the recordings.

NickM-27 commented 2 years ago

I can see some issue with how the event link is different than the hour links.

blakeblackshear commented 2 years ago

I plan to have the client pass the timezone to the api so the backend can calculate the recordings response based on that in the future. That will make the timezone on the server irrelevant.

hawkeye217 commented 2 years ago

I plan to have the client pass the timezone to the api so the backend can calculate the recordings response based on that in the future. That will make the timezone on the server irrelevant.

That's great. I've experienced the same issue for a while now on a remote Frigate instance in another time zone. I've just dealt with it knowing that everything in the db is in unix time.

Strux-DK commented 9 months ago

I think i am also affected by this, but not sure. When i go to the UI and browse the events, the time is correct and aligns with the time also shown in the recordings. However, when i browse the directories, the time is shifted 1 hour, so the recordings between the hours of 17:00 and 18:00 is in the folder '16'. Running v. 0.12.1-367d724 add-on in HAOS, please tell me if i need to provide more info or open a separate issue.

NickM-27 commented 9 months ago

@Strux-DK no, that is working as designed. The folders are saved in UTC time

Strux-DK commented 9 months ago

@NickM-27 Why? Also, i have to ask.. OP attached a photo of his UI as an example. I don't see that in my UI. Is it because OP is running a beta or experimental version?

NickM-27 commented 9 months ago

for various reasons, storing in UTC allows frigate to easily convert to any timezone when a user has frigate configured to use the frigate timezone. Also because daylight savings time causes a lot of complications but this does not affect UTC.

You do have this UI, just press recordings on one of the cameras in the main camera page

Strux-DK commented 9 months ago

@NickM-27 Thank you!

ehn commented 8 months ago

Currently, whenever you're accessing Frigate from a timezone different from the site, the recordings view is very confusing (and incorrect). It shows events based on the browser time but videos based on the site time. If you try to find a highlighted event in the video, you won't, because you'll be looking at video from the wrong hour segment.

I can't help but think that this and all other timezone-related issues would go away if the browser timezone was completely ignored. When monitoring video surveillance, I believe in essentially all cases, you care about what the time was at the site when an event happened, not what the time was in whatever location you're viewing the UI from.

heisenberg2980 commented 6 months ago

for various reasons, storing in UTC allows frigate to easily convert to any timezone when a user has frigate configured to use the frigate timezone. Also because daylight savings time causes a lot of complications but this does not affect UTC.

You do have this UI, just press recordings on one of the cameras in the main camera page

I think I am experiencing the same issue now after the daylight savings time changed last weekend. When I open any event recorded before Sunday when the time changed, the event is not there. For instance I have an event (car) from last Friday (29th March) at 12:30, and when I click on the event I see the video with the correct time (12:30) but the car is not there, and the event actually happened one hour later, so to see the car I have to manually go to 13:30.

iursevla commented 6 months ago

@heisenberg2980 yeah same here (GMT+1)

The export date is not according to the date I requested in the exports tab

image
ehn commented 3 months ago

The review view in the 0.14 UI ignores the configured timezone and seems to use the browser timezone. Is this considered the same bug as the one discussed in this issue or should a separate issue be opened?

NickM-27 commented 3 months ago

I'd say it's the same bug

NickM-27 commented 2 days ago

this is no longer relevant as it has been fixed for the new UI for 0.15