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

Can’t get livestream to work #499

Closed
freekeys opened this issue Nov 13, 2022 · 9 comments
Closed

Can’t get livestream to work #499

freekeys opened this issue Nov 13, 2022 · 9 comments
Labels
support Help needed solving a problem

Comments

@freekeys
Copy link

Describe the Bug

I get a timed out message when trying to set up the generic camera component

Steps to Reproduce

Activate add-on, copy RTSP link, install generic camera integration

Expected Behavior

Hoping to see stream

Log Output

2022-11-13T16:57:44.073Z ring-rtsp INF [RTSP] [conn 172.30.32.1:47210] opened
2022-11-13T16:57:44.076Z ring-rtsp INF [path 083a880abf67_live] runOnDemand command started
2022-11-13T16:57:44.085Z ring-rtsp [Front Door] Sending command to activate live stream ON-DEMAND
2022-11-13T16:57:44.099Z ring-mqtt [Front Door] Received set live stream state ON-DEMAND
2022-11-13T16:57:48.772Z ring-mqtt [Front Door] Successfully retrieved updated snapshot
2022-11-13T16:57:48.772Z ring-mqtt

Screenshots

No response

Config File

N/A

Install Type

Home Assistant Addon

Version

v5.0.5

Operating System

Home Assistant OS

Architecture

x86/64

Machine Details

Intel NUC

@freekeys freekeys added the bug Some code behavior is not as expected label Nov 13, 2022
@tsightler tsightler added support Help needed solving a problem and removed bug Some code behavior is not as expected labels Nov 13, 2022
@freekeys
Copy link
Author

Sorry, log output got truncated. See fuller logs below:

2022-11-13T17:37:22.519Z ring-rtsp INF [RTSP] [conn 172.30.32.1:60806] opened 2022-11-13T17:37:22.522Z ring-rtsp INF [path 083a880abf67_live] runOnDemand command started 2022-11-13T17:37:22.532Z ring-rtsp [Front Door] Sending command to activate live stream ON-DEMAND 2022-11-13T17:37:22.554Z ring-mqtt [Front Door] Received set live stream state ON-DEMAND 2022-11-13T17:37:32.524Z ring-rtsp INF [path 083a880abf67_live] runOnDemand command stopped 2022-11-13T17:37:32.524Z ring-rtsp INF [RTSP] [conn 172.30.32.1:60806] closed (source of path '083a880abf67_live' has timed out) 2022-11-13T17:37:32.525Z ring-rtsp [Front Door] Deactivating live stream due to signal from RTSP server (no more active clients or publisher ended stream) 2022-11-13T17:37:32.535Z ring-mqtt [Front Door] Received set live stream state OFF 2022-11-13T17:37:32.536Z ring-mqtt [Front Door] Stopping live stream session on workerId 1

@tsightler
Copy link
Owner

Please restart the addon as the logs above show that a stream was not even attempted to be started, which means the addon thinks a stream is already active. Also note that restarting HA via the UI does not restart the addon, which seems to be a common point of confusion for many users, you must explicitly restart the addon or reboot the system.

@tsightler
Copy link
Owner

Any feedback? After restarting the addon please test the stream again and provide logs from the first attempt.

@freekeys
Copy link
Author

freekeys commented Nov 15, 2022 via email

@tsightler
Copy link
Owner

Good to know. Still indicates that there's a corner case where the session state can get out of sync, so I need to figure that out, but I think I know where this is.

@freekeys
Copy link
Author

freekeys commented Nov 15, 2022 via email

@tsightler
Copy link
Owner

I'm not sure why the lag would be so high honestly. Ring-mqtt itself typically has <1 second of total latency, for example, I use to go2rtc addon so that I can get a native WebRTC camera view in HA easily and, if I watch my front porch camera in both the HA UI and the Ring native web app at the same time, the Ring app beats it by probably 2/10ths of a second, which I think is pretty good seeing that the Ring app is streaming natively from Ring servers to my web browser, while the HA has to go from Ring servers -> Javascript based WebRTC -> ffmpeg -> rtsp-simple-server -> go2rtc addon -> web browser WebRTC. And this is all just running on a RPi4b, so nothing special hardware wise.

When not using go2rtc, viewing the video in HA will add another 3-5 seconds because it uses HLS, but I would think that would be the worst. However, I have no idea how you are actually streaming to the Chromecast. I've heard that the best way to get low latency to the Chromecast is to transcode to MJPEG, but I've never done any of that stuff because I don't have that much use for it.

@AlexxIT
Copy link

AlexxIT commented Nov 16, 2022

Low latency streaming to Chromecast implemented here https://github.com/AlexxIT/WebRTC#cast-or-share-stream

Also you can use this https://stestagg.github.io/dashcast/ or https://github.com/AlexxIT/DashCast and stream webpage with WebRTC code. Example webpage from go2rtc.

Also you can use PIP AlexxIT/WebRTC#34
Some app versions support WebRTC, some MJPEG.

@freekeys
Copy link
Author

freekeys commented Nov 16, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support Help needed solving a problem
Projects
None yet
Development

No branches or pull requests

3 participants