dermotduffy / frigate-hass-card

A Lovelace card for Frigate in Home Assistant
MIT License
569 stars 60 forks source link

2 camera stream do not work with webrtc after latest update #1696

Open skycryer opened 4 days ago

skycryer commented 4 days ago

[REQUIRED] Card diagnostic information:

  "ha_version": "2024.11.2",
  "card_version": "5.2.0",
  "browser": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.6 Safari/605.1.15",
  "date": "2024-11-28T08:21:17.141Z",
  "frigate_version": {
    "6a4497f32e924b252c8c105f6992f07a": "5.5.1/0.14.1-f4f3cfa"
  },
  "lang": "en",
  "timezone": "Europe/Berlin",
  "git": {
    "build_version": "5.2.0-HEAD+g69249b6",
    "build_date": "Fri, 23 Jun 2023 15:26:26 GMT",
    "commit_date": "Thu, 22 Jun 2023 09:21:26 -0600"
  },
  "config": {
    "type": "custom:frigate-card",
    "cameras": [
      {
        "camera_entity": "camera.garden_wide",
        "live_provider": "ha"
      }
    ],
    "grid_options": {
      "columns": "full"
    }
  }
}

[REQUIRED] Description of problem:

I have 4 cameras included with frigate, all are configured for go2rtc and work with the webrtc update fine. This are 2 Reolink h254 and 1 tapo h264 cameras.

Bildschirmfoto 2024-11-28 um 09 25 15

1 Reolink camera only stream h265 streams and this is not working with webrtc. I can use go2rtc as live view provider then streams show up. But for home assistant or webrtc provider it stays black. Maybe because it is h265? I use Safari and Chrome on Mac and Chrome on Android 15, all support h265 usually.

Bildschirmfoto 2024-11-28 um 09 19 10

[OPTIONAL] Javascript errors shown in the web inspector:

no errors in console shown

[OPTIONAL] Additional information:

figate config

  host: homeassistant.local
  port: 1883
  topic_prefix: frigate
  client_id: frigate
  user: user
  password: pass
  stats_interval: 60

model:
  path: plus://modelid

birdseye:
  enabled: false
  mode: continuous

detectors:
  coral:
    type: edgetpu
    device: usb

record:
  enabled: true
  retain:
    days: 10
    mode: motion
  events:
    post_capture: 30
    retain:
      default: 10
      mode: active_objects
      objects:
        person: 20
        car: 10

detect:
  max_disappeared: 2000

review:
  alerts:
    labels:
      - person

#ffmpeg:
  #hwaccel_args: preset-vaapi
  #hwaccel_args: preset-intel-qsv-h264

timestamp_style:
  position: tl
  format: '%d.%m.%Y %H:%M:%S'
  color:
    red: 255
    green: 255
    blue: 255

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

  filters:
    person:
      # Optional: minimum width*height of the bounding box for the detected object (default: 0)
      min_area: 3500
      # Optional: maximum width*height of the bounding box for the detected object (default: 24000000)
      max_area: 4000000
      # Optional: minimum score for the object to initiate tracking (default: shown below)
      min_score: 0.6
      # Optional: minimum decimal percentage for tracked object's computed score to be considered a true positive (default: shown below)
      threshold: 0.80

snapshots:
  enabled: true
  bounding_box: true
  clean_copy: true
  crop: true
  retain:
    default: 30
    objects:
      person: 90

