question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Frigate 0.9.0 RC5] Event videos contain no event

See original GitHub issue

Describe the bug Sometimes I have the problem that an event has a very good snapshot/preview, but the video does not contain the event. The recognized object is then simply not visible. It looks as if a different point in time was recorded.

Version of frigate 0.9.0-aa807d2

Config file

logger:
  default: info
  # logs:
  #   frigate.events: debug

detectors:
  coral1:
    type: edgetpu
    device: pci:0

mqtt:
  host: IP
  topic_prefix: frigate
  client_id: frigate
  user: USER
  password: PASS
  stats_interval: 600

ffmpeg:
  input_args:
    - -avoid_negative_ts
    - make_zero
    - -fflags
    - nobuffer
    - -flags
    - low_delay
    - -strict
    - experimental
    - -fflags
    - +genpts+discardcorrupt
    - -rw_timeout
    - "5000000"
    - -use_wallclock_as_timestamps
    - "1"
    - -f 
    - live_flv
  hwaccel_args:
    - -hwaccel
    - vaapi
    - -hwaccel_device
    - /dev/dri/renderD128

detect:
  enabled: True
  width: 2560
  height: 1440
  fps: 5
  max_disappeared: 100

objects:
  track:
    - person
    - car
    - motorcycle
    - bicycle
    - cat
    - dog

record:
  enabled: True
  retain_days: 0
  events:
    pre_capture: 5
    post_capture: 5
    objects:
      - person
      - car
      - motorcycle
      - bicycle
      - cat
      - dog
    retain:
      default: 30

snapshots:
  enabled: True
  timestamp: True
  bounding_box: False
  retain:
    default: 30

rtmp:
  enabled: False

timestamp_style:
  position: "tl"
  format: "%d.%m.%Y %H:%M:%S"
  thickness: 1

cameras:
  carport:
    ffmpeg:
      inputs:
        - path: rtmp://IP/bcs/channel0_main.bcs?channel=0&stream=0&user=USER&password=PASS
          roles:
            - detect
            - record
    best_image_timeout: 240

    mqtt:
      enabled: True
      timestamp: True
      bounding_box: False
      crop: True
      height: 360

    objects:
      filters:
        car:
          mask:
            - 811,1147,1062,912,1138,844,1496,712,1448,425,1671,158,2560,87,2560,1440,722,1440
    
    zones:
      carport_cars:
        coordinates: 349,1440,1000,413,1549,398,1549,189,2560,189,2560,1440,1571,1440
      carport_road:
        coordinates: 1560,184,1556,391,993,418,351,1440,0,1440,0,189

  entrance:
    ffmpeg:
      inputs:
        - path: rtmp://IP/bcs/channel0_main.bcs?channel=0&stream=0&user=USER&password=PASS
          roles:
            - detect
            - record
    best_image_timeout: 240

    mqtt:
      enabled: True
      timestamp: True
      bounding_box: False
      crop: True
      height: 360

    motion:
      mask:
        - 1562,0,2560,0,2560,1440,1909,1440
        - 0,1440,0,0,518,0,647,860,996,936,1060,1440

    zones:
      entrance_steps:
        coordinates: 1124,1180,1029,944,638,849,616,642,1273,549,1300,356,1740,389,1904,1440,940,1440
        objects:
          - person
      entrance_road:
        coordinates: 627,262,662,0,1742,0,1691,364

  frontdoor:
    ffmpeg:
      inputs:
        - path: rtmp://IP/bcs/channel0_main.bcs?channel=0&stream=0&user=USER&password=PASS
          roles:
            - detect
            - record
    best_image_timeout: 240

    mqtt:
      enabled: True
      timestamp: True
      bounding_box: False
      crop: True
      height: 360

    motion:
      mask:
        - 1946,0,2560,0,2560,1440,1760,1440
        - 0,0,844,0,970,1440,0,1440
    
    zones:
      frontdoor_steps:
        coordinates: 1982,82,2560,82,2560,1440,1762,1440
      frontdoor_door:
        coordinates: 853,84,1980,84,1773,1389,991,1373

Frigate container logs Nothing relevant found

Frigate stats

