dermotduffy / frigate-hass-card

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

Use webrtc-card with 3rd party webrtc server #1330

Closed t0ny-peng closed 1 week ago

t0ny-peng commented 10 months ago

Love the work of Frigate card. Please forgive me if my question is not clear.

Basically, I'm running Scrypted on the same server of Frigate to stream cameras to HomeKit(the Homekit camera integration of HA has an annoying doorbell bug). Since Scrypted already provides a WebRTC server, I disabled the go2rtc server shipped with Frigate, and plan to stream from Scrypted WebRTC server directly to the browser.

Something that may help to understand:

My configuration is: (with unrelated part removed)

type: custom:frigate-card
...
cameras:
  - camera_entity: camera.front_door
    live_provider: webrtc-card
    webrtc_card:
      url: rtsp://10.0.0.2:39735/1cb7b361dabc465f # This stream is working in VLC
    title: Front Door
    icon: mdi:door
    triggers:
      occupancy: true

The browser console reported this error, which is understandable since webrtc integration is not enabled.

https://<my domain>/webrtc/webrtc-camera.js?v2.3.1

Describe the solution you'd like

I wonder if it's possible to hose this json file somewhere else, and let Frigate card load it, then shows the RTSP stream provided by Scrypted rebroadcasting. Thanks!

Describe alternatives you've considered

The only alternative is to run go2rtc in Frigate, and use the go2rtc live provider.

Additional context

N/A

dermotduffy commented 9 months ago

If I understand correctly, you're not using go2rtc or the webrtc card anywhere, and just want a plain RTSP feed to be viewable in HA but with the card interface and (presumably) access to Frigate events. If that's right, I think the solution is not anything related to go2rtc/webrtc_card. Have you tried just adding a generic RTSP camera feed in HA, and using that in the card?

t0ny-peng commented 9 months ago

Hi there. Correct, I am not using not go2rtc, but the WebRTC plugin of scrypted. Yes the HA RTSP camera would work since scrypted does rebroadcast the RTSP stream from camera, but the latency is horrible. I am not very familiar with how webrtc works. In my limited understanding, the web browser make a request to the WebRTC server, which returns a stream address that the browser should display. If that's the case, maybe it's possible to configure the card to use a different webrtc server?

dermotduffy commented 1 week ago

[Issue cleanup] I don't think this is possible, since AIUI each WebRTC client <-> server requires custom signalling.