-
Notifications
You must be signed in to change notification settings - Fork 562
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
Stream Freezes and Skips Randomly on Home Assistant Companion App #35
Comments
You can share your camera stream with me, so I can check it with debugger. You can do it using Ngrok tunnel as example. |
Sure! Thanks @AlexxIT. Can you quickly let me know how I can test the stream externally? I have the ngrok client installed on home assistant from https://github.com/dy1io/hassio-addons. I added the ngrok.yaml and updated my go2rtc.yaml to point to the config (per your docs). I opened up the WebRTC and API port on my firewall, but I'm not sure how to test if I can connect externally. Edit: I get an error in the go2rtc logs saying I'm limited to one connection ERR_NGROK_108. I think this is because I was having the client from the add-on and go2rtc try to make a connection. I removed the api key from the add-on while keeping it only in the ngrok.yaml file so go2rtc can use it. I still can't figure out how to test the stream externally. Can I have a friend try to hit the stream somehow with VLC? |
https://github.com/AlexxIT/go2rtc/wiki/Tunnel-RTSP-camera-to-Intenet You can send link to contacts from my github page |
@AlexxIT I sent you a friend request on Discord unless you prefer Telegram (which I've never used) |
Leaving a final note. Thanks to @AlexxIT for the troubleshooting help. This was due to 2 issues.
|
After I switched to the direct RTSP feeds from my cameras and not the Frigate RTMP feeds, I am not seeing any freezing issues either. |
@AlexxIT this issue started happening again on the newer versions of the app. @rogerquake are you running into this as well running the newest version? |
Yeah, my streams have frozen twice on the latest release. |
Well. Beta9 has this problem, but Beta8 doesn't? |
I don't think it's any different honestly. Beta8 froze also, so don't think Beta9 is any worse. |
Well. Which version was definitely OK? |
Beta5 was my last confirmed working version for me. I unfortunately don't have a backup of that version but I just tested Beta6 and get the same freezing issue. There were also updated with the home assistant mobile app since that time. |
You can load previous releases in the releases section. https://github.com/AlexxIT/go2rtc/releases/tag/v0.1-beta.5 |
If you put any go2rtc binary to Hass config folder - it will be used by the add-on. Don't forget to set chmod +x |
I just tried this and it's still showing beta9 in the UI. I have |
Binary should be named just go2rtc. Version in the UI won't change. |
Thanks @AlexxIT. I just confirmed that with beta5 I don't have any issues at all, but every version after that my stream freezes and jumps 10+ seconds at a time. I tested with 6-9 |
I need to access your stream again. |
I'm seeing this with my streams while viewing webRTC in the browser. At least in my case it seems only the video stutters. I can hear up to date audio even when the frame for video is frozen. |
It's important to provide full info about source of your stream. Technology, transcoding, brands. |
I've seen this on my amcrest ad410 which is h.264 / pcma. This one uses the direct rtsp link from the camera I've also seen this on my reolink 511-WA using their http:// link with ffmpeg: preset. The stream is native h.264 and aac and I am using |
I realized maybe this is more of a client issue? Watching with webrtc on my windows or mac desktop in chrome the stream does not skip at all. However, watching in chrome on my android does see the stuttering quite often. Watching in chrome on my iPhone does not see the suttering. |
If you read my original issue it's the same for me. I have 0 issues on desktop in any browser (Chrome, Firefox, Safari) and OS (Windows, OSX, Ubuntu). My issue only happens on mobile (I'm using the HA Companion App) |
Okay thanks, glad we're seeing the same thing. I wonder if there's some chrome flag or other thing that could improve it on Android. My phone has a Snapdragon 8+ Gen 1 so I don't think it's a performance issue. |
@NickM-27 can you check SDP for both cameras? You can increase log level to
|
Also if you have a minute do you mind trying to see if beta5 gives you the same issues on mobile? That version gives me no problems. @AlexxIT today my stream was freezing again on beta9 but works fine on beta5. |
Amcrest AD410: Reolink 511-WA: |
@thinkjk I just tried beta 5 and I see the stuttering there as well. |
@thinkjk try beta.10 |
Thank you, it's much better than before! But I now see this weird issue where it shows the first frame of the video but takes 10-30+ seconds before it actually starts showing the live feed. It takes longer externally than internally. I currently have this in my go2rtc.yaml. Is there something else I should be changing for better connection?
|
Your camera sends very very rare keyframe. You can start watch stream only from keyframe. I think sometimes connection take time longer than first keyframe and you just miss it. In the future I can cache it and send again. But now have other tasks to do. |
Thanks again @AlexxIT! Do you want me to submit an enhancement issue for that? Otherwise I'll close this issue :) |
If Stream Freezes and Skips Randomly fixed - you may close this issue and open new about caching keyframe. |
I appear to have the same issue specifcally on mobile(iOS). |
@brendann993 what camera model do you use? This is direct RTSP or ffmpeg? |
@AlexxIT do you want me to close this issue or keep it open so other people can post similar problems in? What would be easier for you to keep track of? |
@AlexxIT Its a generic Swann/Raysharp 1080p IP camera. Direct RTSP stream, Ill try with a few other IP cameras I have and some generic RTSP streams to see if its specific to Camera or not |
Just tested with a online RTSP test stream rtsp://wowzaec2demo.streamlock.net:554/vod/mp4:BigBuckBunny_115k.mp4 |
@brendann993 thanks for good example of a very bad stream. Your link is not a real stream. Which sends packets in irregular groups. Look carefully at: the time of the log, the time stamp in the frame and the sequence number of the frame. I don't know if it's worth fixing. Because a camera like this is just garbage. You can create a separate issue about this problem if you want. @thinkjk you can close this issue. Other people can continue the discussion either in a closed issue or open a new one.
|
This a example of the freezing experience. Top feed is the WebRTC card, bottom is the Picture Entity card streaming via go2rtc. Same experience in the app and browser on iOS. |
Just to wrap this one all up, I just confirmed the issue definetly comes from the camera. |
What relay are you using? |
https://github.com/aler9/rtsp-simple-server My other camera with stream limitations is also terrable so that steam runs through ffmpeg first to just drop any corrupt packs and then the output is restreamed. |
@brendann993 maybe your stream has some other problems. Not like in Bunny stream. You can share your stream with me. I'll check what I can do. |
I wanted to leave a final comment on this issue. There was a new firmware released at the end of 2022 for my cameras that have totally fixed this issue. If you're running into the same issue please update your camera firmware. |
I had the same problem with new Hikvision cameras. The RTC stream using the "custom:webrtc-camera" worked well on laptop browser, smartphone, but not on my Android tablet. For the first few seconds, while it was MSE, it worked fine. Skipping and freezing started after the stream changed to RTC. My solution is to add "mode: mse" line to the yaml configuration of the card. Now it works well on all devices (there is 1-2 second lag of the video, but still better than freezing video). |
On my local network on the Android and iOS home assistant companion app my stream freezes after a few seconds and I can’t get it to unfreeze without navigating away on the app. Sometimes it’ll freeze, then jump forward a bunch of seconds and freeze again. It works perfectly in my browser.
It only happens with WebRTC. RTMP, RTSP, and JSMpeg play without any issues.
Here’s my current config:
Camera → RTSP → Frigate → RTMP → Home Assistant. I have RTSPtoWebRTC pointing to go2rtc. My go2rtc.yaml is empty. I see the RTMP stream added automatically in the go2rtc UI when I start a stream.
I see the freezing issue with the Frigate Lovelace Card as well as the Picture Glace card.
Troubleshooting I’ve done:
If I remove go2rtc and RTSPtoWebRTC and add a generic camera with a direct RTSP from the camera it does not freeze.
If I add the RTMP stream from Frigate the stream does no freeze.
I tried using your older WebRTC plugin only and I get the same issue, stream freezes when it flips to WebRTC (I know it’s webrtc because I’ve verified in developer tools and the icon flipped to webrtc in the corner)
Additional testing. I have 3 types of Amcrest cameras and it seems like the issue is mainly happening on one model the ip4m-1051. Is there anything I can do to troubleshoot or resolve the issue?
Thanks.
The text was updated successfully, but these errors were encountered: