jeroenterheerdt / ring-hassio

A Home Assistant add-on for live streaming from Ring devices.
MIT License
131 stars 93 forks source link

Stream not streaming in HASS #32

Open bymem opened 3 years ago

bymem commented 3 years ago

Hi i installed you addon, and followed the installation guide, and the settings seems to be working. Because when i start the addon, and open web ui i can see the stream.

But the generic camera i setup in hass, is not working and not showing in the interface. settings for the camera:

platform: generic
name: Front door live
stream_source: http://***:3000/public/stream.m3u8
still_image_url: http://***:3000/public/stream.m3u8

When i check the log on has i do get a error.

Logger: homeassistant.components.generic.camera
Source: components/generic/camera.py:162 
Integration: generic (documentation, issues) 
First occurred: 1:15:27 AM (2996 occurrences) 
Last logged: 1:34:56 AM

Error getting new camera image from Front door live: Server disconnected
Error getting new camera image from Front door live: Cannot connect to host ***:3000 ssl:default [Connect call failed ('***, 3000)]
Error getting new camera image from Front door live: [Errno 104] Connection reset by peer
DeliriousMetro commented 3 years ago

It works for me, don't use generic camera but ffmpeg.

  # Ring Feed
  - platform: ffmpeg
    name: Ring LAN ffmpeg
    input: http://<<HA IP>>:3000/public/stream.m3u8

My setup on HA records on motion, saves to a HA media folder, HA media folder is rsynced on linux to external drive, send notification to devices and it works neat. Only issue is I had to charge my Ring every week until I hard wired it - I no longer pay for Ring Protect but the issue is motion alerts do not work as well, wind moves my bush and I get notified as there is no human detection.

You'll need to enable the addon on demand or else your battery will die within a hour or two.

merlin2k commented 3 years ago

Do you have sound on your video? I have no sound

DeliriousMetro commented 3 years ago

Do you have sound on your video? I have no sound

@merlin2k No, I do not have sound either.

HA does not support audio with AAC ffmpeg integration it seems. I use an WyzeCam 2 (128mb device - 64mb devices shutter a lot) with dafang hacks and 1080p bootloader - setting audio encoding of MP3 and AAC and with either encodings I have same issue with HA under a different device. Btw, Ring camera stream quality is poor compared to cheaper cameras - no way that is 1080p.

I probed the stream coming from this add-on and see that audio is AAC. The video is h264 at 640x360. My internet connection is over 5G and I get about 600/50 (hovers around 400-600Mbps) with latency of 9ms, Ring doorbell connected via 2.4Ghz with RSSI - 48, I do not think Ring is throttling via adaptive streaming, but it does look like the live stream is not 1080p but recordings are 1080p.

Unfortunately, this is an issue with HA ffmpeg component and not this add-on. I am considering selling my Ring doorbell as it is really bad, but I got it on Black Friday with workplace discount for £46 but I feel like it's not worth it at all.

I had a look online and I can't find many people getting audio working with ffmpeg. If you use generic component for camera - there is some issue with it not displaying, as HA looks for a constant stream at start-up before the add-on is started and as it can't find this stream, it does not display anything despite the add-on becoming available later. I don't know if the generic component has worked in previous HA versions but that is the problem. The generic component would just proxy the stream to the located m3u8 - it does no processing unlike ffmpeg.

Stream Probe:

streams : 0 : index : 0 codec_name : h264 codec_long_name : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 profile : Main codec_type : video codec_time_base : 0/2 codec_tag_string : [27][0][0][0] codec_tag : 0x001b width : 640 height : 360 coded_width : 640 coded_height : 384 has_b_frames : 0 pix_fmt : yuv420p level : 30 chroma_location : left refs : 1 is_avc : false nal_length_size : 0 r_frame_rate : 90000/1 avg_frame_rate : 0/0 time_base : 1/90000 start_pts : 497278 start_time : 5.525311 bits_per_raw_sample : 8 disposition : default : 0 dub : 0 original : 0 comment : 0 lyrics : 0 karaoke : 0 forced : 0 hearing_impaired : 0 visual_impaired : 0 clean_effects : 0 attached_pic : 0 timed_thumbnails : 0 tags : variant_bitrate : 0 1 : index : 1 codec_name : aac codec_long_name : AAC (Advanced Audio Coding) codec_type : audio codec_time_base : 1/0 codec_tag_string : [15][0][0][0] codec_tag : 0x000f sample_fmt : fltp sample_rate : 0 channels : 0 bits_per_sample : 0 r_frame_rate : 0/0 avg_frame_rate : 0/0 time_base : 1/90000 disposition : default : 0 dub : 0 original : 0 comment : 0 lyrics : 0 karaoke : 0 forced : 0 hearing_impaired : 0 visual_impaired : 0 clean_effects : 0 attached_pic : 0 timed_thumbnails : 0 tags : variant_bitrate : 0 format : filename : http://HA-IPadr:3000/public/stream.m3u8 nb_streams : 2 nb_programs : 1 format_name : hls,applehttp format_long_name : Apple HTTP Live Streaming start_time : 5.525311 probe_score : 100 url : http://HA-IPadr:3000/public/stream.m3u8 END