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.

Playing events from recordings fails, but works from events? [0.9.0 beta 2]

See original GitHub issue

Two of my six RLC-520A cameras throw errors every 10-20 seconds soon after startup, in both v8 and 9. Whilst I didn’t notice any issues within Frigate in 8, in 9 these two cameras won’t play anything from the Recordings interface - but will play the same Events from the Events interface. The other 4x cameras play Recordings and Events as expected.

Anyone seen this or have any ideas please?

All cameras have the same camera firmware and stream settings. I reset one of these cameras again this morning but no difference. Only Frigate config diff is that these two cameras also track ‘vehicle’ from my custom labelmap - but (not surprisingly) removing this didn’t stop the error.

v9 screenshot: image

Frigate is amazing, thanks for all your work on it!

Versions of frigate 0.8.4-5043040 0.9.0-3340952

Config file Driveway throws error, Entrance does not. Other four cameras repeat this config, except for some object tracking differences

database:
  path: /media/frigate/database/frigate.db

detectors:
  coral:
    type: edgetpu
    device: usb

ffmpeg:
  hwaccel_args:
    - -hwaccel
    - vaapi
    - -hwaccel_device
    - /dev/dri/renderD128

mqtt:
  host: 192.168.1.5
  port: 1883
  user: user
  password:

cameras:
  Driveway:
    ffmpeg:
      inputs:
        - path: rtmp://192.168.1.71/bcs/channel0_sub.bcs?channel=0&stream=0&user=admin&password={FRIGATE_RTSP_PASSWORD}
          roles:
            - detect
        - path: rtmp://192.168.1.71/bcs/channel0_main.bcs?channel=1&stream=0&user=admin&password={FRIGATE_RTSP_PASSWORD}
          roles:
            - record
            - rtmp
      input_args:
        - -fflags
        - nobuffer
        - -flags
        - low_delay
        - -strict
        - experimental
        - -rw_timeout
        - '5000000'
        - -f
        - live_flv
    detect:
      width: 640
      height: 480
      fps: 7

    motion:
      mask:
        - 222,469,222,447,417,447,417,469

    objects:
      track:
        - person
        - vehicle
        - dog

    record:
      enabled: true
      retain_days: 8
      events:
        enabled: true
        pre_capture: 3
        retain:
          default: 8

    snapshots:
      retain:
        default: 8


  Entrance:
    ffmpeg:
      inputs:
        - path: rtmp://192.168.1.72/bcs/channel0_sub.bcs?channel=0&stream=0&user=admin&password={FRIGATE_RTSP_PASSWORD}
          roles:
            - detect
        - path: rtmp://192.168.1.72/bcs/channel0_main.bcs?channel=1&stream=0&user=admin&password={FRIGATE_RTSP_PASSWORD}
          roles:
            - record
            - rtmp
      input_args:
        - -fflags
        - nobuffer
        - -flags
        - low_delay
        - -strict
        - experimental
        - -rw_timeout
        - '5000000'
        - -f
        - live_flv
    detect:
      width: 640
      height: 480
      fps: 7

    motion:
      mask:
        - 222,469,222,447,417,447,417,469

    objects:
      track:
        - person
        - dog

    record:
      enabled: true
      retain_days: 8
      events:
        enabled: true
        pre_capture: 3
        retain:
          default: 8

    snapshots:
      retain:
        default: 8

labelmap.txt

0  person
1  bicycle
2  vehicle
3  vehicle
4  airplane
5  bus
6  train
7  vehicle
8  boat
9 ...etc.

Frigate container logs These errors are repeated every 10-20 seconds

