Can you get a live rtsp stream?


#1

I have a camera I can view with an rtsp address. I thought I would be able to add it to ha, but I only get a snapshot of it, not the live view…is it possible to keep a live feed?

Here is what I have:

ffmpeg:
  ffmpeg_bin:  /usr/bin/ffmpeg

camera:
  - platform: ffmpeg
    input: 'rtsp://10.1.1.223:554/user=xxx&xxx=xxx&channe2=1&stream=0.sdp?real_stream--rtp-caching=100'
    name: Garage Camera

#2

What hardware are you running your HA on? I found that my pi could only refresh every 10 or 15 seconds and was using a lot of CPU to do so. I think if you run your HA on more powerful hardware you should get a more real-time stream.


#3

a unbuntu vm on a dell server with 2 cpus and 16g ram. i dont think that would be the issue…


#4

2 cpus for that vm. 24 cores on the server*


#5

I don’t think you can have a live feed without opening the camera (by clicking on the preview).
I’m using ZoneMinder and the preview is refreshed every 10s. If I open the preview, then it’s live feed.


#6

I’ve tried to get a live feed from rtsp feed but the support is only very poor, even with an home server, the live feed is slow and will only be refreshed every few seconds.

That’s because there is no python support for rtsp if I understood correctly.

You could try to tweak the ffmpeg feed, but it doesn’t get much better…


#7

Yea I see that, I got it to go on my dashboard but its the same way, a clip every 10 sec. I wish there was a way to run an app within a widget


#8

Hi, resurrecting an old thread, but is there any update to this? Added a Xiaomi camera with dafang hack, and I can get a pretty ok RTSP stream on my network, however when opening the picture on my hass.io install I’m only getting like 1 picture every 5 seconds or so…


#9

I am also interested in this. I’m running HA in a container, in a VM. I give it additional resources, but again the video is not real time. Any solutions on this?
Thanks


#10

I think I was able to add a camera RTSP stream to the motionEye add-on and get a live stream. Although honestly I can’t remember, I only did it for a few minutes as a test.


#11

Use Iframe and place the rstp link there… I have 6 Hikvision cameras streaming live (no snapshots).


#12

Config, please?


#13

Yeah, interesting too, normally it’s not possible to actually have a real live rtsp stream, only fragments…


#14

go to https://www.ispyconnect.com/sources.aspx and get the specific rstp link for your camera,
then open config ui, select iframe, and put your rstp link in (mine shows https because I’m doing a reverse proxy), but just put in your rstp:// link and it’ll show.


#15

You can of course use the rstp link in motioneye, then use the link from motioneye (http link) in the ui card.

Edit: When I changed my configuration I did use motioneye (put the rstp stream there), then went to video streaming, (don’t enable it) grabbed the embed url and pasted that in the iframe card. Sorry for the confusion.


#16

Ah ok, it’s actually streaming from an http url, not using the rtsp from HA? So you are just embedding an http url


#17

Yes, I’m sorry for the confusion… my setup is ESXi 5.5 VM with 16 gig drive and 4 gig ram, Ubuntu, HASS running in a container, and motioneye running under Ubuntu. I have the rstp stream in motioneye (which is considerably faster and fluid at 30fps), then the embed url in HA and I get 6 constant streams (no chop, skipping, or snapshots) and am serving it through nginx on another virtual. I had to open a second port on my router for the cameras to stream properly through the reverse proxy.


#18

yes, also running ESXI here, with HassOS instead
i used the RTSP stream directly from Synology surveillance
but it was never smooth in my lovelace config
according to balloob, rtsp component is not ready yet for smooth streaming :


#19

ok, you are using motioneye? but you dont have the camera feed actually in lovelace card?


#20

I also have a synology, but the stream was never smooth as mentioned… in motioneye (using the rtsp stream from my cameras) it is smooth and the embed url is smooth (the other stream in motioneye is too big and choppy).

In my setup the feed url is from motioneye, but I had to loop out and back in with nginx so I could see the feeds on the outside (I have a static ip with FQDN), but if you are just doing a straight shot, then yes, the embed url directly from motioneye works perfectly. My setup is motioneye out to nginx (reverse proxy) then out to the web, then the actual link (FQDN:port) is put into the lovelace card.