I have an IP security camera mounted as a baby monitor, this camera can generate either an MJPEG stream or RTSP. I’ve got the MJPEG stream going into HomeAssistant, this works well enough for video, but doesn’t help with audio. I’m curious if there’s any good ways to extract the audio stream and play it back through HomeAssistant (probably on an Android phone), essentially turning the camera into a simple audio-only baby monitor?
I assume there’s some ffmpeg tricks I can do to extract the audio, but I’m not sure if HomeAssistant can easily play the audio in the browser?
Alternatively I suppose I could just try to get VLC or somesuch working on our phones, but it’s been kind of a pain on Android so I’m hoping HomeAssistant can do all of this work.
I have done this with VLC. You can convert the RTSP stream with VLC to an mp3 stream an it generates real-time a new http stream play that url in any Mediaplayer within home assistant.
Select Audio - MP3 profile (you can tweak the profile if you like) and select transcode
Next
Stream
Now VLC is streaming your RTSP as an MP3 stream and you can listing to it with the ipadres of the machine were VLC is running. example, http://192.168.1.10:8080
That depends on where you want to listen the stream, you can open the http stream in any Mediaplayer within Home Assistant. i am using Node-RED to do this. There is a CAST node so you can set your HTTP stream as source to Chromecast or a Google Home speaker. To hear the stream in webbrowser you can use Browser Modd im also control this in the media play via NODE-Red but it is also possible without.
Unfortunately it is not possible to stream to the Android app. For this I am going to ask for a feature request
I’m still trying to figure out how to use Unifi cameras as a baby monitor on my Google Home Hubs, and came across this thread (there’s no audio with the stream component).
One option I found in this thread is the FFmpeg Noise component. It won’t stream to mp3 as far as I know, but you could use the binary sensor to them create a text-to-speech alert on a Sonos or Google Home. In my case, something like “your kid is out of bed” could be useful (and probably creepy) coming out of my bedstand speaker. Just thought it was worth mentioning if it happened to support your use case.