cameras:
  entrance:
    enabled: true
    ffmpeg:
      output_args:
        record: preset-record-generic-audio-copy
      inputs:
        - path: rtsp://admin:password@192.168.1.84:554/h264Preview_01_sub
        #- path: rtsp://192.168.1.2:8554/entrance
          roles:
            - detect
        - path: rtsp://192.168.1.2:8554/entrance
          input_args: preset-rtsp-restream
          roles:
            - record

    detect:
      width: 640
      height: 480
      fps: 4

    review:
      alerts:
        required_zones:
          - Vorgarten
          - Einfahrt
      detections:
        required_zones:
          - Einfahrt
          - Vorgarten
    mqtt:
      timestamp: false
      bounding_box: false
      crop: true
      quality: 100
      height: 2000

    motion:
      mask: 
        0.001,0.003,0.005,0.535,0.227,0.608,0.225,0.65,0.18,0.663,0.165,0.706,0.368,0.724,0.553,0.739,0.695,0.71,0.662,0.668,0.475,0.683,0.491,0.572,0.527,0.556,0.665,0.618,0.764,0.639,0.874,0.653,0.897,0.46,0.851,0.11,0.727,0.003
      threshold: 25
      contour_area: 10
      improve_contrast: 'true'
    zones:
      Einfahrt:
        coordinates: 0.024,0.614,0,0.685,0.001,0.909,0.159,0.704,0.177,0.658
        loitering_time: 0
        objects:
          - person
          - car
      Vorgarten:
        coordinates: 
          0.179,0.663,0.006,0.909,0.003,0.994,0.995,0.994,1,0.246,0.893,0.365,0.881,0.645,0.785,0.677,0.392,0.714,0.182,0.701
        loitering_time: 0
        objects:
          - cat
          - dog
          - person
  garden_wide:
    enabled: true
    ffmpeg:
      inputs:
        - path: rtsp://admin:password@192.168.1.75:554/h264Preview_01_sub
          roles:
            - detect
        - path: rtsp://192.168.1.2:8554/garden_wide
          roles:
            - record

    detect:
      width: 896
      height: 512
      fps: 4

    mqtt:
      timestamp: false
      bounding_box: false
      crop: true
      quality: 100
      height: 2000

    objects:
      track:
        - person
        - cat
        - dog

    record:
      enabled: true
      retain:
        days: 2
        mode: motion
      events:
        post_capture: 30
        retain:
          default: 10
          mode: active_objects

    motion:
      mask: 0.284,0.008,0.288,0.082,0.709,0.074,0.709,0.012
      threshold: 50
      contour_area: 15
      improve_contrast: 'true'
    zones:
      garden_wide_full:
        coordinates: 0.003,0.009,0.998,0.005,0.998,0.998,0.002,0.999
        loitering_time: 0
        objects:
          - person
          - cat
          - dog
  garden_zoom:
    enabled: true
    ffmpeg:
      inputs:
        - path: rtsp://admin:password@192.168.1.75:554/h264Preview_02_sub
          roles:
            - detect
        - path: rtsp://192.168.1.2:8554/garden_zoom
          roles:
            - record

    detect:
      width: 896
      height: 512
      fps: 5

    record:
      enabled: true
      retain:
        days: 2
        mode: motion
      events:
        post_capture: 30
        retain:
          default: 10
          mode: active_objects

    motion:
      mask:
        - 644,0,640,41,254,37,248,0

      threshold: 50
      contour_area: 10
      improve_contrast: 'true'
    mqtt:
      timestamp: false
      bounding_box: false
      crop: true
      quality: 100
      height: 2000

    zones:
      garden_zoom_full:
        coordinates: 0.001,0.003,0,1,0.998,0.999,1,0.002
        loitering_time: 0
        objects:
          - cat
          - dog
          - person
  indoor:
    enabled: true
    ffmpeg:
      inputs:
        - path: rtsp://user:ih01qb4xp@192.168.1.73/stream2
          roles:
            - detect
        - path: rtsp://192.168.1.2:8554/indoor
          roles:
            - record
    detect:
      enabled: true
      width: 640
      height: 360
      fps: 5

    objects:
      track:
        - person

      filters:
        person:
          # Optional: minimum width*height of the bounding box for the detected object (default: 0)
          min_area: 3500
          # Optional: maximum width*height of the bounding box for the detected object (default: 24000000)
          max_area: 4000000
          # Optional: minimum score for the object to initiate tracking (default: shown below)
          min_score: 0.6
          # Optional: minimum decimal percentage for tracked object's computed score to be considered a true positive (default: shown below)
          threshold: 0.8

    record:
      enabled: true
      retain:
        days: 2
        mode: motion

    review:
      alerts:
        labels: []

    #motion:
     # mask:
       # - 1920,0,1920,1080,1368,1080,1366,1012,1416,773,1530,707,1293,460,1057,367,811,376,659,609,590,939,477,1080,0,1080,0,0

        required_zones: kinderbett
    mqtt:
      timestamp: false
      bounding_box: false
      crop: true
      quality: 100
      height: 1000

    motion:
      mask:
        - 0.366,0,0.372,0.073,0.004,0.066,0.002,0.002
        - 0.345,0.147,0.057,0.515,0.036,0.101
      threshold: 30
      contour_area: 10
      improve_contrast: 'true'
    zones:
      kinderbett:
        coordinates: 0.992,0.018,0.005,0.009,0.008,0.99,0.999,0.997
        loitering_time: 0
        objects: person
  reisebett:
    enabled: true
    ffmpeg:
      output_args:
        record: preset-record-generic-audio-copy
      inputs:
        - path: rtsp://admin:password@192.168.1.32:554/h264Preview_01_sub
        #- path: rtsp://192.168.1.2:8554/entrance
          roles:
            - detect
        - path: rtsp://192.168.1.2:8554/reisebett
          input_args: preset-rtsp-restream
          roles:
            - record

    detect:
      enabled: true
      width: 640
      height: 480
      fps: 4

    review:
      alerts:
        labels: []

        required_zones: Reisebett
    objects:
      track:
        - person

      filters:
        person:
          # Optional: minimum width*height of the bounding box for the detected object (default: 0)
          min_area: 3500
          # Optional: maximum width*height of the bounding box for the detected object (default: 24000000)
          max_area: 4000000
          # Optional: minimum score for the object to initiate tracking (default: shown below)
          min_score: 0.7
          # Optional: minimum decimal percentage for tracked object's computed score to be considered a true positive (default: shown below)
          threshold: 0.75

    record:
      enabled: true
      retain:
        days: 2
        mode: motion

    mqtt:
      timestamp: false
      bounding_box: false
      crop: true
      quality: 100
      height: 2000

    motion:
      threshold: 15
      contour_area: 10
      improve_contrast: 'true'

      mask: 
        0.072,0.664,0.225,0.45,0.261,0.482,0.689,0.8,0.688,0.995,0.996,0.997,0.989,0.012,0.004,0.001,0,0.98
    zones:
      Reisebett:
        coordinates: 0.29,0.36,0.124,0.425,0.025,0.634,0.006,0.997,0.767,0.988,0.753,0.799,0.345,0.46
        loitering_time: 0
        objects: person
