Does anyone know how to configure Home Assistant to be able to live stream from a Amcrest camera to a Chromecast enabled TV? My end goal is to be able to use Google Home to say “Hey Google, live stream the front door camera” and it would live stream to my TV.
The live stream URL would in this format: http:///cgi-bin/realmonitor.cgi?action=getStream&channel=&subtype=
I'm using ffmpeg to convert it to a HLS stream:
ffmpeg -rtsp_transport tcp -i rtsp://admin:[email protected]/live/ch1 \
-acodec copy \
-vcodec copy \
-hls_wrap 40 \
-flags -global_header \
/var/www/html/cam/cam.m3u8
I happen to already have a web server running on my PC, so any other client on the LAN (e.g. the Chromecast) can now access http://192.168.0.2/cam/cam.m3u8
I use Web Video Cast to send that HLS stream to the Chromecast.
I also have Amcrest cameras with RTSP streams. I spent a lot of time on this today and could not get the HLS stream to load in Chromecast devices, it loads fine in VLC and other HLS capable players. Already tried:
Checked that the server hosting the HLS file (.m3u8) is returning the correct headers, including CORS headers, content type
Tried all the combinations of codecs offered in the camera config and different resolutions, framerates, bitrates
Tried transcoding the file in FFMPEG even tho the RTSP stream from the camera is already h264
The last problem turned out to be the audio encoding which was incompatible with Chromecast. Changing the audio to AAC in the Amcrest camera encoding options was the last thing I was missing.
Oh man you’re basically a superhero. Unfortunately I’m not sure how to apply this to my Raspberry Pi 3 running hassio. Could you provide instructions or point to a resource that would help me understand how to apply this to my setup?
To make it very easy to use someone would have to transform that into Hassio Add-on. In my case I have other servers in my house and that’s where I run it (Raspberry Pi 1 can take care of a few cameras)
There is also the question of if it’s a good idea to run this in the same box running Home Assistant, if your camera streams area already set to AAC and h264 for audio and video it will be light on CPU and should be ok to run on the same box, If not the transcoding will take a lot of CPU resources.