-
Notifications
You must be signed in to change notification settings - Fork 15
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
Live stream video not working #9
Comments
i created a thread on synology forum, verry interesting reply today they have a new stream path now, so the HA code should be changed, but who can do that?? https://community.synology.com/forum/3/post/123094?reply=397361 reply : @pergola_fabio0183 These APIs are still alive there in SS8.2.3. They are just removed from the document and are not recommended to use due to many aspects including efficiency consideration. And since they are still work, we didn't mention them in the release note. However, you can still use them for 3rd-party integration, but we will not maintain them since they are only used by really older version of DS cam. If you get any problem using these APIs, you can check the usage flow or check the error code for more specific reason. The recommended alternative for live view is first using GetLiveViewPath method, and then play the returned rtsp/http path. (You can use 3rd-party player, such as VLC, to test the path) |
Based on the discussion it sounds like the streaming should still work in 8.2.3? Is it not working for you? I'm doing upgrade now, let's see if mine works or not |
Ok ya it's broken with 8.2.3 :( |
Yes , on forum they say nothing changed, just removed the documentation... But it doesn't work I deed... But I think an Synology employee did that reply... It's safe anyway to use the new api |
Ok, Synology replied again, they changed from did to cookie... https://community.synology.com/forum/3/post/123094?reply=397574 |
I tried the |
sid is not possible anymore with 8.2.3 it seems, you need cookies now |
Ok...hopefully, we can figure that out and start using it. |
@alekslyse , maybe we can discuss it here to summarize, videostream was indeed removed from API, i also created a thread on synology forum, see link above another approach is indeed rtsp, but according to @balloob |
Well as you did read on the thread what we CAN do while waiting is run a snapshot ever second to make a "fake" stream. I tested with extracting the URL as the API uses and yeah its not working so nothing we can do if its a synology bug unless we rewrite the synology component (or add another one) to use ffmpeg. Since they use different inheritance components im not sure if the best thing would be to decide to throw the original implementation and go all in on ffmpeg, make an option to choose what method to use or create a seperate platform for each. Things also depends a lot of what get approved by HA, and if the developer of the synology component is actually working on it, then it would be no point for me to start doing this. Unless someone can show the correct API url for getting the old stream somehow I see no other option than what I mentioned above. I dont maintain this repo nor the synology component so I have no idea what the developers are planning for the future |
ok , clear, but maybe to fix this "issue" its best to use the GetLiveViewPath method ? |
I see another component solved it lie this `
` I cant not update the synology component with this before the someone fast make a new api point here to get the rtsp-over-http and rtsp enpoints |
Stream directly from camera? Not all cameras can do that, I have some cheap foscams too, they don't have mpjeg stream... |
Well we are talking about streaming from synology here so the camera is less important? |
Ahh ok, my bad... Well, I am not that technical ;) |
Ok I will take a look this weekend, but we need to fix the api endpoints here first or it won’t be accepted in home assistant |
Have sent in a pull request to use the stream synology wants us to use. I dont have time to make multiple functions so someone feel free to make another function for backward compatible, but as of now the old method doesnt work anyway. I have fixed the synology component of ha to support this (much faster streaming), but cant push that before I know if this get pulled or not. |
@pergolafabio Could you try this custom component synology (custom_components/synology/camera.py) - this will pull a test build of this git with support for live streaming Remember to set your cameras to never expire session: Surveilance station -> ip camera -> right click on camera -> share stream path -> set to never expire and save. Do this on all the cameras |
I thought I'd give this a try too. The thumbnail loads fine, but the larger view still doesn't. I get the following in my logs: |
@alekslyse I tried the custom component and it worked for me most of the time. Occasionally I will also get the "Timeout while waiting of FFmpeg". I have 4 cameras that update fine, but one camera opens a big picture, but doesn't update. Everything is configured the same, so a little strange. The 4 cameras that work will occasionally only show a still as well and throw the error. |
Ok, I try testing this evening... Those streams are needed to for other systems , because every stream strarts with a "syno" user and for every cam a different password... |
Try this two options:
So try both and see if any of them helps the issue @pergolafabio the stream itself is not forever, just the session. That way we dont have to regenerate a new session on every close. |
ok, tried them both, seems also home_mode is present here :) anyway, tried the first one, if i click on a camera, i even had a videostream now, this i never saw before, on the older component, the quality is not great, but i had a actual stream, the clicked on another camera, no stream, clicked it again, and there was stream then tried the second one, but i seems less stable, needed to click a few times on the camera to get an stream then loaded back the first one, but it was also not that stable at first... so i am sure witch one is better ... |
Yeah the warning is about ffmpeg is not responding fast enough. Maybe need a bit investigation to make the stream a bit more seamless, but this seem like a home assistant timeout and not ffmpeg timeout |
ok, tried it again, still dont know witch one is better between those 2 |
the difference is just what time I give ffmpeg to analyze the content. I was hoping setting it to 2,5 it will just send the stream into hass as hass waits for 5 seconds then gives up by standard. Sometimes it would take a bit more time to start a camera stream so trying to see how I can speed it up |
ok, well, at first sight, i dont notice any difference, lets see what other are saying :) |
@pergolafabio Try this: https://raw.githubusercontent.com/alekslyse/home-assistant/synology/homeassistant/components/camera/synology.py I gave it just 10 ms to autodetect and on local test it was very fast. Hopefully it could solve the timeout issue |
hmm, in my case its worse :( strange, but i have to click the camera a few times now, and 1 out of 10 i see the feed previous versions were better in my case |
and also with stream directly from camera? |
@pergolafabio after I changed to direct from camera, all the versions work. |
hmm, not in my case, but maybe its because i dont have cameras that support mpeg ? |
It's actually surprising to me that it works with direct from camera because if I pull the cameras directly from withing HA by using the ONVIF platform instead of Synology it works like crap. But maybe thats not strange at all, just me not understanding why probably :) |
yeah, i also tried onvif before, was indeed crap , so not sure |
be carefull, if you change the source (camera/surveillance) seems the rtsp stream resets to 1 hour, instead of forever ... so if you use those stream paths for other software , like me .. :) |
@pergolafabio Mine stayed at forever. Just went back an checked. |
Going direct from the camera didn't work for me. This is using the most recent code above. Then again my camera has a poor wifi connection so that could be the issue there. Actually I see the following errors:
|
for me the same, first and second version was working , not always, but better then 3th version |
The thumbnail issue is not related to this, its another part of the api. Are you getting the ffmpeg isnt running after clicking a lot of times on the same videos? It might be related to HA need to stop the ffmpeg process before starting another one. If hass doesnt close it its a hass bug and not an api bug. I asked on their chat if anyone did know about states where ffmpeg isnt shutting down (as for me when I get that error other ffmpeg streams is working) |
I Will install proxmox on the nuc that runs ha tomorrow so I can this cross platforms. It’s getting better at least. Anyone of you who know ffmmpeg and how to make I moist possible pass through with no audio. I think it try to auto detect and then something happens to hass Easier to debug in a venv, will try tomorrow |
PS: there is a new PATCH out from Synology, to fix the 8.2.3 videostream issues from synology community: |
My suggestion is that I pull my pull request for the changeover and leave the pr as today with the home mode etc. Then we can figure out how to choose streams. For those who wants to use my version until the release is finished is welcome to do so. |
alekslyse, When I used your component the resulting pop-up window was bigger than the one I get with the standard component. I liked that a lot. Any way of making the standard window bigger? |
what version are you using 1, 2 or 3 ? |
They all worked for me, but since Synology came out with a new patch I updated Synology and deleted the custom synology component in HA. |
ah ok but we need to go further with this, yes, synology created a patch, but eventually in the near fututu they will drop the old videostream api, the one we are using now as a non cusstom component |
|
The reason is mjpeg as the original code is essential a set of jpg images set together to make a "fake" stream, probably using the preview size, while the method I used actually used the real stream. Thats why when FFMPEG is working its much faster as its not just a set of images, but a video stream. Sadly the FFMPEG component is a bit unstable on home assistant, but thats the way to go for the future if we can overcome the timeouts. I om not a FFMPEG expert, so if someone know this tool better, we just need to figure out the command how to make FFMPEG to skip trying to autodetect audio etc and just hand over the stream. Also it seem its an error that HA is keeping a FFMPEG session open (seem like every stream is its own process) and its not getting proplerly closed. As of now with the syn patch its some more time to figure this out, but for those who want to live with a bit sketchy ffmpeg my component / mod. I wont remove it. |
@alekslyse It looks like they’ve fixed the FFMPEG issue: home-assistant/core#22091 |
Ah, gonna try to load the custom component back later today, see if notice any difference |
tried 0.90, with option number 3 , as posted above but again : 2019-03-21 09:24:32 WARNING (MainThread) [haffmpeg.core] Timeout while waiting of FFmpeg |
Just a question, I have those cheap foscam C1 models, what I do, if a put the camera as platform generic in with direct rtsp stream from foscams directly, or stream coming from Synology... Well it's sloooooww , just frame a frame... ,Why is that? Why is HA not able to show me a fluent stream?? The stream in Synology surveillance is good! So why not the stream coming from surveillance to HA? Also if I open the same stream in VLC , it's also fluent? |
new ffmpeg 2.0 in 91.0 , not sure what i means? but maybe the few people here with frames issues? this will help? |
hey @alekslyse |
Looks like it was closed: home-assistant/core#21261 |
thats the old one, there was a newer version |
Oops. Looks like @MartinHjelmare requested some changes: home-assistant/core#21757 (comment) |
btw, just used version 3 , load it back as a custom, was a while ago :)
|
The location of CameraMjpeg changed. Change: Edit: Looks like it's more than that. Closest I've gotten is this:
But it results in a timeout |
After looking at the most up-to-date doc on the API https://global.download.synology.com/download/Document/DeveloperGuide/Surveillance_Station_Web_API_v2.8.pdf
I think the Video and Audio stream that was being used was removed? Maybe it was replaced with something else, but I am not familiar with their API.
This is was is called out in the linked doc
The text was updated successfully, but these errors were encountered: