blakeblackshear / frigate

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

Clips have UTC TimeStamp #1818

Closed fabltd closed 2 years ago

fabltd commented 3 years ago

Describe the bug A clear and concise description of what your issue is.

The overlay on a clip has a UTC timestamp instead of local. When shown in home assistant.

Version of frigate 0.8.4-5043040

blakeblackshear commented 3 years ago

You didn't provide any of the information requested in the template.

fabltd commented 3 years ago

Applogies please see below:

Describe the bug

Clips are overlayed with time stamp in UTC not local time and date is in US format.

Screenshots

cam

Version of frigate Output from /api/version

0.8.4-5043040

Config file Include your full config file wrapped in triple back ticks.

 mqtt:
   # Required: host name
   host: *********
   # 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
   # Optional: password
   # NOTE: Environment variables that begin with 'FRIGATE_' may be referenced in {}.
   #       eg. password: '{FRIGATE_MQTT_PASSWORD}'
   password: *******
   # Optional: interval in seconds for publishing stats (default: shown below)
   stats_interval: 60

 cameras:
   front_door:
     ffmpeg:
       inputs:
         - path: rtsp://admin:{FRIGATE_RTSP_PASSWORD_0}@******/rtsph2641080p
           roles:
             - detect
             - rtmp
             - clips
     width: 1920
     height: 1080
     fps: 5

     # Optional: Camera level detect settings
     detect:
       enabled: True
       # Optional: Number of frames without a detection before frigate considers an object to be gone. (default: 5x the frame rate)
       max_disappeared: 25

     # Optional: save clips configuration
     clips:
      # Required: enables clips for the camera (default: shown below)
      # This value can be set via MQTT and will be updated in startup based on retained value
      enabled: True
      # Optional: Number of seconds before the event to include in the clips (default: shown below)
      pre_capture: 5
      # Optional: Number of seconds after the event to include in the clips (default: shown below)
      post_capture: 5
      # Optional: Objects to save clips for. (default: all tracked objects)
      objects:
        - person
      # Optional: Restrict clips to objects that entered any of the listed zones (default: no required zones)
      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

     rtmp:
     # Required: Enable the live stream (default: True)
        enabled: True```

**Frigate container logs**

See above


**Frigate stats**
```json

{
  "detection_fps": 0.0, 
  "detectors": {
    "coral": {
      "detection_start": 0.0, 
      "inference_speed": 10.34, 
      "pid": 31
    }
  }, 
  "front_door": {
    "camera_fps": 5.0, 
    "capture_pid": 35, 
    "detection_fps": 0.0, 
    "pid": 34, 
    "process_fps": 5.0, 
    "skipped_fps": 0.0
  }, 
  "service": {
    "storage": {
      "/dev/shm": {
        "free": 63.4, 
        "mount_type": "tmpfs", 
        "total": 67.1, 
        "used": 3.7
      }, 
      "/media/frigate/clips": {
        "free": 3265659.9, 
        "mount_type": "nfs4", 
        "total": 3266837.0, 
        "used": 1177.0
      }, 
      "/media/frigate/recordings": {
        "free": 3265659.9, 
        "mount_type": "nfs4", 
        "total": 3266837.0, 
        "used": 1177.0
      }, 
      "/tmp/cache": {
        "free": 985.3, 
        "mount_type": "tmpfs", 
        "total": 1000.0, 
        "used": 14.7
      }
    }, 
    "uptime": 42, 
    "version": "0.8.4-5043040"
  }

FFprobe from your camera

Run the following command and paste output below

ffprobe version 4.2.4-1ubuntu0.1 Copyright (c) 2007-2020 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.3.0-10ubuntu2)
  configuration: --prefix=/usr --extra-version=1ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Input #0, rtsp, from 'rtsp://*******/rtsph2641080p':
  Metadata:
    title           : RTSP/RTP stream from HDIPCam
  Duration: N/A, start: 0.327189, bitrate: N/A
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 15 fps, 25.08 tbr, 90k tbn, 30 tbc

Computer Hardware

Ubuntu 20.04.3 LTS

Docker Compose - See config:

version: "3.9"
services:
  frigate:
    container_name: frigate
    privileged: true # this may not be necessary for all setups
    restart: unless-stopped
    image: blakeblackshear/frigate:stable-amd64
  #  shm_size: '256mb'
    devices:
      - /dev/bus/usb:/dev/bus/usb
      - /dev/dri/renderD128 # for intel hwaccel, needs to be updated for your hardware
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - ./frigate.yml:/config/config.yml:ro
      - /mnt/cctv:/media/frigate
      - type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
        target: /tmp/cache
        tmpfs:
          size: 1000000000
    ports:
      - "5000:5000"
      - "1935:1935" # RTMP feeds

Esxi V7

USB

Wired

``` Camera Info:**

blakeblackshear commented 3 years ago

0.9.0 will include the ability to customize the timestamp format: https://github.com/blakeblackshear/frigate/blob/release-0.9.0/docs/docs/configuration/index.md

The time in the timestamp should follow the host settings based on your compose file: - /etc/localtime:/etc/localtime:ro

jonwilliams84 commented 3 years ago

I got around this by mounting /usr/share/zoneinfo/Europe/London from the host into the container.

It looks like this in kubernetes:

...
      volumeMounts:
            - mountPath: /etc/localtime
              name: tz-london
      volumes:
        - name: tz-london
          hostPath:
            path: /usr/share/zoneinfo/Europe/London
...
bradeales commented 3 years ago

You can also just add a Docker environment variable to your compose file:

environment:
  - FRIGATE_RTSP_PASSWORD="password"
  - TZ=America/Chicago
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.