[2021-08-20 08:37:53] ffmpeg.Balcony.record_rtmp     ERROR   : av_interleaved_write_frame(): Connection reset by peer,
[2021-08-20 08:37:53] ffmpeg.Balcony.record_rtmp     ERROR   : [flv @ 0x564814fe1cc0] Failed to update header with correct duration.,
[2021-08-20 08:37:53] ffmpeg.Balcony.record_rtmp     ERROR   : [flv @ 0x564814fe1cc0] Failed to update header with correct filesize.,
[2021-08-20 08:37:53] ffmpeg.Balcony.record_rtmp     ERROR   : Error writing trailer of rtmp://127.0.0.1/live/Balcony: Connection reset by peer,
[2021-08-20 08:37:53] watchdog.Balcony               INFO    : Terminating the existing ffmpeg process...,
[2021-08-20 08:37:53] watchdog.Balcony               INFO    : Waiting for ffmpeg to exit gracefully...,
[2021-08-20 08:37:54] ffmpeg.Driveway.record_rtmp    ERROR   : av_interleaved_write_frame(): Connection reset by peer,
[2021-08-20 08:37:54] ffmpeg.Driveway.record_rtmp    ERROR   : [flv @ 0x55ca8cc6e640] Failed to update header with correct duration.,
[2021-08-20 08:37:54] ffmpeg.Driveway.record_rtmp    ERROR   : [flv @ 0x55ca8cc6e640] Failed to update header with correct filesize.,
[2021-08-20 08:37:54] ffmpeg.Driveway.record_rtmp    ERROR   : Error writing trailer of rtmp://127.0.0.1/live/Driveway: Connection reset by peer,
[2021-08-20 08:37:54] watchdog.Driveway              INFO    : Terminating the existing ffmpeg process...,
[2021-08-20 08:37:54] watchdog.Driveway              INFO    : Waiting for ffmpeg to exit gracefully...,

after a reboot of Frigate

[2021-08-20 10:07:40] ffmpeg.Driveway.record_rtmp    ERROR   : av_interleaved_write_frame(): Connection reset by peer,
[2021-08-20 10:07:40] ffmpeg.Driveway.record_rtmp    ERROR   : [flv @ 0x55de542619c0] Failed to update header with correct duration.,
[2021-08-20 10:07:40] ffmpeg.Driveway.record_rtmp    ERROR   : [flv @ 0x55de542619c0] Failed to update header with correct filesize.,
[2021-08-20 10:07:40] ffmpeg.Driveway.record_rtmp    ERROR   : Error writing trailer of rtmp://127.0.0.1/live/Driveway: Connection reset by peer,
[2021-08-20 10:07:40] watchdog.Driveway              INFO    : Terminating the existing ffmpeg process...,
[2021-08-20 10:07:40] watchdog.Driveway              INFO    : Waiting for ffmpeg to exit gracefully...,
[2021-08-20 10:07:40] ffmpeg.Balcony.record_rtmp     ERROR   : av_interleaved_write_frame(): Connection reset by peer,
[2021-08-20 10:07:40] ffmpeg.Balcony.record_rtmp     ERROR   : [flv @ 0x55f920537980] Failed to update header with correct duration.,
[2021-08-20 10:07:40] ffmpeg.Balcony.record_rtmp     ERROR   : [flv @ 0x55f920537980] Failed to update header with correct filesize.,
[2021-08-20 10:07:40] ffmpeg.Balcony.record_rtmp     ERROR   : Error writing trailer of rtmp://127.0.0.1/live/Balcony: Connection reset by peer,
[2021-08-20 10:07:40] watchdog.Balcony               INFO    : Terminating the existing ffmpeg process...,
[2021-08-20 10:07:40] watchdog.Balcony               INFO    : Waiting for ffmpeg to exit gracefully...,
[2021-08-20 10:08:30] ffmpeg.Balcony.record_rtmp     ERROR   : av_interleaved_write_frame(): Connection reset by peer,

Frigate stats

