blakeblackshear / frigate

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

[Config Support]: Only Some Cameras Are Working With WebRTC/MSE #7603

Closed q5BWr6gN closed 11 months ago

q5BWr6gN commented 1 year ago

Describe the problem you are having

At some point, both of my Tapo C200 cameras stopped working with WebRTC/MSE. I did not notice this issue right away, but it may be due to having both of their firmwares updated.

Audio works fine via VLC RTSP streaming, and in recordings.

My Reolink WiFi Doorbell camera continues to work with WebRTC/MSE.

Any help would be appreciated!

Version

Frigate 0.12.1-367d724 per the logs

Frigate config file

mqtt:
  host: 192.168.0.254
  user: **********
  password: **********

go2rtc:
  streams:
    TapoC200-Kitchen:
      - rtsp://**********:**********@192.168.0.201/stream2
      - "ffmpeg:TapoC200-Kitchen#video=h264"
    TapoC200-LivingRoom:
      - rtsp://**********:**********@192.168.0.202/stream2
      - "ffmpeg:TapoC200-LivingRoom#video=h264"
    Reolink-Doorbell:
      - http://192.168.0.204/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=**********&password=**********#video=copy#audio=aac#audio=opus
      - "ffmpeg:Reolink-Doorbell#audio=opus"
  #Supposed to enable webrtc streaming
  webrtc:
    candidates:
      - 192.168.0.254:8555
      - stun:8555

####################
## GLOBAL CONFIGS ##
####################

detect:
  stationary:
    interval: 0
    threshold: 50

snapshots:
  enabled: True
  timestamp: False
  bounding_box: True
  retain:
    default: 180
    mode: active_objects

record:
  enabled: True
  retain:
    days: 15
    mode: all
  events:
    retain:
      default: 60
      mode: active_objects
      objects:
        car: 15
    pre_capture: 20
    post_capture: 20

objects:
  track:
    - person
    - car

birdseye:
  enabled: True
  #Some cameras may have the motion mode overrided to something else
  mode: objects
  restream: True
  quality: 8

#############################
## CAMERA SPECIFIC CONFIGS ##
#############################

cameras:

  TapoC200-Kitchen:
    #Objects mode prevents birdseye from being triggered by bushes in the wind.
    birdseye:
      mode: objects
    ffmpeg:
      output_args:
        record: preset-record-generic-audio-aac
      inputs:
        #High resolution stream
        - path: rtsp://**********:**********@192.168.0.201/stream1
          roles:
            - record
        #Low resolution stream
        - path: rtsp://**********:**********@192.168.0.201/stream2
          roles:
            - detect
            - rtmp
    detect:
      width: 1358
      height: 764
      fps: 5
    motion:
      mask:
        - 0,0,1920,0,1920,504,1661,373,446,367,622,514,322,713,0,1080,0,220

  TapoC200-LivingRoom:
    birdseye:
      mode: objects
    ffmpeg:
      output_args:
        record: preset-record-generic-audio-aac
      inputs:
        #High resolution stream
        - path: rtsp://**********:**********@192.168.0.202/stream1
          roles:
            - record
        #Low resolution stream
        - path: rtsp://**********:**********@192.168.0.202/stream2
          roles:
            - detect
            - rtmp
    detect:
      width: 1358
      height: 764
      fps: 5
    motion:
      mask:
        - 288,57,684,52,691,0,0,0,0,54,0,119,287,114

  Reolink-Doorbell:
    ffmpeg:
      hwaccel_args: preset-vaapi
      output_args:
        record: preset-record-generic-audio-aac
      input_args:
        - -avoid_negative_ts
        - make_zero
        - -fflags
        - genpts+discardcorrupt
        - -flags
        - low_delay
        - -strict
        - experimental
        - -analyzeduration
        - 1000M
        - -probesize
        - 1000M
        - -rw_timeout
        - "5000000"
      inputs:
        #High resolution stream
        - path: http://192.168.0.204/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=**********
          roles:
            - record
        #Low resolution stream
        - path: http://192.168.0.204/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=admin&password=**********
          roles:
            - rtmp
            - detect
    detect:
      width: 640
      height: 480
      fps: 5

        ##Requires movement in zone 0 or 1 (hopefully) to trigger an event
        #required_zones:
        #  - driveway
        #  - people
    motion:
      mask:
        - 0,307,186,287,245,296,176,393,369,345,351,480,640,480,640,0,219,0,0,0
        - 253,313,253,374,215,415,178,372,175,317
    #zones:
      ##Zone for cars on our side of the driveway
      #driveway:
      #  coordinates: 27,456,176,393,234,393,343,312,259,303,0,389
      ##Zone for people on driveway or walkway and stairs
      #people:
      #  coordinates: 0,480,382,480,354,431,375,311,245,302,0,406

