Open majkers opened 4 months ago
Hey there @starkillerog, mind taking a look at this issue as it has been labeled with an integration (reolink
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
reolink documentation reolink source (message by IssueLinks)
Do both the low resolution and high resolution fail?
Do you have special caracters in your password or username? WARNING: only answer with yes/no, DO NOT POST YOUR PASSWORD.
Do you have the RTMP port enabled in the reolink desktop client? Are you able to play the same URL using for instance VLC media player?
Do both the low resolution and high resolution fail?
I do not see any distinction in media browser list....
Do you have special caracters in your password or username?
Yes.
Do you have the RTMP port enabled in the reolink desktop client?
Yes, exactly on that port
Are you able to play the same URL using for instance VLC media player?
No but maybe becasue of those escaped chars like '%20' ?
@majkers you could play around with the escaped chars and VLC media player, most likely there are also escaped chars in the username/password if you have special chars in there. If you can find a working URL I can then adjust the HomeAssistant code.
Could also be usefull to temporarly change the username/password to something with only letters and numbers and see if it works then.
Sorry I can't make it work. Username and password are not a problem for VLC since I can play rtsp streams. From reolink camera's pplayback page I see a link like this:
<video class="h5_video-fill bc-h5_player" muted="" src="/cgi-bin/api.cgi?token=757f7f9adec706d&cmd=Playback&source=Mp4Record/2024-02-19/RecS02_20240219_050031_050231_8B28818_F85252.mp4&output=Mp4Record/2024-02-19/RecS02_20240219_050031_050231_8B28818_F85252.mp4&encrypt=24WujG4UasdfC2k8u+CPj/rUsfubB5/9h6sdN2/4=" preload="metadata" flashstopped="true" id="dummyid12"></video>
So no vod part. But still can't prepare any working link for VLC....
OK I made a quic search and IMHO a link shoud look like this (at least it is working in VLC):
I also found this https://reolink.com/wp-content/uploads/2017/01/Reolink-CGI-command-v1.61.pdf but it doesn't seem to work casue it is very old document....
``Logger: homeassistant.components.stream
Source: components/stream/__init__.py:431
Integration: Stream (documentation, issues)
First occurred: 18. Februar 2024 um 20:32:46 (294 occurrences)
Last logged: 20:22:59
Error from stream worker: Error opening stream (ERRORTYPE_5, I/O error) rtmp://192.168.1.150:1935/vod/Mp4Record%202024-02-18%20RecM04_20240218_203151_203220_6D28C0000_C440E7.mp4?channel=0&stream=0&user=****&password=****
Error from stream worker: Error opening stream (ERRORTYPE_5, I/O error) rtmp://192.168.1.150:1935/vod/Mp4Record%202024-02-18%20RecM04_20240218_200955_201035_6D28C0000_112923E.mp4?channel=0&stream=0&user=****&password=****
Error from stream worker: Error opening stream (ERRORTYPE_5, I/O error) rtmp://192.168.1.150:1935/vod/Mp4Record%202024-02-19%20RecM04_20240219_185931_185958_6D28C0000_A13A46.mp4?channel=0&stream=0&user=****&password=****
I have that too
when I try it via the HA app
The integration in the media of reolink freezes the app
When trying to download in the file browser only a browser window comes up with 401 (no download)
I upload via FTP from the camera to the media folder
In your own network, viewing in HA only via “my media” via reolink does not work
Neither works via the HA app
Question, do you have RTMP enabled in the camera? RTSP is not supported for playback by them, only RTMP and "download". Also, try changing your password to very basic letters and numbers. For some of the urls, the cameras have very poor url encoding support and some special characters will get encoded by the browser and appear to be invalid paswords to the cameras.
I've tried everything now - no change With FLV there was even a deterioration - no more stream in the home network for the cam entities - that worked very well with RTSP I will now switch back to rtsp
I have the feeling that the cloud isn't involved When I tried FLV I had a picture on the app after 3 minutes but only happened once?! and the app becomes very viscous with "my media" and "reolink" in media sources "camera" in media sources also works with rtsp!!! but that's only live result: No access to the history data via the app
Everything works with the reolink app But of course without the Reolink cloud only in the home network
I've already said what IMHO is wrong. Reolink integration uses very old URL with 'vod' word in it. Latest API uses different one:
It is also working in VLC
Does VLC report it as an hls stream or just as an mp4? I ask because I have been toying with the ability to download the HD video, but the output is the raw file, which cannot be passed through the stream integration. This means that only a direct connection to the camera would be supported, so it would break using via an off network connection (i.e. the nabu casa cloud, or a proxy) the vod playback method provides an hls mpeg-url format stream which is compatible with the stream integration.
@starkillerOG you might want to ask reolink themselves if they removed the rtmp vod playback from newer firmware.
They might have also just forgot, I have a first gen duo and its initial firmware had a bug where the snap function with a get call would return the same lens snap for both channels, but a post would return the correct snap. This was fixed in a following release.
Does VLC report it as an hls stream or just as an mp4?
Sorry but I don't know what do You mean? How can I check it?
same here with the same error log (ERRORTYPE 5), but I don't understand that it says RTMP, dispite I'm using RSTP stream
important to mention, that it has worked before the 2.3 update, now it doesn't
@sezlony The playback of recordings only supports RTMP not RTSP. So it will always be using RTMP for past recordings. Could you check if you have the RTMP port enabled in the settings of the reolink desktop client under Settings > Network > Advanced > Port Settings?
You mention the playback was working in a older version of HomeAssistant. I have changed the way the password and username are encoded for the RTMP playback stream in reolink-aio 0.8.7 This was first included in HomeAssistant 2024.1.4 So if that is really the issue it should work on HA 2024.1.3 and should fail on 2024.1.4 or higher.
Would someone be able to test if the issue does not exist on HA 2024.1.3 and apears on HA 2024.1.4?
I manage 2 instances, one of them had 1.2 before the upgrade, I can confirm it was fine
edit: RTMP port is enabled (1935) and as a test I configured one stream in reolink integration to RTMP and gives nice live feedback, only playback does not work
I have rtmp on port 1935 enabled too, I get the same error And playback in google home and alexa isn't possible
If I remember correctly if there are special characters in the password they cannot be encoded for some cameras. The first step to try would be to test with a simple text and number only password to see if it is an encoding issue.
As for google and Alexa playback, unless you are exposing your cameras to the internet, or using the uuid feature via the Reolink app, they would have no access except through HA.
@xannor: do I have to completely reconfig the reolink integration (from scratch) after changing the password or will it ask for new credentials only?
It should, on receiving an auth error, allow you to fix the password via the devices list.
I changed the password, inside of Homeassisant it self its working all time for me. But I'm not able to proxy the camera to amazon alexa and google home. I see the entities in google home and alexa, but there is no video
@Stephan-4711: to be honest I don't really like the idea to change password to a less secure, but c'est la vie, let's see if it works
I just did it with an extra user for testing this behavior and I can say, it's not because of a to strong password, have still the same problems.
@Stephan-4711: I said 'less secure' password, because if you remove a special character from a password it surely becomes less secure and yes, I confirm that using a password without anything fancy does the trick
I would have never thought of it... now that it's solved I would gently suggest that this be included in the documentation
ok, the one is solved, the other just starts 🤣🤣🤣🤣🤣🤣
Logger: homeassistant.components.stream.stream.camera.udvar_folyekony
Source: components/stream/__init__.py:431
Integration: Stream (documentation, issues)
First occurred: 11:01:14 (14 occurrences)
Last logged: 11:16:27
Error from stream worker: Error opening stream (HTTP_UNAUTHORIZED, Server returned 401 Unauthorized (authorization failed)) rtsp://****:****@192.168.1.5:554/h264Preview_01_sub
It does not need to stay less secure, it just shows that an encoding issue is the problem and needs to be corrected in the integration. Also the "complexity" of a password is not the strength, but the variance and length. The more possible combinations makes it harder to brute-force. So a password of 16 (a)'s is more secure than any combination of 10 or less characters. Special characters just slow down humans.
@Stephan-4711 I dont think the RTMP stream can be proxied correctly outside of HA, In fact this was one of the areas that I was trying to work on over winter, but they only "proxy" capability HA provides is the Stream integration, and the playback does not work well in it. Plus newer cameras that are HD dont play well with RTMP anyway. I had built some code to do an actual download, but limitations in HA (namely a hard 30sec connection limit) would break the download after 30 seconds. The only way to work around it was to pass the dl url to the client, which breaks any remote connectivity.
I wish a viable general proxy integration would be built for HA so other types on pass-thru connections could be provided to clients regardless of how they are connected (Browser, app, remote, local, external service, etc.)
@sezlony give it some time to refresh, or restart HA, it could be something is caching the old password, or the cameras limited defenses fired up when you changed it and it is denying the auth. The some cameras do have a limited attack protection where they would start denying connections from a particular client after to many failed attempts.
a general proxy sound very cool, sadly I'm not a coder just an admin. I`m not able to code such things :-(
I gues * ^doesn't make problems in encoding. the password with this signs where working
It does not need to stay less secure, it just shows that an encoding issue is the problem and needs to be corrected in the integration. Also the "complexity" of a password is not the strength, but the variance and length. The more possible combinations makes it harder to brute-force. So a password of 16 (a)'s is more secure than any combination of 10 or less characters. Special characters just slow down humans.
@xannor: wow, that was useful, thank you for clarifying!
@xannor did you read my last comment https://github.com/home-assistant/core/issues/110939#issuecomment-1953653259? Can You comment on that?
@sezlony give it some time to refresh, or restart HA, it could be something is caching the old password, or the cameras limited defenses fired up when you changed it and it is denying the auth. The some cameras do have a limited attack protection where they would start denying connections from a particular client after to many failed attempts.
@xannor: just as you said, the error messages were cleared up after a HA restart!
thank you!
I'm encountering this issue with a Reolink Video Doorbell Wifi but I don't think the solutions presented in this issue apply to this case.
I'm running Home Assistant Core 2024.4.2 in a docker container in host networking mode.
This is the error I am seeing (no difference from the other errors here): 2024-04-08 18:56:33.396 ERROR (stream_worker) [homeassistant.components.stream] Error from stream worker: Error opening stream (ERRORTYPE_5, I/O error) rtmp://10.0.0.151:1935/vod/Mp4Record%202024-04-08%20RecS03_DST20240408_113128_113204_3914C08_1B6A17.mp4?channel=0&stream=1&user=****&password=****
http://IP_NO_PORT/cgi-bin/api.cgi?cmd=Playback&source=filename.mp4&output=filenam.mp4&user=USER&password=PASS
) does not seem to work.
- I'm just using alphanumeric characters and underscores.
not that I'm an expert in this, but I'm quite sure that this is the very problem! (just as in my case!) please try a password without ANY special characters other than letters and numbers and try again!
That second url is a NVR playback url, i beleive, and only works with an NVR. (hopefully the IP_NO_PORT, USER, and PASS are just your obsfucation, and not the actual url as those would be invalid.)
When you loaded the stream in VLC, in the stream info, did it say what type of stream it was? The sream component of HA only supports HLS, and if the doorbell uses a different structure, it chould cause that component to fail. Unfortunately, this is not something that is part of this integration, but a core part of HA and if the camera so not follow its rules, it will refure to work with it.
No it not NVR only. It is a link taken from HTTP web page accesible for every cam in playback mode. For example from my Duo 2 WiFi:
For VLC I just have to replace token with user and password and stream has info like this:
And it doesn't mind special chars....
- I'm just using alphanumeric characters and underscores.
not that I'm an expter in this, but I'm quite sure that this is the very problem! (just as in my case!) please try a password without ANY special characters other than letters and numbers and try again!
It appears you're exactly right! I convinced myself that my password couldn't be the problem because an underscore is an unreserved character. But I just changed my password to only alphanumeric characters and it works.
And it doesn't mind special chars....
you have to understand, that VLC is not Home Assistant (and vice versa), so what is working with VLC will not necessarliy work in HA.
as I learned from your posts you have never tried changing your password avoiding special chars as suggested, so you should try that first! (the playback links are probably just fine as they are)
No I did not cause I don't think that it is OK that integration forces someone to change password to IMHO less secure one even though Reolink itself doesn't mind special chars.
@etrochim thank you very much for reporting the underscore "" in the password was the problem in your case. I will be looking into this (changing my own password to include a "") and hopefully figure out how to get the encoding of the password right.
It is fairly hard for me to try out all the possible special chars in a password and the encoding that reolink requires is not very well documented or obvious....
Luckely the normal API does not need a password in the URL, but only once in the json body of the login command which does not require any encoding (special chars are fine there). Then you get a nice short lived token which only has plain letters....
That beeing said, I changed the way in which recordings work for HA 2024.7.0 It will now be using diffrent URLs which use the token instead of password. Hopefully that will improve the situation.
Please report back if it is working after HA 2024.7.0
HA 2024.7.1 works for me to view the videos while 2024.5.5 did not. However, I only see the "low resolution" ones.
@sven337 glad to hear it is now working for you!
If you only see the low resolution playback videos and not the high resolution, that is because the high resolution are encoded with h265. Unfortunately almost all browser do not support playing h265 encoding.... also the companion app does not support h265 as far as I know.
The low resolution is encoded with h264.
HA 2024.7.1 works for me to view the videos while 2024.5.5 did not. However, I only see the "low resolution" ones.
Still. not working for me on 2024.7.1. Any particular configuration / setting that you've changed or suggest that I check?
The issue appears to be with https / SSL. I'm getting the following errors:
Using the browser
Logger: homeassistant.components.reolink
Source: helpers/update_coordinator.py:344
integration: Reolink IP NVR/camera (documentation, issues)
First occurred: 7:28:03 PM (1 occurrences)
Last logged: 7:28:03 PM
Error fetching reolink.Garden Cam data: Host 192.168.3.230:443: connection error: Cannot connect to host 192.168.3.230:443 ssl:default [Connect call failed ('192.168.3.230', 443)]
Logger: reolink_aio.api
Source: components/reolink/camera.py:151
First occurred: 7:28:22 PM (1 occurrences)
Last logged: 7:28:22 PM
Error while logging out: Host 192.168.3.230:443: connection error: Cannot connect to host 192.168.3.230:443 ssl:default [Connect call failed ('192.168.3.230', 443)]
Using the mobile app
Anyone can help?
I think this is because of the SSL certificate of the camera. I will look into this, but it may take some time before I figure this out since it has to do with code outside the reolink integration. (How the frontend loads the video).
The problem
I have a Reolink Duo 2 WiFi camera set up using official reolink integration's Media browser. I see a list of videos but when I try to play any of them I have an error in log. My camera is set up with rtsp:
What version of Home Assistant Core has the issue?
core-2024.2.2
What was the last working version of Home Assistant Core?
None?
What type of installation are you running?
Home Assistant OS
Integration causing the issue
Reolink
Link to integration documentation on our website
https://www.home-assistant.io/integrations/reolink/
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Additional information
No response