{"Balcony":{"camera_fps":7.0,"capture_pid":256,"detection_fps":0.0,"pid":233,"process_fps":7.0,"skipped_fps":0.0},"Deck":{"camera_fps":7.1,"capture_pid":244,"detection_fps":0.0,"pid":229,"process_fps":7.1,"skipped_fps":0.0},"Driveway":{"camera_fps":7.0,"capture_pid":234,"detection_fps":0.0,"pid":223,"process_fps":7.0,"skipped_fps":0.0},"Entrance":{"camera_fps":7.0,"capture_pid":238,"detection_fps":7.5,"pid":224,"process_fps":7.1,"skipped_fps":0.0},"Laundry":{"camera_fps":7.1,"capture_pid":252,"detection_fps":0.0,"pid":232,"process_fps":7.1,"skipped_fps":0.0},"Rumpus":{"camera_fps":7.1,"capture_pid":240,"detection_fps":0.0,"pid":227,"process_fps":7.1,"skipped_fps":0.0},"detection_fps":7.5,"detectors":{"coral":{"detection_start":0.0,"inference_speed":15.18,"pid":218}},"service":{"storage":{"/dev/shm":{"free":61.6,"mount_type":"tmpfs","total":67.1,"used":5.5},"/media/frigate/clips":{"free":966375.4,"mount_type":"nfs4","total":1298700.9,"used":331788.6},"/media/frigate/recordings":{"free":966375.4,"mount_type":"nfs4","total":1298700.9,"used":331788.6},"/tmp/cache":{"free":1951.7,"mount_type":"tmpfs","total":2000.0,"used":48.3}},"uptime":17054,"version":"0.9.0-3340952"}}

Computer Hardware

  • OS: Debian 10
  • Install method: Docker Compose
  • Coral Version: USB
  • Network Setup: Wired, POE cameras
  • NAS for all media storage

docker-compose.yml

version: '3'
services:
  frigate:
    container_name: frigate-9.0
    image: blakeblackshear/frigate:0.9.0-beta2-amd64
    hostname: frigate-9.0
    # privileged: true
    restart: always
    devices:
      - /dev/bus/usb:/dev/bus/usb
      - /dev/dri/renderD128
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /usr/docker/frigate-9.0/config.yml:/config/config.yml:ro
      - /usr/docker/frigate-9.0/labelmap.txt:/labelmap.txt:ro
      - /usr/docker/frigate-9.0/database:/media/frigate/database
      - /mnt/nas_storage/frigate:/media/frigate
      - type: tmpfs
        target: /tmp/cache
        tmpfs:
          size: 2000000000
    network_mode: bridge
    ports:
      - 5000:5000
      - 1935:1935 # RTMP feeds
    environment:
      FRIGATE_RTSP_PASSWORD: ""
      LIBVA_DRIVER_NAME: "radeonsi"

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
jasonpstokescommented, Sep 4, 2021

An update: switching to the MQ (Balanced) stream for detect has made a big improvement for me. This is most evident at night, if (re)starting Frigate when the cameras are in B&W mode: using the LQ (fluent) stream for detect, Frigate would show green screens for up to a minute on several (random) cameras and log lots of broken frame errors - whereas the MQ streams show immediately!

I’m also using http streams as MarkGodwin suggested (here) and, whilst it’s only been 4 days, overall these two changes have made a big improvement. Far fewer broken frames messages and the camera recordings work.

However, I am now seeing the detection process get stuck a few times a day - anyone else seen this ? EDIT: Switched to 0.8 (running the same docker and Frigate config) and within an hour got the same error.

[2021-09-01 22:05:16] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:46980],
[2021-09-02 06:01:10] frigate.watchdog               INFO    : Detection appears to be stuck. Restarting detection process...,
[2021-09-02 06:01:10] root                           INFO    : Waiting for detection process to exit gracefully...,
[2021-09-02 06:01:40] root                           INFO    : Detection process didnt exit. Force killing...,
[2021-09-02 06:01:40] detector.coral                 INFO    : Starting detection process: 32013,
[2021-09-02 06:01:40] frigate.edgetpu                INFO    : Attempting to load TPU as usb,
[2021-09-02 06:01:43] frigate.edgetpu                INFO    : TPU found,
[2021-09-02 07:23:00] frigate.watchdog               INFO    : Detection appears to be stuck. Restarting detection process...,
[2021-09-02 07:23:00] root                           INFO    : Waiting for detection process to exit gracefully...,
[2021-09-02 07:23:30] root                           INFO    : Detection process didnt exit. Force killing...,
[2021-09-02 07:23:30] detector.coral                 INFO    : Starting detection process: 35948,
[2021-09-02 07:23:30] frigate.edgetpu                INFO    : Attempting to load TPU as usb,
[2021-09-02 07:23:33] frigate.edgetpu                INFO    : TPU found,
[2021-09-02 10:02:25] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:53556],

Here’s my 0.9 rc2 config if anyone else with Reolink cameras wants to try this-