Relevant log output

Frigate Logs:

2023-08-28 20:45:27.885158498  [INFO] Starting Frigate...
2023-08-28 20:45:29.194786612  [2023-08-28 16:45:29] frigate.app                    INFO    : Starting Frigate (0.12.1-367d724)
2023-08-28 20:45:29.228896438  [2023-08-28 16:45:29] frigate.app                    INFO    : Creating directory: /tmp/cache
2023-08-28 20:45:29.230924168  [2023-08-28 16:45:29] peewee_migrate                 INFO    : Starting migrations
2023-08-28 20:45:29.235311239  [2023-08-28 16:45:29] peewee_migrate                 INFO    : There is nothing to migrate
2023-08-28 20:45:29.257037307  [2023-08-28 16:45:29] frigate.app                    INFO    : Output process started: 300
2023-08-28 20:45:29.259815943  [2023-08-28 16:45:29] detector.cpu                   INFO    : Starting detection process: 298
2023-08-28 20:45:29.260057659  [2023-08-28 16:45:29] frigate.detectors              WARNING : CPU detectors are not recommended and should only be used for testing or for trial purposes.
2023-08-28 20:45:29.275441632  [2023-08-28 16:45:29] frigate.app                    INFO    : Camera processor started for TapoC200-Kitchen: 302
2023-08-28 20:45:29.275447648  [2023-08-28 16:45:29] frigate.app                    INFO    : Camera processor started for TapoC200-LivingRoom: 303
2023-08-28 20:45:29.281714588  [2023-08-28 16:45:29] frigate.app                    INFO    : Camera processor started for Reolink-Doorbell: 304
2023-08-28 20:45:29.286084048  [2023-08-28 16:45:29] frigate.app                    INFO    : Capture process started for TapoC200-Kitchen: 306
2023-08-28 20:45:29.295832282  [2023-08-28 16:45:29] frigate.app                    INFO    : Capture process started for TapoC200-LivingRoom: 307
2023-08-28 20:45:29.301349270  [2023-08-28 16:45:29] frigate.app                    INFO    : Capture process started for Reolink-Doorbell: 311

Go2rtc Logs:
2023-08-28 20:45:27.881842708  [INFO] Preparing go2rtc config...
2023-08-28 20:45:27.929963417  [INFO] Got IP address from supervisor: 192.168.0.254
2023-08-28 20:45:27.966908371  [INFO] Got WebRTC port from supervisor: 8555
2023-08-28 20:45:28.220704000  [INFO] Not injecting WebRTC candidates into go2rtc config as it has been set manually
2023-08-28 20:45:28.259708959  [WARN] Using go2rtc binary from '/config/go2rtc' instead of the embedded one
2023-08-28 20:45:28.259714450  [INFO] Starting go2rtc...
2023-08-28 20:45:28.333571792  16:45:28.333 INF go2rtc version 1.5.0 linux/amd64
2023-08-28 20:45:28.333865229  16:45:28.333 INF [api] listen addr=:1984
2023-08-28 20:45:28.334245528  16:45:28.334 INF [rtsp] listen addr=:8554
2023-08-28 20:45:28.334623094  16:45:28.334 INF [srtp] listen addr=:8443
2023-08-28 20:45:28.334874112  16:45:28.334 INF [webrtc] listen addr=:8555/tcp
2023-08-28 20:45:37.890356495  [INFO] Starting go2rtc healthcheck service...
2023-08-28 20:45:44.982022875  16:45:44.981 WRN [rtsp] error="wrong response on DESCRIBE,exec: exit status 1" stream=TapoC200-Kitchen
2023-08-28 20:45:55.222171585  16:45:55.222 WRN [rtsp] error="wrong response on DESCRIBE,exec: exit status 1" stream=TapoC200-Kitchen
2023-08-28 20:46:00.351863492  16:46:00.351 WRN [rtsp] error="wrong response on DESCRIBE,exec: exit status 1" stream=TapoC200-Kitchen
2023-08-28 20:46:05.468466575  16:46:05.468 WRN [rtsp] error="wrong response on DESCRIBE,exec: exit status 1" stream=TapoC200-Kitchen

