Frigate et go2rtc

Bonjour à tous,

j’ai un systeme NVR avec 4 caméras. Grace à l’intégration go2rtc, j’arrive à récupérer le flux des caméras.
Par contre je ne vois pas comment je dois ensuite agir pour créer des entités utilisables, ou mieux pour intégrer ces flux dans Frigate.

Mon fichier go2rtc

streams:
  camera1: bubble://admin:admin@192.168.1.49:80/bubble/live?ch=0&stream=0
  camera2: bubble://admin:admin@192.168.1.49:80/bubble/live?ch=1&stream=0
  camera3: bubble://admin:admin@192.168.1.49:80/bubble/live?ch=2&stream=0
  camera4: bubble://admin:admin@192.168.1.49:80/bubble/live?ch=3&stream=0

Mon fichier frigate.yml

mqtt:
    enabled: False
    
cameras:
    garage:
        ffmpeg:
            inputs:
                - path: bubble://admin:admin@192.168.1.49:80/bubble/live?ch=0&stream=0
                  roles:
                    - detect
        detect:
            enabled: False
            width: 1280
            height: 720

Lorsque je vais dans Paramètres > Appareils et Services > Entité, je ne vois pas mes caméras, donc la première question sera comment avoir des entités de ces caméras ?
La seconde question est pour Frigate ou le flux ne s’affiche pas

Merci pour vos conseils

Ma configuration


[center]## System Information

version core-2023.10.1
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.11.5
os_name Linux
os_version 6.1.21-v8
arch aarch64
timezone Europe/Paris
config_dir /config
Home Assistant Community Store
GitHub API ok
GitHub Content ok
GitHub Web ok
GitHub API Calls Remaining 5000
Installed Version 1.33.0
Stage running
Available Repositories 1304
Downloaded Repositories 6
Home Assistant Cloud
logged_in false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Home Assistant OS 10.5
update_channel stable
supervisor_version supervisor-2023.10.0
agent_version 1.5.1
docker_version 23.0.6
disk_total 56.6 GB
disk_used 7.3 GB
healthy true
supported true
board rpi4-64
supervisor_api ok
version_api ok
installed_addons Terminal & SSH (9.7.1), Duck DNS (1.15.0), File editor (5.6.0), Mosquitto broker (6.3.1), tydom2mqtt (3.4.1), Home Assistant Google Drive Backup (0.111.1), go2rtc (1.7.1), Frigate (0.12.1), RTSPtoWebRTC (1.0.1)
Dashboards
dashboards 1
resources 3
views 2
mode storage
Recorder
oldest_recorder_run 8 octobre 2023 à 07:59
current_recorder_run 9 octobre 2023 à 22:57
estimated_db_size 4.17 MiB
database_engine sqlite
database_version 3.41.2
Sonoff
version 3.5.2 (2ad1cd7)
cloud_online 1 / 1
local_online 0 / 0
[/center]

Salut
Quel sont tes cameras? est ce que tu arrives à avoir le flux avec VLC?
tu es sur docker, as tu installer frigate avec hacs?

Bonne journée :slight_smile:

Salut @Osyris

À confirmer, mais si ce qui suit fait bien partie de la conf go2rtc de frigate

streams:
  camera1: bubble://admin:admin@192.168.1.49:80/bubble/live?ch=0&stream=0
  camera2: bubble://admin:admin@192.168.1.49:80/bubble/live?ch=1&stream=0
  camera3: bubble://admin:admin@192.168.1.49:80/bubble/live?ch=2&stream=0
  camera4: bubble://admin:admin@192.168.1.49:80/bubble/live?ch=3&stream=0

Tu dois dans la partie caméra faire la déclaration comme suit :

cameras:
    garage:
        ffmpeg:
            inputs:
                - path: rtsp://127.0.0.1:8554/camera1
                  roles:
                    - detect
        detect:
            enabled: False
            width: 1280
            height: 720

[EDIT]

Chez moi j’ai ça dans « config.yml » de frigate et qui fonctionne :

### go2rtc

go2rtc:
  streams:
    front_live:
      - rtsp://user:password@192.168.0.41:554/live.sdp
    front_live2:
      - rtsp://user:password@192.168.0.41:554/live2.sdp
    back_live:
      - rtsp://user:password@192.168.0.42:554/live.sdp
    back_live2:
      - rtsp://user:password@192.168.0.42:554/live2.sdp
      

### cameras

cameras:
  front:
    detect:
      enabled: True
      width: 640
      height: 360
      fps: 5  
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/front_live2
          roles:
            - detect 
        - path: rtsp://127.0.0.1:8554/front_live
          roles:
            - record

Mes caméras sont avec un NVR chinois ACEHE. Je peux récupérer le flux sur VLC avec la commande suivante

(http://192.168.1.49/cgi-bin/sp.cgi?chn=0&u=admin&p=admin)

Je suis sur RPI4 avec HACS.

Bonne journée à toi aussi :wink:

J’ai testé ta config en modifiant le fichier config/frigate.yml avec ceci

mqtt:
    enabled: False
    
go2rtc:
  streams:
    garage:
      - bubble://admin:admin@192.168.1.49:80/bubble/live?ch=0&stream=0
    
cameras:
  garage:
    detect:
      enabled: True
      width: 640
      height: 360
      fps: 5  
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/garage
          roles:
            - detect

Mais toujours rien :smiling_face_with_tear:

J’ai bien 2 fichier, le premier que j’ai configuré lors de l’installation go2rtc qui se nomme go2rtc.yaml et qui me permet de voir le flux caméra dans go2rtc
go2rtc1

Si ça peut aider, voici les logs dans Frigate au niveau frigate

2023-10-10 08:06:41.451859032  [INFO] Starting Frigate...
2023-10-10 08:06:46.279956458  [2023-10-10 10:06:46] frigate.app                    INFO    : Starting Frigate (0.12.1-367d724)
2023-10-10 08:06:46.330297636  [2023-10-10 10:06:46] frigate.app                    INFO    : Creating directory: /tmp/cache
2023-10-10 08:06:46.340226376  [2023-10-10 10:06:46] peewee_migrate                 INFO    : Starting migrations
2023-10-10 08:06:46.364509961  [2023-10-10 10:06:46] peewee_migrate                 INFO    : There is nothing to migrate
2023-10-10 08:06:46.429384039  [2023-10-10 10:06:46] detector.cpu                   INFO    : Starting detection process: 298
2023-10-10 08:06:46.435768688  [2023-10-10 10:06:46] frigate.app                    INFO    : Output process started: 300
2023-10-10 08:06:46.440574494  [2023-10-10 10:06:46] frigate.detectors              WARNING : CPU detectors are not recommended and should only be used for testing or for trial purposes.
2023-10-10 08:06:46.459357370  [2023-10-10 10:06:46] frigate.app                    INFO    : Camera processor started for garage: 303
2023-10-10 08:06:46.481096080  [2023-10-10 10:06:46] frigate.app                    INFO    : Capture process started for garage: 305
2023-10-10 08:06:47.068019891  [2023-10-10 10:06:47] frigate.video                  ERROR   : garage: Unable to read frames from ffmpeg process.
2023-10-10 08:06:47.069392106  [2023-10-10 10:06:47] frigate.video                  ERROR   : garage: Unable to read frames from ffmpeg process.
2023-10-10 08:06:47.070703654  [2023-10-10 10:06:47] frigate.video                  ERROR   : garage: ffmpeg process is not running. exiting capture thread...
2023-10-10 08:07:06.590570695  [2023-10-10 10:07:06] watchdog.garage                ERROR   : Ffmpeg process crashed unexpectedly for garage.
2023-10-10 08:07:06.590594492  [2023-10-10 10:07:06] watchdog.garage                ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2023-10-10 08:07:06.590617843  [2023-10-10 10:07:06] ffmpeg.garage.detect           ERROR   : [rtsp @ 0x557a23d140] method DESCRIBE failed: 404 Not Found
2023-10-10 08:07:06.590632658  [2023-10-10 10:07:06] ffmpeg.garage.detect           ERROR   : rtsp://127.0.0.1:8554/garage: Server returned 404 Not Found
2023-10-10 08:07:06.966476070  [2023-10-10 10:07:06] frigate.video                  ERROR   : garage: Unable to read frames from ffmpeg process.
2023-10-10 08:07:06.968142079  [2023-10-10 10:07:06] frigate.video                  ERROR   : garage: Unable to read frames from ffmpeg process.
2023-10-10 08:07:06.969309998  [2023-10-10 10:07:06] frigate.video                  ERROR   : garage: Unable to read frames from ffmpeg process.
2023-10-10 08:07:06.970299826  [2023-10-10 10:07:06] frigate.video                  ERROR   : garage: ffmpeg process is not running. exiting capture thread...

et au niveau go2rtc

2023-10-10 08:06:41.410407062  [INFO] Preparing go2rtc config...
2023-10-10 08:06:41.621551702  [INFO] Got IP address from supervisor: 192.168.1.37
2023-10-10 08:06:41.778939238  [INFO] Got WebRTC port from supervisor: 8555
2023-10-10 08:06:42.712624219  [INFO] Starting go2rtc...
2023-10-10 08:06:42.940791447  10:06:42.940 INF go2rtc version 1.2.0 linux/arm64
2023-10-10 08:06:42.942155977  10:06:42.941 INF [api] listen addr=:1984
2023-10-10 08:06:42.943481136  10:06:42.943 INF [rtsp] listen addr=:8554
2023-10-10 08:06:42.944875424  10:06:42.944 INF [srtp] listen addr=:8443
2023-10-10 08:06:42.946220509  10:06:42.945 INF [webrtc] listen addr=:8555
2023-10-10 08:06:47.049180090  10:06:47.048 ERR github.com/AlexxIT/go2rtc/cmd/streams/producer.go:53 > error="unsupported scheme: bubble://admin:admin@192.168.1.49:80/bubble/live?ch=0&stream=0" url=bubble://admin:admin@192.168.1.49:80/bubble/live?ch=0&stream=0
2023-10-10 08:06:47.049249979  10:06:47.049 ERR github.com/AlexxIT/go2rtc/cmd/streams/producer.go:53 > error="unsupported scheme: bubble://admin:admin@192.168.1.49:80/bubble/live?ch=0&stream=0" url=bubble://admin:admin@192.168.1.49:80/bubble/live?ch=0&stream=0
2023-10-10 08:06:47.049753698  10:06:47.049 WRN [rtsp] error="source 0 error: unsupported scheme: bubble://admin:admin@192.168.1.49:80/bubble/live?ch=0&stream=0" stream=garage
2023-10-10 08:06:51.443956780  [INFO] Starting go2rtc healthcheck service...
2023-10-10 08:07:06.948597430  10:07:06.948 ERR github.com/AlexxIT/go2rtc/cmd/streams/producer.go:53 > error="unsupported scheme: bubble://admin:admin@192.168.1.49:80/bubble/live?ch=0&stream=0" url=bubble://admin:admin@192.168.1.49:80/bubble/live?ch=0&stream=0
2023-10-10 08:07:06.948666059  10:07:06.948 ERR github.com/AlexxIT/go2rtc/cmd/streams/producer.go:53 > error="unsupported scheme: bubble://admin:admin@192.168.1.49:80/bubble/live?ch=0&stream=0" url=bubble://admin:admin@192.168.1.49:80/bubble/live?ch=0&stream=0
2023-10-10 08:07:06.949078520  10:07:06.948 WRN [rtsp] error="source 0 error: unsupported scheme: bubble://admin:admin@192.168.1.49:80/bubble/live?ch=0&stream=0" stream=garage
2023-10-10 08:07:16.988858120  10:07:16.988 ERR github.com/AlexxIT/go2rtc/cmd/streams/producer.go:53 > error="unsupported scheme: bubble://admin:admin@192.168.1.49:80/bubble/live?ch=0&stream=0" url=bubble://admin:admin@192.168.1.49:80/bubble/live?ch=0&stream=0
2023-10-10 08:07:16.989365284  10:07:16.988 ERR github.com/AlexxIT/go2rtc/cmd/streams/producer.go:53 > error="unsupported scheme: bubble://admin:admin@192.168.1.49:80/bubble/live?ch=0&stream=0" url=bubble://admin:admin@192.168.1.49:80/bubble/live?ch=0&stream=0
2023-10-10 08:07:16.989374766  10:07:16.988 WRN [rtsp] error="source 0 error: unsupported scheme: bubble://admin:admin@192.168.1.49:80/bubble/live?ch=0&stream=0" stream=garage
2023-10-10 08:07:27.029113863  10:07:27.028 ERR github.com/AlexxIT/go2rtc/cmd/streams/producer.go:53 > error="unsupported scheme: bubble://admin:admin@192.168.1.49:80/bubble/live?ch=0&stream=0" url=bubble://admin:admin@192.168.1.49:80/bubble/live?ch=0&stream=0
2023-10-10 08:07:27.029202547  10:07:27.029 ERR github.com/AlexxIT/go2rtc/cmd/streams/producer.go:53 > error="unsupported scheme: bubble://admin:admin@192.168.1.49:80/bubble/live?ch=0&stream=0" url=bubble://admin:admin@192.168.1.49:80/bubble/live?ch=0&stream=0
2023-10-10 08:07:27.029292713  10:07:27.029 WRN [rtsp] error="source 0 error: unsupported scheme: bubble://admin:admin@192.168.1.49:80/bubble/live?ch=0&stream=0" stream=garage
2023-10-10 08:07:37.077918294  10:07:37.077 ERR github.com/AlexxIT/go2rtc/cmd/streams/producer.go:53 > error="unsupported scheme: bubble://admin:admin@192.168.1.49:80/bubble/live?ch=0&stream=0" url=bubble://admin:admin@192.168.1.49:80/bubble/live?ch=0&stream=0
2023-10-10 08:07:37.077931831  10:07:37.077 ERR github.com/AlexxIT/go2rtc/cmd/streams/producer.go:53 > error="unsupported scheme: bubble://admin:admin@192.168.1.49:80/bubble/live?ch=0&stream=0" url=bubble://admin:admin@192.168.1.49:80/bubble/live?ch=0&stream=0
2023-10-10 08:07:37.077937886  10:07:37.077 WRN [rtsp] error="source 0 error: unsupported scheme: bubble://admin:admin@192.168.1.49:80/bubble/live?ch=0&stream=0" stream=garage
2023-10-10 08:07:47.128573378  10:07:47.128 ERR github.com/AlexxIT/go2rtc/cmd/streams/producer.go:53 > error="unsupported scheme: bubble://admin:admin@192.168.1.49:80/bubble/live?ch=0&stream=0" url=bubble://admin:admin@192.168.1.49:80/bubble/live?ch=0&stream=0
2023-10-10 08:07:47.128670989  10:07:47.128 ERR github.com/AlexxIT/go2rtc/cmd/streams/producer.go:53 > error="unsupported scheme: bubble://admin:admin@192.168.1.49:80/bubble/live?ch=0&stream=0" url=bubble://admin:admin@192.168.1.49:80/bubble/live?ch=0&stream=0
2023-10-10 08:07:47.128676396  10:07:47.128 WRN [rtsp] error="source 0 error: unsupported scheme: bubble://admin:admin@192.168.1.49:80/bubble/live?ch=0&stream=0" stream=garage
2023-10-10 08:07:57.180562970  10:07:57.180 ERR github.com/AlexxIT/go2rtc/cmd/streams/producer.go:53 > error="unsupported scheme: bubble://admin:admin@192.168.1.49:80/bubble/live?ch=0&stream=0" url=bubble://admin:admin@192.168.1.49:80/bubble/live?ch=0&stream=0
2023-10-10 08:07:57.180632340  10:07:57.180 ERR github.com/AlexxIT/go2rtc/cmd/streams/producer.go:53 > error="unsupported scheme: bubble://admin:admin@192.168.1.49:80/bubble/live?ch=0&stream=0" url=bubble://admin:admin@192.168.1.49:80/bubble/live?ch=0&stream=0
2023-10-10 08:07:57.181236541  10:07:57.180 WRN [rtsp] error="source 0 error: unsupported scheme: bubble://admin:admin@192.168.1.49:80/bubble/live?ch=0&stream=0" stream=garage

C’est le flux direct vers la caméra ou vers ton nvr « chinois » ?

Dans config.yml de frigate, tests d’ajouter ça :

go2rtc:
  streams:
    garage:
      - bubble://admin:admin@192.168.1.49:80/bubble/live?ch=0&stream=0
  webrtc:
    candidates:
      - @ip_de_frigate:8555

ET ça :

image

C’est un add-on en supplément de frigate ?

Je pose la question car depuis la dernière version de frigate « go2rtc » est embarqué dans frigate.

Mais comme je suis sur une install « full » container (donc pas HAOS), j’ai du mal à pouvoir comparer les 2 types d’install.

[EDIT] t’es sûr de ça :

bubble://admin:admin@192.168.1.49:80/bubble/live?ch=0&stream=0

Ce serait pas plutôt :

http://admin:admin@192.168.1.49:80/bubble/live?ch=0&stream=0

Vu que la caméras est bracnhé sur le NVR, je peux l’atteindre en passant par l’ip du NVR 192.168.1.49
Dans VLC en HTTP avec

http://192.168.1.49/cgi-bin/sp.cgi?chn=0&u=admin&p=admin

Dans Home assistant avec go2rtc en stream avec

bubble://admin:admin@192.168.1.49:80/bubble/live?ch=0&stream=0

Oui go2rtc est un addon supplémentaire


Cet addon permet de récupérer n’importe quel flux de NVR

Comme je disais, la dernière version de Frigate embarque go2rtc :

peek

Bref je ne suis pas certain que tu aies vraiment besoin de l’add-on « go2rtc ».

Ensuite tu peux toujours faire l’essai dans frigate sans passer par cet add-on avec :

go2rtc:
  streams:
    nvr_garage:
      - http://192.168.1.49/cgi-bin/sp.cgi?chn=0&u=admin&p=admin
  webrtc:
    candidates:
      - @ip_de_frigate:8555


cameras:
  garage:
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/nvr_garage
          roles:
            - detect
    detect:
      enabled: False
      width: 1280
      height: 720

Mais comme tu es parti, ça te fait :

  • 2 nvr, le chinois et frigate.
  • 2 go2rtc, l’add-on + celui embarqué dans frigate

Faudrait préciser ce que tu veux faire de frigate :wink:

Je « tagg » @Pulpy-Luke et @golfvert je sais qu’ils utilisent frigate, peut-être qu’ils y verront plus clair que moi ^^

Il me semblait que l’addon go2rtc permettait de récupérer le flux camera pour le rendre compatible avec n’importe quel système NVR.

Je désinstalle tout et je recommence avec uniquement frigate alors.

Mon but:
Je possède çà : https://www.amazon.com.au/ACEHE-Wireless-Security-Surveillance-Weatherproof/dp/B01MYGSQEQ

Je souhaite incorporer les flux camrés dans HA et dans frigate pouvoir faire de la détection humaine et animaux pour ne faire de l’enregistrement que lorsqu’une personne ou un chine / chat rentre chez moi.

Bon, je suis reparti de 0, un peu long mais j’ai pu progresser un peu.
J’ai mis de côté Frigate pour le moment, car je voulais être sur que je puisse utiliser go2rtc et WebRTC Camera pour afficher le flux d’un camera sur le dashboard.

Donc j’ai installer go2RTC avec ce process : GitHub - AlexxIT/go2rtc: Ultimate camera streaming application with support RTSP, RTMP, HTTP-FLV, WebRTC, MSE, HLS, MP4, MJPEG, HomeKit, FFmpeg, etc., le service démarre bien, et j’ai configuré mes caméras sans difficulté avec le fichier config/go2rtc.yaml qui contient

streams:
  camera1: bubble://admin:admin@192.168.1.49:80/bubble/live?ch=0&stream=0
  camera2: bubble://admin:admin@192.168.1.49:80/bubble/live?ch=1&stream=0
  camera3: bubble://admin:admin@192.168.1.49:80/bubble/live?ch=2&stream=0
  camera4: bubble://admin:admin@192.168.1.49:80/bubble/live?ch=3&stream=0

Ensuite j’ai installé WebRTC Camera puis j’ai créer une carte avec les paramètre suivant

type: custom:webrtc-camera
url: rtsp://localhost:8554/camera1

Jusqu’ici, pas de souci et sur le dashboard j’ai bien mon flux camera en temps réel

Suite à çà, j’ai arrêter l’addon go2rtc → plus de flux camera ce qui est normal puisqu’elle n’est plus déclaré :slight_smile:
J’ai installé Frigate avec cette procédure : https://docs.frigate.video/

Voici la config de mon fichier frigate.yml

mqtt:
  enabled: False

go2rtc:
  streams:
    camera1: bubble://admin:admin@192.168.1.49:80/bubble/live?ch=0&stream=0

cameras:
  camera1:
    ffmpeg:
      inputs:
        - path: rtsp://localhost:8554/camera1
          roles:
            - detect
    detect:
      enabled: False
      width: 1280
      height: 720

et la je n’ai pas le flux de la camera qui remonte

Donc le flux remonte par l’addon go2rtc seul mais ne remonte pas avec le go2rtc inclus dans Frigate ? Ou alors je fais pas la bonne config ?

Voici les logs dans Frigate


D’après les logs le chema avec bubble ne serait pas correct, pourtant si l’addon go2rtc et le meme que celui inclus dans Frigate, ça devrait me remonter le flux de la même façon ?

Merci

Tu peux ajouter les 3 dernières lignes

go2rtc:
  streams:
    nvr_garage:
      - http://192.168.1.49/cgi-bin/sp.cgi?chn=0&u=admin&p=admin
  webrtc:
    candidates:
      - @ip_de_frigate:8555

Là je ne sais pas dire.

Est-ce que le nvr « chinois » peut fournir des flux rtsp du style ? :

rtsp//admin:admin@192.168.1.49:554/bubble/live0

L’ajout de ligne ne change rien, toujours pas de flux dans frigate :frowning:

nons ce nvr « chinois » ne possède pas de flux rtsp. C’est d’ailleurs en cherchant coment l’utiliser sans rtsp que j’étais tombé sur le github d’AlexxIT et de son go2rtc

Juste pour voir, est ce que ce flux :

http://admin:admin@192.168.1.49:80/cgi-bin/sp.cgi?chn=0

Fonctionne dans vlc ou ton navigateur ?

username or password error

Dans le nivagateur ou dans VLC, le flux qui fonctionne est

http://192.168.1.49/cgi-bin/sp.cgi?chn=0&u=admin&p=admin

Dans VLC, tu peux faire « ctrl + i » quand tu visualises le flux.

Et mettre un screen de l’onglet « Codec » de la fenêtre qui va s’afficher stp ?

Voici ce que j’ai

Merci à toi pour ton aide en cours :wink:

Ok,

alors regarde la doc :

Et utilises l’url en « http » pour voir si ça fonctionne mieux :crossed_fingers:

Salut

Au prix d’un réencodage du flux/changement du protocole. Donc y-a-t-il un avantage à transformer quelque chose si c’est déjà lisible par frigate ?

Ah mais si c’est lisible directement dans Frigate, je prends avec plaisir. C’est d’ailleurs le but. Le reste ne sont que des tests pour s’assurer que le flux camera arrive bien dans HA