config.yml

database:
  path: /media/frigate/database/frigate.db

detectors:
  coral:
    type: edgetpu
    device: usb

mqtt:
  host: 192.168.1.5
  port: 1883
  user: mqtt
  password: "{FRIGATE_MQTT_PASSWORD}"

birdseye:
  mode: continuous
  width: 1792
  height: 1344

detect:
  width: 896
  height: 672
  fps: 5

ffmpeg:
  input_args:
    - -avoid_negative_ts
    - make_zero
    - -fflags
    - nobuffer
    - -fflags
    - +genpts+discardcorrupt
    - -flags
    - low_delay
    - -strict
    - experimental
    - -rw_timeout
    - '5000000'
    - -f
    - live_flv

motion:
  mask:
    - 265,650,265,625,635,625,635,650 # timestamp - mine is set to bottom centre in the cameras

record:
  enabled: true
  retain_days: 1
  events:
    enabled: true
    pre_capture: 3
    retain:
      default: 15

snapshots:
  enabled: true
  clean_copy: false
  bounding_box: true
  retain:
    default: 15

cameras:
  Driveway:
    ffmpeg:
      inputs:
        - path: http://192.168.1.71/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user={FRIGATE_USER}&password={FRIGATE_PASSWORD}
          roles:
            - detect
        - path: http://192.168.1.71/flv?port=1935&app=bcs&stream=channel0_main.bcs&user={FRIGATE_USER}&password={FRIGATE_PASSWORD}
          roles:
            - record
    objects:
      track:
        - person
        - vehicle
        - dog
    rtmp:
      enabled: false
    timestamp_style:
      format: "%d/%m/%Y %H:%M:%S"

  Entrance:
    ffmpeg:
      inputs:
        - path: http://192.168.1.72/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user={FRIGATE_USER}&password={FRIGATE_PASSWORD}
          roles:
            - detect
        - path: http://192.168.1.72/flv?port=1935&app=bcs&stream=channel0_main.bcs&user={FRIGATE_USER}&password={FRIGATE_PASSWORD}
          roles:
            - record
    objects:
      track:
        - person
        - dog
    rtmp:
      enabled: false
    timestamp_style:
      format: "%d/%m/%Y %H:%M:%S"

docker-compose.yml

services:
  frigate:
    container_name: frigate
    image: blakeblackshear/frigate:0.9.0-rc2-amd64
    hostname: frigate
    restart: always
    shm_size: '300m'
    devices:
      - /dev/bus/usb:/dev/bus/usb
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /usr/docker/frigate/config.yml:/config/config.yml:ro
      - /usr/docker/frigate/labelmap.txt:/labelmap.txt:ro
      - /usr/docker/frigate/database:/media/frigate/database
      - /mnt/nas_storage/frigate:/media/frigate
      - type: tmpfs
        target: /tmp/cache
        tmpfs:
          size: 2000000000
    network_mode: bridge
    ports:
      - 5000:5000
    environment:
      FRIGATE_MQTT_PASSWORD: " "
      FRIGATE_USER: " "
      FRIGATE_PASSWORD: " "
0reactions
jasonpstokescommented, Sep 9, 2021

Running with http has made frigate a lot more stable for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Webcam freezing, webcam shrinking, webcam streaming error ...
a time. In the recording they drop several at a time, minutes apart. At about 77 minutes into the call, slightly less, several...
Read more >
Kafka 2.4 Documentation
0.0, a light-weight but powerful stream processing library called Kafka Streams is available in Apache Kafka to perform such data processing as described...
Read more >
bigbluebutton <Failed to archive events for>...<Permission ...
Hello i have a BigBlueButton (0.9.0-beta (622)) installation on Debian Wheezy (7.8) all is ok except archiving recordings.
Read more >
Mux Data Rendition Change Details
You can now set the maximum duration for recording a single live stream event lower than 12 hours. Set the max_continuous_duration parameter during...
Read more >
Bug listing with status RESOLVED with resolution UPSTREAM ...
... Bug:36899 - "KMail 3.2.0-beta2 fails to open a message encrypted with ... in the event of a crash" status:RESOLVED resolution:UPSTREAM severity:normal ...
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