blakeblackshear / frigate

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

[Camera Support]: Adding Transcoded AAC Audio to go2rtc stream Corrupts all recording segments shortly after startup #7515

Closed EvanGrote closed 1 year ago

EvanGrote commented 1 year ago

Describe the problem you are having

I recently integrated my Nest Doorbell Wired (2nd Generation) with frigate and I was successful at bringing in the video stream via go2rtc's home assistant integration but the default mp4 stream from go2rtc did not include audio, so I configured go2rtc to transcode AAC audio into the stream with ffmpeg so that my recordings in frigate would include audio.

When I comment out the "ffmpeg:entryway_doorbell_frigate#audio=aac" line of my go2rtc config and leave my stream as just video with no audio, everything runs and records fine. My problem is when I enable the AAC transcoding for the stream, my recording will work for a bit (usually 5-10 minutes but sometimes longer) when frigate starts but it eventually starts discarding every recording with a log saying "WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-.mp4" every 10 seconds until I restart frigate.

Version

0.12.1-367D724

Frigate config file

# https://docs.frigate.video/guides/getting_started

mqtt:
  host: 192.168.1.11
  port: 1883

detectors:
  coral:
    type: edgetpu
    device: usb

birdseye:
  enabled: True
  mode: continuous

ffmpeg:
  hwaccel_args: preset-vaapi

record:
  enabled: True
  events:
    retain:
      default: 10

snapshots:
  enabled: True
  retain:
    default: 10

objects:
  # List of possible objects can be found here: https://docs.frigate.video/configuration/objects
  track:
    - person
    - cat
    - dog

go2rtc:
  hass:
    config: "/home_assistant_config"
  streams:
    entryway_doorbell_frigate: 
      - hass://nas_local_ip:8123?entity_id=camera.entryway_doorbell&token=redacted_ha_long_term_access_token
      - "ffmpeg:entryway_doorbell_frigate#audio=aac"
  webrtc:
    candidates:
      - nas_local_ip:8555
      - stun:8555

cameras:
  entryway_doorbell_frigate:
    ffmpeg:
      output_args:
        record: preset-record-generic-audio-copy
      inputs:
        - path: rtsp://nas_local_ip:8554/entryway_doorbell_frigate?mp4
          input_args: preset-rtsp-restream
          roles:
            - record
            - detect
    live:
      stream_name: entryway_doorbell_frigate
    detect:
      width: 960
      height: 1280
    motion:
      mask:
        - 458,652,470,324,270,310,270,624 # Ignore motion beyond my entryway

Relevant log output

2023-08-18 10:02:19.433171790  [INFO] Starting Frigate...
2023-08-18 10:02:20.359155136  [2023-08-18 10:02:20] frigate.app                    INFO    : Starting Frigate (0.12.1-367d724)
2023-08-18 10:02:20.375858165  [2023-08-18 10:02:20] peewee_migrate                 INFO    : Starting migrations
2023-08-18 10:02:20.379419027  [2023-08-18 10:02:20] peewee_migrate                 INFO    : There is nothing to migrate
2023-08-18 10:02:20.394078356  [2023-08-18 10:02:20] frigate.app                    INFO    : Output process started: 290
2023-08-18 10:02:20.406316596  [2023-08-18 10:02:20] frigate.app                    INFO    : Camera processor started for entryway_doorbell_frigate: 297
2023-08-18 10:02:20.410142130  [2023-08-18 10:02:20] frigate.app                    INFO    : Capture process started for entryway_doorbell_frigate: 299
2023-08-18 10:02:23.043645256  [2023-08-18 10:02:20] detector.coral                 INFO    : Starting detection process: 288
2023-08-18 10:02:23.043656392  [2023-08-18 10:02:20] frigate.detectors.plugins.edgetpu_tfl INFO    : Attempting to load TPU as usb
2023-08-18 10:02:23.056226009  [2023-08-18 10:02:23] frigate.detectors.plugins.edgetpu_tfl INFO    : TPU found
2023-08-18 10:09:55.659697174  [2023-08-18 10:09:55] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818100942.mp4
2023-08-18 10:10:05.621591175  [2023-08-18 10:10:05] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818100952.mp4
2023-08-18 10:10:15.619659262  [2023-08-18 10:10:15] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818101002.mp4
2023-08-18 10:10:25.611791062  [2023-08-18 10:10:25] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818101012.mp4
2023-08-18 10:10:35.622589260  [2023-08-18 10:10:35] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818101022.mp4
2023-08-18 10:10:45.615102227  [2023-08-18 10:10:45] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818101032.mp4
2023-08-18 10:10:55.611974244  [2023-08-18 10:10:55] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818101042.mp4
2023-08-18 10:11:05.624123904  [2023-08-18 10:11:05] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818101053.mp4
2023-08-18 10:11:15.616939853  [2023-08-18 10:11:15] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818101103.mp4
2023-08-18 10:11:25.616023742  [2023-08-18 10:11:25] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818101113.mp4