Frigate stats

No response

Operating system

HassOS

Install method

HassOS Addon

Coral version

CPU (no coral)

Any other information that may be helpful

This is probably not relevant, but I recently had an issue with Frigate not loading the config section. It would perpetually load, even after restarting the device running Home Assistant or using different devices/browsers, and was only resolved after reinstalling Frigate.

I also recently updated to a slightly newer version of Home Assistant and the Visual Studio addon.

For privacy reasons, I have turned on parental controls at the modem level to restrict traffic for the Tapo C200 cameras, but the issue persists when this is disabled.

NickM-27 commented 1 year ago

Maybe try using go2rtc 1.6.2

q5BWr6gN commented 1 year ago

Maybe try using go2rtc 1.6.2

The issue continues, even when using go2rtc 1.6.2's go2rtc_linux_amd64 build

Do you have any other suggestions I could try?

q5BWr6gN commented 1 year ago

2023-08-28 20:55:27.860227157 [INFO] Preparing go2rtc config... 2023-08-28 20:55:27.905530281 [INFO] Got IP address from supervisor: 192.168.0.254 2023-08-28 20:55:27.943194225 [INFO] Got WebRTC port from supervisor: 8555 2023-08-28 20:55:28.256416731 [INFO] Not injecting WebRTC candidates into go2rtc config as it has been set manually 2023-08-28 20:55:28.294403186 [WARN] Using go2rtc binary from '/config/go2rtc' instead of the embedded one 2023-08-28 20:55:28.294407774 [INFO] Starting go2rtc... 2023-08-28 20:55:28.395610992 16:55:28.395 INF go2rtc version 1.6.2 linux/amd64 2023-08-28 20:55:28.396034084 16:55:28.395 INF [api] listen addr=0.0.0.0:1984 2023-08-28 20:55:28.396802874 16:55:28.396 INF [rtsp] listen addr=0.0.0.0:8554 2023-08-28 20:55:28.397074821 16:55:28.397 INF [webrtc] listen addr=0.0.0.0:8555/tcp 2023-08-28 20:55:28.397930147 16:55:28.397 INF [srtp] listen addr=0.0.0.0:8443 2023-08-28 20:55:37.864942044 [INFO] Starting go2rtc healthcheck service... 2023-08-28 20:55:44.921119316 16:55:44.920 WRN [rtsp] error="wrong response on DESCRIBE,exec: exit status 1" stream=TapoC200-Kitchen 2023-08-28 20:56:00.282660598 16:56:00.282 WRN [rtsp] error="wrong response on DESCRIBE,exec: exit status 1" stream=TapoC200-Kitchen 2023-08-28 20:56:05.404131236 16:56:05.403 WRN [rtsp] error="wrong response on DESCRIBE,exec: exit status 1" stream=TapoC200-Kitchen 2023-08-28 20:56:07.877120364 16:56:07.876 WRN [streams] json locked 2023-08-28 20:56:15.642015201 16:56:15.641 WRN [rtsp] error="wrong response on DESCRIBE,exec: exit status 1" stream=TapoC200-Kitchen

NickM-27 commented 1 year ago

Make an issue on go2rtc repo

github-actions[bot] commented 11 months 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.