Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Synology Surveillance Station not providing RTSP stream (for live view, etc.) #29931

Closed
BobWatson opened this issue Dec 14, 2019 · 25 comments · Fixed by #39838
Closed

Synology Surveillance Station not providing RTSP stream (for live view, etc.) #29931

BobWatson opened this issue Dec 14, 2019 · 25 comments · Fixed by #39838

Comments

@BobWatson
Copy link

Home Assistant release with the issue:

0.103.0

Last working Home Assistant release (if known):
N/A (don't think this has ever been implemented)

Operating environment (Hass.io/Docker/Windows/etc.):

Official Docker (latest tag)

Integration:

https://www.home-assistant.io/integrations/synology/

Description of problem:
The synology camera entities don't provide support Live View in Lovelace - clicking on cameras in picture-entities, etc. provides a regularly updating low-res JPEG, but not the realtime full resolution H.264 stream.

My read is that it is because the synology camera entities don't provide an RTSP stream (so can't be used for live view in the UI). This appears to be available in https://github.com/snjoetw/py-synology as video_stream_url but
https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/synology/camera.py doesn't appear to use it to set stream_source:
https://github.com/home-assistant/home-assistant/blob/8f5a00a98bddc6a42424c5a72dc40cc4f33f7e26/homeassistant/components/camera/__init__.py#L359

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

camera:
  - platform: synology
    url: https://127.0.0.1:5001
    username: ***
    password: ***
    timeout: 30
    verify_ssl: false

Traceback (if applicable):


Additional information:
N/A

@springstan
Copy link
Member

I am not sure why it is not working, however video_stream_url seems to be utilized for creating a MJPEG stream image:
https://github.com/home-assistant/home-assistant/blob/003658a3f084c5be5e4959f69c57e526423a7ef3/homeassistant/components/synology/camera.py#L88-L95

@BobWatson
Copy link
Author

BobWatson commented Dec 14, 2019

I misread it, you're right.

The underlying library is just returning mjpeg - not pulling rtspPath from GetLiveViewPath per https://global.download.synology.com/download/Document/Software/DeveloperGuide/Package/SurveillanceStation/All/enu/Surveillance_Station_Web_API.pdf

So more work than it looked at first glance.

(Looks like there's a PR from back in March addressing this - snjoetw/py-synology#11)

@stale
Copy link

stale bot commented Mar 15, 2020

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Mar 15, 2020
@joshtbernstein
Copy link

Still an issue mainly due to the library.

@stale stale bot removed the stale label Mar 17, 2020
@bagobones
Copy link

The integrations page stated it was an device issue that was fixed in preview (8.2.3-5829) the current live supported release is 8.2.7-6222 now. So in theory this should be fixed on the DSM side and possible to complete the integration.

@BobWatson
Copy link
Author

This issue is present (and was raised) in version 8.2.7-6222

@ab5000
Copy link

ab5000 commented May 29, 2020

Don't know if this is helpful or not, but I noticed your URL is https, but you have configured verify_ssl: false. This seems to be a contradiction? Why not use http?

(Full disclosure, I can't get mine working, so take it with a grain of salt)

@BobWatson
Copy link
Author

I don't have the service running on http (and I wanted to make sure the config eliminated any hint of network issues, etc. - so used 127.0.0.1). I did try it out that way, but it doesn't make a difference.

I think I've successfully identified the issue further up - the library isn't actually requesting the RTSP stream.

@Spirituss
Copy link

Guys, please, clarify - has the problem already solved? Does current Synology integration to Home assistant work with RTSP?

@bagobones
Copy link

Guys, please, clarify - has the problem already solved? Does current Synology integration to Home assistant work with RTSP?

Unless I missed something they still play a 2 second delayed slide shows, not streams..

@joshtbernstein
Copy link

It looks like the python library was updated, but nothing on the HA side of things. :-(

@pergolafabio
Copy link

Also, with Synology integration, it's not possible to use stream: in HA ...
So I use the provided rtsp streams, and the generic HA camera component

@joshtbernstein
Copy link

@Quentame Do you know if there are any plans to update the HA component to take advantage of ProtoThis/python-synology#57?

@Spirituss
Copy link

@bagobones

Unless I missed something they still play a 2 second delayed slide shows, not streams..
2 seconds is not bad. "Standard" delay for RTSP stream in HA is about 7-10 seconds. I compared original camera RTSP stream with Synology integration "stream" - the last works faster even with the current version.

@pergolafabio

Also, with Synology integration, it's not possible to use stream: in HA ...
So I use the provided rtsp streams, and the generic HA camera component
Synology integration has some very valuable features like:

  1. PVTZ angle presets, which can be used in HA via Syno API
  2. Surveillance Home mode activation/deactivation
  3. Motion detection with automatic video clip save with time back delay
  4. Different video resolution for stream and motion detection videos
    I see the only alternative way with MotionEye, but it is silly to use another soft when you already have Surveillance station.

@Quentame
Copy link
Member

Quentame commented Sep 8, 2020

See https://github.com/ProtoThis/python-synology/releases/tag/0.9.0 and #39819 😉 @joshtbernstein

@BobWatson
Copy link
Author

Amazing, thank you! Will grab as a custom_component and test it out

@pergolafabio
Copy link

is it now also possible to use the stream: component? this was not working before with cameras from synology

@BobWatson
Copy link
Author

It looks like it's now supported in the underlying python-synology library, but cameras have yet to be added to any components. Not sure what the longer-term plan is for the various synology components if the library has now all come together - I'm guessing they will merge into one at some stage?

But no, for right now, it is not possible to get a stream from Surveillance Station. But we are a lot closer than when I opened the issue.

@pergolafabio
Copy link

Ah ok, so what are advantages now then with this new library?

@BobWatson
Copy link
Author

It appears to contain all the functions necessary to properly use Surveillance Station - uses the updated API, etc.; like the release says to "add further platform, service and sensors in a the future". So updating the synology camera component is a lot easier (not no work, but less work).

Said another way - my comment on Dec 15 was essentially 'this looks like a bunch of work, since someone has to update the library'. Someone has now done a bunch of work, and updated the library (thanks @Quentame).

@Quentame
Copy link
Member

Quentame commented Sep 9, 2020

@BobWatson got the point, this new version of the library is necessary to add the camera platform into HA.
@shenxn is already working on it 😉

@pergolafabio
Copy link

Is there a PR where I can subscribe too for those czmeras

@Quentame
Copy link
Member

Quentame commented Sep 9, 2020

Is there a PR where I can subscribe too for those cameras

Not yet but I’ll tell you

@Quentame
Copy link
Member

Quentame commented Sep 9, 2020

PR here #39838

@pergolafabio
Copy link

ty, appreciated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants