Closed jeroen85 closed 3 years ago
Are you using authentication?
Correct. Just checked: If I disable authentication, it is working.
I will check the problem.
Big thanks to this fix! I want to say this is the first time I could see the live stream of my yi-hack in HASS!
p.s. I have enabled swap in my yi cam, but there is still some delay and constantly dropping frame (update per 5 sec) but it's pretty good to me already :)
Load Average | 2.70 1.36 0.54
Free/Total Memory | 32664/61164 KB
Free SD Space | 5%
/cgi-bin/get_configs.sh?conf=system
"RTSP":"yes",
"RTSP_STREAM":"high",
"RTSP_AUDIO":"alaw",
"ONVIF":"no",
"ONVIF_WSDD":"no",
"ONVIF_PROFILE":"high",
"ONVIF_WM_SNAPSHOT":"no",
A couple of seconds delay is normal, dropped frames no. Is your wifi connection ok?
Got a stream! But not working perfectly.
I have also set it up in HASS via another route (see below config in configuration.yaml). I use the still image directly from the camera. The stream I got via Synology Surveillance Station, because a while ago I was not able to get it working via the rtsp url from the camera...
This stream gives a much better result at the moment.
camera:
- platform: generic
still_image_url: "http://192.168.2.8:8080/cgi-bin/snapshot.sh?res=high&watermark=yes"
stream_source: "rtsp://syno:2878bde57b6f13b5998684546855d1c7@192.168.2.1:554/Sms=1.unicast"
name: "Kamer Arthur"
verify_ssl: false
username: "xxxx"
password: "xxxx"
authentication: basic
I have the same effect when I scroll the page during the stream. I think it's not a problem of the cam.
It seems much better now after running for a while... Looks good!
A couple of seconds delay is normal, dropped frames no. Is your wifi connection ok?
Wifi is good. Dropping frame: what I observed is for 1 min, there are 5-6 times dropping frame, each time is 3 sec missed. (I observed with the timestamp on the top LHS of the camera picture)
After some investigation, I think that the problem could be due to hass ffmpeg process. When you open the live streaming with yi-hack cam (y20ga), the ffmpeg process is over 100%. I am running Raspberry Pi 4 using docker (not hass.io)
Did you guys observe high CPU in hass too?
Yi-hack resources looks ok
WiFi Strength 100 %
Load Average 2.10 2.07 1.79
Free/Total Memory 22232/61164 KB
Free SD Space 4%
Cmd line called by hass, I dont understand why the argument is mjpeg
ffmpeg -i rtsp://xx:xx@my_ip:554/ch0_0.h264 -an -c:v mjpeg -rtsp_transport tcp -f mpjpeg -
ffmpeg version from hass docker
bash-5.0# ffmpeg
ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 9.3.0 (Alpine 9.3.0)
configuration: --prefix=/usr --enable-avresample --enable-avfilter --enable-gnutls --enable-gpl --enable-libass --enable-libmp3lame --enable-libvorbis --enable-libvpx --enable-libxvid --enable-libx264 --enable-libx265 --enable-libtheora --enable-libv4l2 --enable-libdav1d --enable-postproc --enable-pic --enable-pthreads --enable-shared --enable-libxcb --enable-libssh --disable-stripping --disable-static --disable-librtmp --enable-vaapi --enable-vdpau --enable-libopus --disable-debug
libavutil 56. 51.100 / 56. 51.100
libavcodec 58. 91.100 / 58. 91.100
libavformat 58. 45.100 / 58. 45.100
libavdevice 58. 10.100 / 58. 10.100
libavfilter 7. 85.100 / 7. 85.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
libpostproc 55. 7.100 / 55. 7.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...
top cmd result, outside docker (cpu 111)
root 29881 111 2.2 168528 87892 ? Rl 21:35 2:09 ffmpeg -i rtsp://xx:xx@my_ip:554/ch0_0.h264 -an -c:v mjpeg -rtsp_transport tcp -f mpjpeg -
CPU usage (docker within synology NAS) is about 20-25%
When RTSP stream is loaded via the generic option, the cpu usage stays very low.
camera:
- platform: generic
still_image_url: "http://192.168.2.8:8080/cgi-bin/snapshot.sh?res=high&watermark=yes"
stream_source: "rtsp://syno:2878bde57b6f13b5998684546855d1c7@192.168.2.1:554/Sms=1.unicast"
name: "Kamer Arthur"
verify_ssl: false
username: "xxxx"
password: "xxxx"
authentication: basic
But apparently this is loaded/shown in another way. The camera live view has some controls and full screen mode etc.
Edit: I see this is changed by the latest pull request from foxel. Works very well now! And CPU usage dropped significantly.
Hi, I have installed the latest version of the integration (HA docker on Synology).
The snapshot is showing correctly. But when opening the stream, it does not load and generates the following error in the logs:
I have auth setup on my camera