go2rtc icon indicating copy to clipboard operation
go2rtc copied to clipboard

Stream Google Nest (WebRTC) from homeassistant to youtube

Open pertoft opened this issue 9 months ago • 3 comments

Hi,

I am trying to stream a google nest cam to a youtube live stream (birdhouse project). I can see the stream on the go2rtc gui fint (via homeassistant, as its impossible to configure otherwise).

However, Youtube dont detect the published stream. I have tested with an rtsp campera as input and that works.

I guess i need to re-encode the stream to h264 - correct?

hass:
  config: "/home/haas/"

streams:
  cam1:
    - hass://127.0.0.1:8123?entity_id=camera.kamera&token=<redacted>
publish:
    legehus: rtmp://x.rtmp.youtube.com/live2/<redacted>

What I have attempted to reencode:

hass:
  config: "/home/haas/"

streams:
  cam1:
    - hass://127.0.0.1:8123?entity_id=camera.kamera&token=<redacted>
    - "ffmpeg:back#video=h264#audio=aac"
publish:
    legehus: rtmp://x.rtmp.youtube.com/live2/<redacted>

Log:

root@zoneminder:/opt/go2rtc# ./go2rtc_linux_amd64
21:53:49.735 INF go2rtc version 1.9.0 linux/amd64
21:53:49.738 INF [rtsp] listen addr=:8554
21:53:49.745 INF [webrtc] listen addr=:8555
21:53:49.748 INF [api] listen addr=:1984
21:53:52.228 DBG [exec] run cmd="ffmpeg -hide_banner -v error -re -i back -c:v libx264 -g 50 -profile:v high -level:v 4.1 -preset:v superfast -tune:v zerolatency -pix_fmt:v yuv420p -c:a aac -user_agent ffmpeg/go2rtc -rtsp_transport tcp -f rtsp rtsp://127.0.0.1:8554/bc63f1735c9aafddff245d734dacd92a" url="exec:ffmpeg -hide_banner -v error -re -i back -c:v libx264 -g 50 -profile:v high -level:v 4.1 -preset:v superfast -tune:v zerolatency -pix_fmt:v yuv420p -c:a aac -user_agent ffmpeg/go2rtc -rtsp_transport tcp -f rtsp {output}"
back: No such file or directory
21:53:53.257 DBG [streams] can't stop none producer
21:53:53.258 DBG [streams] start producer url=hass://127.0.0.1:8123?entity_id=camera.kamera&token=redacted

Help wanted :-)

pertoft avatar May 09 '24 19:05 pertoft