go2rtc:
  log:
    format: text
    exec: trace
  streams:
    entrance:
      - http://192.168.1.84/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=password#video=copy#audio=copy#audio=opus
      - ffmpeg:entrance#audio=opus
    garden_wide:
      - rtsp://admin:password@192.168.1.75:554/h264Preview_01_main
      - ffmpeg:garden_wide#audio=opus
    garden_zoom:
      - rtsp://admin:password@192.168.1.75:554/h264Preview_02_main
      - ffmpeg:garden_zoom#audio=opus
    indoor:
      - ffmpeg:rtsp://user:ih01qb4xp@192.168.1.73/stream1
      - ffmpeg:indoor#audio=aac
    reisebett:
      - http://192.168.1.32/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=password#video=copy#audio=copy#audio=opus
      - ffmpeg:reisebett#audio=opus
version: 0.14
camera_groups:
  Zuhause:
    order: 1
    icon: LuAperture
    cameras:
      - entrance
      - garden_wide
      - garden_zoom
      - indoor
      - reisebett
xanderphillips commented 3 days ago

I had similar issue but mine was telling me that it couldn't connect to the stream and was showing the wrong port despite the correct port (8554) being configured for it. I found that changing the camera "Live view provider for this camera" from Automatic to go2rtc fixed the issue for me.