{"carport":{"camera_fps":5.1,"capture_pid":232,"detection_fps":0.0,"pid":219,"process_fps":5.1,"skipped_fps":0.0},"detection_fps":0.0,"detectors":{"coral1":{"detection_start":0.0,"inference_speed":7.19,"pid":215}},"entrance":{"camera_fps":5.3,"capture_pid":237,"detection_fps":0.0,"pid":222,"process_fps":5.3,"skipped_fps":0.0},"frontdoor":{"camera_fps":5.4,"capture_pid":241,"detection_fps":0.0,"pid":228,"process_fps":5.4,"skipped_fps":0.0},"service":{"storage":{"/dev/shm":{"free":116.5,"mount_type":"tmpfs","total":134.2,"used":17.7},"/media/frigate/clips":{"free":1772014.4,"mount_type":"btrfs","total":2000397.9,"used":227008.7},"/media/frigate/recordings":{"free":1772014.4,"mount_type":"btrfs","total":2000397.9,"used":227008.7},"/tmp/cache":{"free":989.0,"mount_type":"tmpfs","total":1000.0,"used":11.0}},"uptime":3678,"version":"0.9.0-aa807d2"}}

FFprobe from your camera

Run the following command and paste output below

  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
Input #0, flv, from 'rtmp://IP/bcs/channel0_main.bcs?channel=0&stream=0&user=USER&password=PASS':
  Metadata:
    displayWidth    : 2560
    displayHeight   : 1440
  Duration: 00:00:00.00, start: 326315.858000, bitrate: N/A
    Stream #0:0: Data: none
    Stream #0:1: Video: h264, yuv420p(progressive), 2560x1440, 6 fps, 6.25 tbr, 1k tbn
    Stream #0:2: Audio: aac, 16000 Hz, mono, fltp
Unsupported codec with id 0 for input stream 0

Screenshots I could prepare a video where you can see no object if that helps 😉

Computer Hardware

  • OS: Ubuntu
  • Install method: Docker Compose
  • Coral Version: m.2 PCIe
  • Network Setup: Wired

Camera Info:

  • Manufacturer: Reolink
  • Model: RLC-520
  • Resolution: 2560x1440
  • FPS: 6

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:32 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
blakeblackshearcommented, Oct 18, 2021

Give this image a try blakeblackshear/frigate:record_debug-04a5614-amd64. This is going to log information for each recording segment evaluated during the expiration job. It will generate a lot of logs every minute. Set your logging config to the following:

logger:
  default: info
  logs:
    frigate.record: debug

Once it happens again, gzip the log file and post here.

1reaction
Homascommented, Oct 1, 2021

In the other issue you actually gave me an idea how to validate that.

root@beeb7444779d:/media/frigate/recordings/2021-09/30/17/backyardright520# for x in *; do echo -n "$x " ;ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 $x; done
00.09.mp4 9.601000
00.19.mp4 9.617000
00.29.mp4 9.568000
00.39.mp4 9.572000
00.49.mp4 9.586000
00.59.mp4 9.606000
01.09.mp4 9.501000
01.19.mp4 9.602000
01.29.mp4 9.563000
01.39.mp4 9.586000
---cut---
09.18.mp4 11.630000
09.30.mp4 7.648000
09.38.mp4 9.659000
09.48.mp4 9.605000
09.58.mp4 9.626000
10.08.mp4 11.570000
--- cut ---

you see that every segment is less than 10 seconds. some recordings were more that 10 seconds.

root@beeb7444779d:/media/frigate/recordings/2021-09/30/17/backyardright520# for x in *; do echo -n "$x " ;ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 $x; done | awk '{sum+=$2} END {print sum}'
**3468.55**

and in total the whole hour (3600 seconds) recordings didn’t get 130 seconds. Because my example was towards to the end of the hour, so there were about 120 seconds delay. During last 10 minutes I’ve lost about 10 seconds.

root@beeb7444779d:/media/frigate/recordings/2021-09/30/17/backyardright520# for x in 5*; do echo -n "$x " ;ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 $x; done | awk '{sum+=$2} END {print sum}'
578.276

here is the camera’s config (reolink 520)

  backyardright520: 
    ffmpeg:
      inputs:
#        - path: rtsp://frigateuser:frigatepwd@192.168.10.101:554/h264Preview_01_main
         - path: rtmp://192.168.10.101/bcs/channel0_main.bcs?channel=0&stream=0&user=frigateuser&password=frigatepwd
           roles:
#             - rtmp
             - record
# medium quality
         - path: rtmp://192.168.10.101/bcs/channel0_ext.bcs?channel=0&stream=0&user=frigateuser&password=frigatepwd