FFprobe output from your camera

Input #0, rtsp, from 'rtsp://nas_local_ip:8554/entryway_doorbell_frigate?mp4':
  Metadata:
    title           : go2rtc/1.6.2
  Duration: N/A, start: 0.000000, bitrate: N/A
  Stream #0:0: Video: h264 (High), yuv420p(progressive), 960x1280, 30 fps, 29.97 tbr, 90k tbn
  Stream #0:1: Audio: aac (LC), 48000 Hz, stereo, fltp

Frigate stats

{"cpu_usages":{"1":{"cpu":"0.0","mem":"0.0"},"106":{"cpu":"4.7","mem":"3.7"},"109":{"cpu":"0.0","mem":"0.1"},"117":{"cpu":"0.0","mem":"0.3"},"134":{"cpu":"0.0","mem":"0.2"},"135":{"cpu":"0.0","mem":"0.2"},"136":{"cpu":"0.0","mem":"0.2"},"137":{"cpu":"0.0","mem":"0.2"},"1402":{"cpu":"8.6","mem":"0.5"},"15":{"cpu":"0.0","mem":"0.0"},"16":{"cpu":"0.0","mem":"0.0"},"1667":{"cpu":"0.0","mem":"0.1"},"1720":{"cpu":"0.0","mem":"0.0"},"1738":{"cpu":"0.0","mem":"0.1"},"1745":{"cpu":"0.0","mem":"0.1"},"24":{"cpu":"0.0","mem":"0.0"},"25":{"cpu":"0.0","mem":"0.0"},"26":{"cpu":"0.0","mem":"0.0"},"27":{"cpu":"0.0","mem":"0.0"},"28":{"cpu":"0.0","mem":"0.0"},"281":{"cpu":"0.0","mem":"1.9"},"287":{"cpu":"0.3","mem":"0.3"},"288":{"cpu":"0.0","mem":"2.5"},"29":{"cpu":"0.0","mem":"0.0"},"290":{"cpu":"0.7","mem":"2.2"},"296":{"cpu":"0.0","mem":"0.4"},"297":{"cpu":"1.0","mem":"2.5"},"298":{"cpu":"0.0","mem":"0.4"},"299":{"cpu":"4.3","mem":"2.1"},"30":{"cpu":"0.0","mem":"0.0"},"306":{"cpu":"7.0","mem":"1.8"},"31":{"cpu":"0.0","mem":"0.0"},"32":{"cpu":"0.0","mem":"0.0"},"41":{"cpu":"0.0","mem":"0.0"},"42":{"cpu":"0.0","mem":"0.0"},"79":{"cpu":"0.0","mem":"0.0"},"81":{"cpu":"0.0","mem":"0.0"},"82":{"cpu":"0.0","mem":"0.0"},"89":{"cpu":"10.3","mem":"0.5"},"Tasks:":{"cpu":"stopped,","mem":"0.0"},"top":{"cpu":"average:","mem":"0.0"}},"detection_fps":0.0,"detectors":{"coral":{"detection_start":0.0,"inference_speed":10.71,"pid":288}},"entryway_doorbell_frigate":{"camera_fps":5.0,"capture_pid":299,"detection_enabled":1,"detection_fps":0.0,"ffmpeg_pid":306,"pid":297,"process_fps":5.0,"skipped_fps":0.0},"gpu_usages":{"intel-vaapi":{"gpu":"1.92 %","mem":"- %"}},"service":{"last_updated":1692368658,"latest_version":"0.12.1","storage":{"/dev/shm":{"free":64.6,"mount_type":"tmpfs","total":67.1,"used":2.5},"/media/frigate/clips":{"free":717548.5,"mount_type":"ext4","total":3936688.6,"used":3219123.3},"/media/frigate/recordings":{"free":717548.5,"mount_type":"ext4","total":3936688.6,"used":3219123.3},"/tmp/cache":{"free":997.9,"mount_type":"tmpfs","total":1000.0,"used":2.1}},"temperatures":{},"uptime":1318,"version":"0.12.1-367d724"}}

Operating system

Debian

Install method

Docker Compose

Coral version

USB

Network connection

Wired

Camera make and model

Nest Doorbell Wired (2nd Generation)

Any other information that may be helpful

My docker host is a NAS running OpenMediaVault 6.6.0-2 on top of Debian 11 with an i5-6500 CPU and 8GB of RAM

Here's my docker-compose:

version: "3.9"
services:
  frigate:
    container_name: frigate
    privileged: true # this may not be necessary for all setups
    restart: unless-stopped
    image: [ghcr.io/blakeblackshear/frigate:stable](http://ghcr.io/blakeblackshear/frigate:stable)
    network_mode: host
    shm_size: "64mb" # update for your cameras based on calculation above
    cpus: 2 # Limit CPU usage to 50% of total capacity
    mem_limit: 4g # Limit memory usage to 4GB
    devices:
      - /dev/bus/usb:/dev/bus/usb # passes the USB Coral, needs to be modified for other versions
      #- /dev/apex_0:/dev/apex_0 # passes a PCIe Coral, follow driver instructions here https://coral.ai/docs/m2/get-started/#2a-on-linux
      - /dev/dri/renderD128 # for intel hwaccel, needs to be updated for your hardware
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /srv/dev-disk-by-uuid-redacted-1/AppData/frigate:/config
      - /srv/dev-disk-by-uuid-redacted-1/AppData/home-assistant:/home_assistant_config
      - /srv/dev-disk-by-uuid-redacted-2/Media/frigate:/media/frigate
      - type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
        target: /tmp/cache
        tmpfs:
          size: 1000000000
    ports:
      - "5000:5000"
      - "8554:8554" # RTSP feeds
      - "8555:8555/tcp" # WebRTC over tcp
      - "8555:8555/udp" # WebRTC over udp
    environment:
      FRIGATE_RTSP_PASSWORD: "redacted"
NickM-27 commented 1 year ago

I'd suggest a config like this

cameras:
  entryway_doorbell_frigate:
    ffmpeg:
      output_args:
        record: preset-record-generic-audio-aac
      inputs:
        - path: rtsp://nas_local_ip:8554/entryway_doorbell_frigate?audio&video
          input_args: preset-rtsp-restream
          roles:
            - record
            - detect

so that way the transcoding occurs on the frigate side

EvanGrote commented 1 year ago

I'm seeing the same issue with that config. It works initially but starts giving Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-<timestamp>.mp4 warnings after ~10 minutes:

2023-08-18 10:45:47.474060637  [INFO] Starting Frigate...
2023-08-18 10:45:48.392725183  [2023-08-18 10:45:48] frigate.app                    INFO    : Starting Frigate (0.12.1-367d724)
2023-08-18 10:45:48.404887122  [2023-08-18 10:45:48] peewee_migrate                 INFO    : Starting migrations
2023-08-18 10:45:48.408308199  [2023-08-18 10:45:48] peewee_migrate                 INFO    : There is nothing to migrate
2023-08-18 10:45:48.423596119  [2023-08-18 10:45:48] frigate.app                    INFO    : Output process started: 290
2023-08-18 10:45:48.425834033  [2023-08-18 10:45:48] detector.coral                 INFO    : Starting detection process: 288
2023-08-18 10:45:51.080977098  [2023-08-18 10:45:48] frigate.detectors.plugins.edgetpu_tfl INFO    : Attempting to load TPU as usb
2023-08-18 10:45:51.085529036  [2023-08-18 10:45:48] frigate.app                    INFO    : Camera processor started for entryway_doorbell_frigate: 294
2023-08-18 10:45:51.085698475  [2023-08-18 10:45:51] frigate.detectors.plugins.edgetpu_tfl INFO    : TPU found
2023-08-18 10:45:51.085757591  [2023-08-18 10:45:48] frigate.app                    INFO    : Capture process started for entryway_doorbell_frigate: 296
2023-08-18 10:54:53.694062243  [2023-08-18 10:54:53] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818105444.mp4
2023-08-18 10:55:03.647451666  [2023-08-18 10:55:03] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818105451.mp4
2023-08-18 10:55:13.647699394  [2023-08-18 10:55:13] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818105501.mp4
2023-08-18 10:55:23.645763087  [2023-08-18 10:55:23] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818105510.mp4
2023-08-18 10:55:33.645381363  [2023-08-18 10:55:33] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818105521.mp4
2023-08-18 10:55:43.641186455  [2023-08-18 10:55:43] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818105531.mp4
2023-08-18 10:55:53.641911460  [2023-08-18 10:55:53] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818105541.mp4
2023-08-18 10:56:03.642949387  [2023-08-18 10:56:03] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818105552.mp4
2023-08-18 10:56:13.673344282  [2023-08-18 10:56:13] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818105601.mp4
2023-08-18 10:56:23.644406979  [2023-08-18 10:56:23] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818105610.mp4
NickM-27 commented 1 year ago

Thanks for trying it, in that case it seems the audio that is being sent is just corrupted after streaming for some time

EvanGrote commented 1 year ago

Gotcha. So this could potentially an issue with go2rtc then? I know the hass and nest integrations in go2rtc are still pretty new

I had some new errors pop up in my log just now that I'll share in case that spark any other ideas:

2023-08-18 10:45:47.474060637  [INFO] Starting Frigate...
2023-08-18 10:45:48.392725183  [2023-08-18 10:45:48] frigate.app                    INFO    : Starting Frigate (0.12.1-367d724)
2023-08-18 10:45:48.404887122  [2023-08-18 10:45:48] peewee_migrate                 INFO    : Starting migrations
2023-08-18 10:45:48.408308199  [2023-08-18 10:45:48] peewee_migrate                 INFO    : There is nothing to migrate
2023-08-18 10:45:48.423596119  [2023-08-18 10:45:48] frigate.app                    INFO    : Output process started: 290
2023-08-18 10:45:48.425834033  [2023-08-18 10:45:48] detector.coral                 INFO    : Starting detection process: 288
2023-08-18 10:45:51.080977098  [2023-08-18 10:45:48] frigate.detectors.plugins.edgetpu_tfl INFO    : Attempting to load TPU as usb
2023-08-18 10:45:51.085529036  [2023-08-18 10:45:48] frigate.app                    INFO    : Camera processor started for entryway_doorbell_frigate: 294
2023-08-18 10:45:51.085698475  [2023-08-18 10:45:51] frigate.detectors.plugins.edgetpu_tfl INFO    : TPU found
2023-08-18 10:45:51.085757591  [2023-08-18 10:45:48] frigate.app                    INFO    : Capture process started for entryway_doorbell_frigate: 296
2023-08-18 10:54:53.694062243  [2023-08-18 10:54:53] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818105444.mp4
2023-08-18 10:55:03.647451666  [2023-08-18 10:55:03] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818105451.mp4
2023-08-18 10:55:13.647699394  [2023-08-18 10:55:13] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818105501.mp4
2023-08-18 10:55:23.645763087  [2023-08-18 10:55:23] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818105510.mp4
2023-08-18 10:55:33.645381363  [2023-08-18 10:55:33] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818105521.mp4
2023-08-18 10:55:43.641186455  [2023-08-18 10:55:43] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818105531.mp4
2023-08-18 10:55:53.641911460  [2023-08-18 10:55:53] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818105541.mp4
2023-08-18 10:56:03.642949387  [2023-08-18 10:56:03] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818105552.mp4
2023-08-18 10:56:13.673344282  [2023-08-18 10:56:13] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818105601.mp4
2023-08-18 10:56:23.644406979  [2023-08-18 10:56:23] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818105610.mp4
2023-08-18 10:56:33.697344715  [2023-08-18 10:56:33] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818105622.mp4
2023-08-18 10:56:43.678611440  [2023-08-18 10:56:43] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818105632.mp4
2023-08-18 10:56:53.674359506  [2023-08-18 10:56:53] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818105641.mp4
2023-08-18 10:57:03.672655740  [2023-08-18 10:57:03] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818105650.mp4
2023-08-18 10:57:13.693533884  [2023-08-18 10:57:13] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818105701.mp4
2023-08-18 10:57:23.691695476  [2023-08-18 10:57:23] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818105710.mp4
2023-08-18 10:57:33.678485819  [2023-08-18 10:57:33] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818105721.mp4
2023-08-18 10:57:43.691647735  [2023-08-18 10:57:43] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818105730.mp4
2023-08-18 10:57:53.693343377  [2023-08-18 10:57:53] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818105742.mp4
2023-08-18 10:58:28.491358010  [2023-08-18 10:58:28] watchdog.entryway_doorbell_frigate INFO    : No frames received from entryway_doorbell_frigate in 20 seconds. Exiting ffmpeg...
2023-08-18 10:58:28.491512369  [2023-08-18 10:58:28] watchdog.entryway_doorbell_frigate INFO    : Waiting for ffmpeg to exit gracefully...
2023-08-18 10:58:28.518707374  [2023-08-18 10:58:28] frigate.video                  ERROR   : entryway_doorbell_frigate: Unable to read frames from ffmpeg process.
2023-08-18 10:58:28.519025100  [2023-08-18 10:58:28] frigate.video                  ERROR   : entryway_doorbell_frigate: ffmpeg process is not running. exiting capture thread...
2023-08-18 10:58:28.653918298  [2023-08-18 10:58:28] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818105751.mp4
2023-08-18 10:58:38.520975597  [2023-08-18 10:58:38] watchdog.entryway_doorbell_frigate ERROR   : Ffmpeg process crashed unexpectedly for entryway_doorbell_frigate.
2023-08-18 10:58:38.520979238  [2023-08-18 10:58:38] watchdog.entryway_doorbell_frigate ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2023-08-18 10:58:38.520984197  [2023-08-18 10:58:38] ffmpeg.entryway_doorbell_frigate.detect ERROR   : [segment @ 0x5609760d8d40] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
2023-08-18 10:58:38.520986697  [2023-08-18 10:58:38] ffmpeg.entryway_doorbell_frigate.detect ERROR   : [segment @ 0x5609760d8d40] Non-monotonous DTS in output stream 0:0; previous: 5383127, current: 5377014; changing to 5383128. This may result in incorrect timestamps in the output file.
2023-08-18 10:58:38.521001847  [2023-08-18 10:58:38] ffmpeg.entryway_doorbell_frigate.detect ERROR   : [segment @ 0x5609760d8d40] Non-monotonous DTS in output stream 0:0; previous: 5383128, current: 5377490; changing to 5383129. This may result in incorrect timestamps in the output file.
2023-08-18 10:58:38.521015680  [2023-08-18 10:58:38] ffmpeg.entryway_doorbell_frigate.detect ERROR   : [segment @ 0x5609760d8d40] Non-monotonous DTS in output stream 0:0; previous: 5383129, current: 5378012; changing to 5383130. This may result in incorrect timestamps in the output file.
2023-08-18 10:58:38.521017896  [2023-08-18 10:58:38] ffmpeg.entryway_doorbell_frigate.detect ERROR   : [segment @ 0x5609760d8d40] Non-monotonous DTS in output stream 0:0; previous: 5383130, current: 5378534; changing to 5383131. This may result in incorrect timestamps in the output file.
2023-08-18 10:58:38.521020107  [2023-08-18 10:58:38] ffmpeg.entryway_doorbell_frigate.detect ERROR   : [segment @ 0x5609760d8d40] Non-monotonous DTS in output stream 0:0; previous: 5383131, current: 5379011; changing to 5383132. This may result in incorrect timestamps in the output file.
2023-08-18 10:58:38.521031276  [2023-08-18 10:58:38] ffmpeg.entryway_doorbell_frigate.detect ERROR   : [segment @ 0x5609760d8d40] Non-monotonous DTS in output stream 0:0; previous: 5383132, current: 5379548; changing to 5383133. This may result in incorrect timestamps in the output file.
2023-08-18 10:58:38.523381618  [2023-08-18 10:58:38] ffmpeg.entryway_doorbell_frigate.detect ERROR   : [segment @ 0x5609760d8d40] Non-monotonous DTS in output stream 0:0; previous: 5383133, current: 5380055; changing to 5383134. This may result in incorrect timestamps in the output file.
2023-08-18 10:58:38.523385361  [2023-08-18 10:58:38] ffmpeg.entryway_doorbell_frigate.detect ERROR   : [segment @ 0x5609760d8d40] Non-monotonous DTS in output stream 0:0; previous: 5383134, current: 5380562; changing to 5383135. This may result in incorrect timestamps in the output file.
2023-08-18 10:58:38.523387395  [2023-08-18 10:58:38] ffmpeg.entryway_doorbell_frigate.detect ERROR   : [segment @ 0x5609760d8d40] Non-monotonous DTS in output stream 0:0; previous: 5383135, current: 5381069; changing to 5383136. This may result in incorrect timestamps in the output file.
2023-08-18 10:58:38.523389335  [2023-08-18 10:58:38] ffmpeg.entryway_doorbell_frigate.detect ERROR   : [segment @ 0x5609760d8d40] Non-monotonous DTS in output stream 0:0; previous: 5383136, current: 5381606; changing to 5383137. This may result in incorrect timestamps in the output file.
2023-08-18 10:58:38.523390816  [2023-08-18 10:58:38] ffmpeg.entryway_doorbell_frigate.detect ERROR   : [rtsp @ 0x56097607c100] RTP: PT=60: bad cseq 12aa expected=8e10
2023-08-18 10:58:38.523392327  [2023-08-18 10:58:38] ffmpeg.entryway_doorbell_frigate.detect ERROR   : [rtsp @ 0x56097607c100] RTP: PT=61: bad cseq 0000 expected=8ed7
2023-08-18 10:58:44.785762822  [2023-08-18 10:58:44] frigate.video                  ERROR   : entryway_doorbell_frigate: Unable to read frames from ffmpeg process.
2023-08-18 10:58:44.786086115  [2023-08-18 10:58:44] frigate.video                  ERROR   : entryway_doorbell_frigate: ffmpeg process is not running. exiting capture thread...
2023-08-18 10:58:48.528139565  [2023-08-18 10:58:48] watchdog.entryway_doorbell_frigate ERROR   : Ffmpeg process crashed unexpectedly for entryway_doorbell_frigate.
2023-08-18 10:58:48.528384376  [2023-08-18 10:58:48] watchdog.entryway_doorbell_frigate ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2023-08-18 10:58:48.528546141  [2023-08-18 10:58:48] ffmpeg.entryway_doorbell_frigate.detect ERROR   : [rtsp @ 0x55db62522100] Could not find codec parameters for stream 1 (Video: h264, none): unspecified size
2023-08-18 10:58:48.528949793  [2023-08-18 10:58:48] ffmpeg.entryway_doorbell_frigate.detect ERROR   : Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
2023-08-18 10:58:48.528959293  [2023-08-18 10:58:48] ffmpeg.entryway_doorbell_frigate.detect ERROR   : Output file #1 does not contain any stream
2023-08-18 10:58:54.711070351  [2023-08-18 10:58:54] frigate.video                  ERROR   : entryway_doorbell_frigate: Unable to read frames from ffmpeg process.
2023-08-18 10:58:54.711862482  [2023-08-18 10:58:54] frigate.video                  ERROR   : entryway_doorbell_frigate: ffmpeg process is not running. exiting capture thread...
2023-08-18 10:58:58.546151743  [2023-08-18 10:58:58] watchdog.entryway_doorbell_frigate ERROR   : Ffmpeg process crashed unexpectedly for entryway_doorbell_frigate.
2023-08-18 10:58:58.546475973  [2023-08-18 10:58:58] watchdog.entryway_doorbell_frigate ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2023-08-18 10:58:58.546660904  [2023-08-18 10:58:58] ffmpeg.entryway_doorbell_frigate.detect ERROR   : [rtsp @ 0x563735ed1100] Could not find codec parameters for stream 1 (Video: h264, none): unspecified size
2023-08-18 10:58:58.554627816  [2023-08-18 10:58:58] ffmpeg.entryway_doorbell_frigate.detect ERROR   : Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
2023-08-18 10:58:58.554871239  [2023-08-18 10:58:58] ffmpeg.entryway_doorbell_frigate.detect ERROR   : Output file #1 does not contain any stream
2023-08-18 10:59:09.650219853  [2023-08-18 10:59:09] frigate.video                  ERROR   : entryway_doorbell_frigate: Unable to read frames from ffmpeg process.
2023-08-18 10:59:09.650302717  [2023-08-18 10:59:09] frigate.video                  ERROR   : entryway_doorbell_frigate: ffmpeg process is not running. exiting capture thread...
2023-08-18 10:59:18.562602724  [2023-08-18 10:59:18] watchdog.entryway_doorbell_frigate ERROR   : Ffmpeg process crashed unexpectedly for entryway_doorbell_frigate.
2023-08-18 10:59:18.562879651  [2023-08-18 10:59:18] watchdog.entryway_doorbell_frigate ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2023-08-18 10:59:18.563064903  [2023-08-18 10:59:18] ffmpeg.entryway_doorbell_frigate.detect ERROR   : [rtsp @ 0x55a5090cf100] Could not find codec parameters for stream 1 (Video: h264, none): unspecified size
2023-08-18 10:59:18.563298782  [2023-08-18 10:59:18] ffmpeg.entryway_doorbell_frigate.detect ERROR   : Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
2023-08-18 10:59:18.570394754  [2023-08-18 10:59:18] ffmpeg.entryway_doorbell_frigate.detect ERROR   : Output file #1 does not contain any stream
2023-08-18 11:05:03.697673479  [2023-08-18 11:05:03] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818110450.mp4
2023-08-18 11:05:13.684712489  [2023-08-18 11:05:13] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818110500.mp4
2023-08-18 11:05:23.687475851  [2023-08-18 11:05:23] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818110510.mp4
2023-08-18 11:05:33.684768758  [2023-08-18 11:05:33] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818110520.mp4
2023-08-18 11:05:43.684333642  [2023-08-18 11:05:43] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818110531.mp4
2023-08-18 11:05:53.698011510  [2023-08-18 11:05:53] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818110541.mp4
2023-08-18 11:06:03.683848081  [2023-08-18 11:06:03] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818110551.mp4
2023-08-18 11:06:13.689717722  [2023-08-18 11:06:13] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818110601.mp4
2023-08-18 11:06:23.685886343  [2023-08-18 11:06:23] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818110610.mp4
2023-08-18 11:06:33.718556918  [2023-08-18 11:06:33] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818110620.mp4
2023-08-18 11:06:43.726740729  [2023-08-18 11:06:43] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818110631.mp4
2023-08-18 11:06:53.735687395  [2023-08-18 11:06:53] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818110640.mp4
2023-08-18 11:07:03.687263579  [2023-08-18 11:07:03] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818110650.mp4
2023-08-18 11:07:13.686719427  [2023-08-18 11:07:13] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818110701.mp4
2023-08-18 11:07:23.686034818  [2023-08-18 11:07:23] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818110710.mp4
2023-08-18 11:07:33.691310331  [2023-08-18 11:07:33] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818110721.mp4
2023-08-18 11:07:43.704034524  [2023-08-18 11:07:43] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818110731.mp4
2023-08-18 11:07:53.737006356  [2023-08-18 11:07:53] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818110740.mp4
2023-08-18 11:08:28.587405394  [2023-08-18 11:08:28] watchdog.entryway_doorbell_frigate INFO    : No frames received from entryway_doorbell_frigate in 20 seconds. Exiting ffmpeg...
2023-08-18 11:08:28.588105367  [2023-08-18 11:08:28] watchdog.entryway_doorbell_frigate INFO    : Waiting for ffmpeg to exit gracefully...
2023-08-18 11:08:28.638486147  [2023-08-18 11:08:28] frigate.video                  ERROR   : entryway_doorbell_frigate: Unable to read frames from ffmpeg process.
2023-08-18 11:08:28.638974445  [2023-08-18 11:08:28] frigate.video                  ERROR   : entryway_doorbell_frigate: ffmpeg process is not running. exiting capture thread...
2023-08-18 11:08:28.701443105  [2023-08-18 11:08:28] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/entryway_doorbell_frigate-20230818110751.mp4
2023-08-18 11:08:38.642173849  [2023-08-18 11:08:38] watchdog.entryway_doorbell_frigate ERROR   : Ffmpeg process crashed unexpectedly for entryway_doorbell_frigate.
2023-08-18 11:08:38.642475433  [2023-08-18 11:08:38] watchdog.entryway_doorbell_frigate ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2023-08-18 11:08:38.642929753  [2023-08-18 11:08:38] ffmpeg.entryway_doorbell_frigate.detect ERROR   : [segment @ 0x56157abaad00] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
2023-08-18 11:08:38.642940922  [2023-08-18 11:08:38] ffmpeg.entryway_doorbell_frigate.detect ERROR   : [rtsp @ 0x56157aa6c100] RTP: PT=61: bad cseq 461e expected=565d
2023-08-18 11:08:45.043498915  [2023-08-18 11:08:45] frigate.video                  ERROR   : entryway_doorbell_frigate: Unable to read frames from ffmpeg process.
2023-08-18 11:08:45.044123272  [2023-08-18 11:08:45] frigate.video                  ERROR   : entryway_doorbell_frigate: ffmpeg process is not running. exiting capture thread...
2023-08-18 11:08:48.655619033  [2023-08-18 11:08:48] watchdog.entryway_doorbell_frigate ERROR   : Ffmpeg process crashed unexpectedly for entryway_doorbell_frigate.
2023-08-18 11:08:48.655631153  [2023-08-18 11:08:48] watchdog.entryway_doorbell_frigate ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2023-08-18 11:08:48.655640084  [2023-08-18 11:08:48] ffmpeg.entryway_doorbell_frigate.detect ERROR   : [rtsp @ 0x55ca70576100] Could not find codec parameters for stream 1 (Video: h264, none): unspecified size
2023-08-18 11:08:48.655647871  [2023-08-18 11:08:48] ffmpeg.entryway_doorbell_frigate.detect ERROR   : Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
2023-08-18 11:08:48.661453478  [2023-08-18 11:08:48] ffmpeg.entryway_doorbell_frigate.detect ERROR   : Output file #1 does not contain any stream
2023-08-18 11:08:54.925714624  [2023-08-18 11:08:54] frigate.video                  ERROR   : entryway_doorbell_frigate: Unable to read frames from ffmpeg process.
2023-08-18 11:08:54.925875824  [2023-08-18 11:08:54] frigate.video                  ERROR   : entryway_doorbell_frigate: ffmpeg process is not running. exiting capture thread...
2023-08-18 11:08:58.675747941  [2023-08-18 11:08:58] watchdog.entryway_doorbell_frigate ERROR   : Ffmpeg process crashed unexpectedly for entryway_doorbell_frigate.
2023-08-18 11:08:58.675915635  [2023-08-18 11:08:58] watchdog.entryway_doorbell_frigate ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2023-08-18 11:08:58.675919137  [2023-08-18 11:08:58] ffmpeg.entryway_doorbell_frigate.detect ERROR   : [rtsp @ 0x557b2b21a100] Could not find codec parameters for stream 1 (Video: h264, none): unspecified size
2023-08-18 11:08:58.675987588  [2023-08-18 11:08:58] ffmpeg.entryway_doorbell_frigate.detect ERROR   : Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
2023-08-18 11:08:58.676109425  [2023-08-18 11:08:58] ffmpeg.entryway_doorbell_frigate.detect ERROR   : Output file #1 does not contain any stream
2023-08-18 11:09:09.140322101  [2023-08-18 11:09:09] frigate.video                  ERROR   : entryway_doorbell_frigate: Unable to read frames from ffmpeg process.
2023-08-18 11:09:09.141037126  [2023-08-18 11:09:09] frigate.video                  ERROR   : entryway_doorbell_frigate: ffmpeg process is not running. exiting capture thread...
2023-08-18 11:09:18.691734236  [2023-08-18 11:09:18] watchdog.entryway_doorbell_frigate ERROR   : Ffmpeg process crashed unexpectedly for entryway_doorbell_frigate.
2023-08-18 11:09:18.691746011  [2023-08-18 11:09:18] watchdog.entryway_doorbell_frigate ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2023-08-18 11:09:18.693206958  [2023-08-18 11:09:18] ffmpeg.entryway_doorbell_frigate.detect ERROR   : [rtsp @ 0x55a5a6def100] Could not find codec parameters for stream 0 (Video: h264, none): unspecified size
2023-08-18 11:09:18.693217933  [2023-08-18 11:09:18] ffmpeg.entryway_doorbell_frigate.detect ERROR   : Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
2023-08-18 11:09:18.693224805  [2023-08-18 11:09:18] ffmpeg.entryway_doorbell_frigate.detect ERROR   : Output file #1 does not contain any stream
NickM-27 commented 1 year ago

I'd think it's more than likely an issue with the doorbells stream, but I suppose it could be go2rtc as well.

Output file #1 does not contain any stream

Looks like stream is not stable.

EvanGrote commented 1 year ago

Okay, thanks for clarifying. My doorbell is ~15 feet from my router and I haven't noticed any abnormalities viewing it through the google home app, apple home app (via starling home hub), or home assistant, so it seems to me like go2rtc is the remaining variable but there's a lot of hoops being jumped through to reach this setup so that's hard to pin down.

Thanks for your help! I'll keep tinkering to see if I can unearth anything but I'm definitely on the nascent edge of integrating this doorbell so hopefully someone else can help iron out the final kinks over time.

NickM-27 commented 1 year ago

I'd suggest making an issue on go2rtc, also try keeping an MSE stream open (with the AAC transcoding enabled in go2rtc config) and see if the stream fails / shows errors.

EvanGrote commented 1 year ago

Attempting to view the MSE stream option from my go2rtc stream links (http://nas_local_ip:5000/live/webrtc/stream.html?src=entryway_doorbell_frigate&mode=mse) immediately gives me an error and never loads the stream. I'm not seeing anything in the go2rtc logs about the error though.

EvanGrote commented 1 year ago

Found https://github.com/home-assistant/core/issues/86610 which is likely related to this issue

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.