Unable to get audio from any camera

I connected many different WIFI cameras to HA (Wyze, Eufy, tplink…) and all of them have no audio in HA but in other players like VLC there is audio.

I have been investigating this for few days already. It seems that the problem starts with the fact the WebRTC doesn’t support AAC codec and probably all my cameras have AAC audio.

So, I added go2rtc with this config:

streams:
  camera.living_room_cam:
    - rtsp://username:[email protected]/live0
    - ffmpeg:rtsp://localhost:8554/camera.living_room_cam?audio=copy#audio=pcma

And it actually solved the problem. I am able to get video and audio in HA with the WebRTC UI card. The problem is that it’s not really an entity in HA, I can’t use events like recording, snapshot, automation, ONVIF features of the camera… Or at least I don’t know how to do that

So, I tried to connect these cameras using Generic Camera and / or ONVIF integrations as these cameras supports it. The problem that these integrations in HA don’t use go2rtc, rather they use RTSP2Web / RTSP2WebRTC and they don’t use ffmpeg so I don’t get audio :slight_smile:

Generic camera integration even have some extra parameters to send to ffmpeg which I don’t really understand how it works if it goes through RTSP2Web which is not ffmpeg, regardless, I passed these parameters to ffmpeg in generic camera:

-acodec pcm_s16le -vcodec copy

But it has 0 affect.

According to documentation HA has builtin ffmpeg but I don’t know how to use it correctly I guess.

So right now I am stuck between having a video and audio using go2rtc and give up on all the goodies of ONVIF features and camera entity in HA or get all the features without audio

Any help would be great

So just to add a bit more info.

I installed scrypted. Connected my camera. All works great. I get video and audio. (In scrypted)

I took the rebroadcast URL and put that URL in HA Generic Camera. Same thing, no audio. It’s like HA really doesn’t want to play audio :slight_smile:

Same issue here for any cameras I add via Scrypted rebroadcast URL. Did you manage to find a solution to this please?

It’s likely your audio codec. If you can set it to acc. I believe G.711 works as well. If neither is available using go to rtc handles additional audio codecs. It will also improve the speed when loading video.