# low quality
#         - path: rtmp://192.168.10.101/bcs/channel0_sub.bcs?channel=0&stream=0&user=frigateuser&password=frigatepwd
           roles:
             - detect
             - rtmp
      input_args: -avoid_negative_ts make_zero -fflags nobuffer -flags low_delay -strict experimental -fflags +genpts+discardcorrupt -rw_timeout 5000000 -use_wallclock_as_timestamps 1 -f live_flv

    record:
      enabled: True
      retain_days: 2
      events:
        retain:
          default: 30
    snapshots:
      enabled: True
    motion:
      mask:
        - 1280,275,1280,0,1183,0,828,0
        - 754,25,819,25,818,47,443,44,443,21
    objects:
      track:
        - person
        - dog
        - cat
        - bird

the issue I see on amcrest ip-5mp camera but I’l loosing a bit less.

root@beeb7444779d:/media/frigate/recordings/2021-09/30/14/frontgarageamcip5m# for x in *; do echo -n "$x " ;ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 $x; done
00.01.mp4 9.913000
00.11.mp4 9.914000
00.21.mp4 9.904000
00.31.mp4 9.908000
00.41.mp4 9.905000
---cut---
root@beeb7444779d:/media/frigate/recordings/2021-09/30/14/frontgarageamcip5m# for x in *; do echo -n "$x " ;ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 $x; done | awk '{sum+=$2} END {print sum}'
3556

So on Amcrest camera I’ve lost 44 seconds vs 130 on Reolink.

  frontgarageamcip5m: #
    ffmpeg:
      inputs:
        # Required: the path to the stream
        # NOTE: Environment variables that begin with 'FRIGATE_' may be referenced in {}
#high quality
        - path: rtsp://frigateuser:frigatepwd@192.168.10.127:554
          roles:
            - rtmp
            - record
#low quality
#        - path: rtsp://frigateuser:frigatepwd@192.168.10.127:554/cam/realmonitor?channel=1&subtype=1
#          roles:
            - detect

    record:
      enabled: True
      retain_days: 2 
      events:
        retain:
          default: 30
        required_zones:
          - road
          - driveway
          - wholeview
    detect:
      fps: 15
      max_disappeared: 75
#    best_image_timeout: 15
    zones:
      road:
#        coordinates: 174,159,1026,182,1031,141,1059,100,1110,99,1197,126,1280,150,1175,86,1028,61,858,25,674,0,301,0,178,25,0,47,0,108,165,97 
#        coordinates: 343,0,150,27,0,57,0,122,149,93,169,167,1091,201,864,21
#        coordinates: 174,159,1053,203,1031,141,858,25,674,0,301,0,151,26,149,79
        coordinates: 174,159,630,147,914,173,1009,181,1063,98,1204,110,1182,83,1081,70,1024,63,858,25,674,0,301,0,8,58,5,113,152,92
        objects:
          - car
          - motorcycle
      driveway:
        coordinates: 609,720,1280,720,1280,457,1036,207,563,175
        objects:
          - car
          - motorcycle
      parked_front:
        coordinates: 1280,243,1280,151,1073,95,1023,153,1091,214
        objects: []
      parked_right:
        coordinates: 0,113,159,95,178,169,0,390
        objects: []
      parked_otherside:
        coordinates: 1034,0,1033,66,860,26,859,0
        objects: []
      wholeview:
        coordinates: 0,720,1280,720,1280,0,0,0
        objects:
          - person
          - bicycle
          - dog
          - cat
          - bird

    snapshots:
      enabled: True
      bounding_box: true
      required_zones:
         - road
         - driveway
         - wholeview
    mqtt:
      required_zones:
        - road
        - driveway
        - wholeview
    motion:
      mask:
        - 1280,0,1280,110,945,55,943,0
        - 119,429,73,593,171,686,270,684,523,666,621,619,565,157,278,155
    objects:
      track:
        - person
        - car
        - bicycle
        - motorcycle
        - dog
        - cat
        - bird
Read more comments on GitHub >

github_iconTop Results From Across the Web

[Frigate 0.9.0 RC5] Event videos contain no event - Codesti
Sometimes I have the problem that an event has a very good snapshot/preview, but the video does not contain the event. The recognized...
Read more >
0.9.0 Release · Discussion #1502 · blakeblackshear/frigate
Separating events and recording this way has significant benefits. Overlapping events no longer mean that the same video footage is stored multiple times...
Read more >
Frigate NVR
Frigate is an open source NVR built around real-time AI object detection. ... One of the most starred network video recorders on GitHub....
Read more >
Static Object Detection in Frigate V 0.10! - YouTube
I'll outline some breaking changes, retain modes, stationary object detection, in-progress events and cache handl...
Read more >
Frigate version 0.9 Updates. Change your config! - YouTube
In this video, I talk about the newest (as of this recording) version of Frigate - version 0.9. This update includes BREAKING CHANGES...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found