go2rtc icon indicating copy to clipboard operation
go2rtc copied to clipboard

RTMP with sound support (AAC and MP3)

Open AlexxIT opened this issue 3 years ago • 5 comments

AlexxIT avatar Sep 02 '22 12:09 AlexxIT

Is the goal of this to have audio working for Frigate RTMP stream (which has audio in AAC, and therefore would need to be converted on the fly by go2rtc to PCM so that it can be played by regular WebRTC players, like the RTSPToWebRTC HA native integration?)

felipecrs avatar Sep 05 '22 17:09 felipecrs

It should be converted on the fly by ffmpeg, if you want audio with WebRTC.

Goal of this issue just to pass AAC and MP3 from RTMP to RTSP or to MSE.

AlexxIT avatar Sep 05 '22 17:09 AlexxIT

The thing is, since HA communicates with go2rtc by using the "RTSPToWebRTC" standards in an automatic manner, I have no chance to tell go2rtc to also convert the audio stream from AAC to PCM so that it becomes playable by the HA frontend.

Do you think something like this (automatic conversion if the audio source format isn't PCM and the stream is initiated by HA's RTSPToWebRTC integration) is possible to achieve?

Should I open a separate issue?

felipecrs avatar Sep 05 '22 17:09 felipecrs

You may add new stream to go2rtc with ffmpeg as source. And then add this stream to Hass as Generic camera.

AlexxIT avatar Sep 05 '22 20:09 AlexxIT

I understand, but I have many cameras and I don't want to create and maintain a duplicate entity plus the go2rtc configuration for each of them.

felipecrs avatar Sep 05 '22 20:09 felipecrs