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

Cannot connect to RTSP stream upgrading from 2.8.3 to 2.9.0 #1186

Open
xcellentavi opened this issue May 12, 2024 · 25 comments
Open

Cannot connect to RTSP stream upgrading from 2.8.3 to 2.9.0 #1186

xcellentavi opened this issue May 12, 2024 · 25 comments

Comments

@xcellentavi
Copy link

Describe the bug

Updated to 2.9.0, added the newer env variables in the new unRaid template (also added API settings and removed TOTP key), but all RTSP streams stopped working on my blueiris instance. Current network IP that works in all versions 2.8.3 and below is rtsp://[localip]:8554/camera-name with user and password set as default admin. Not sure what changed otherwise in the newest update, but I downgraded back to 2.8.3 for now.

WebUI does work on latest version, so it must simply be a setting issue in blueiris I am not able to figure out.

@mrlt8
Copy link
Owner

mrlt8 commented May 12, 2024

Authentication for the webUI and streams are on by default now, so you probably need to set the username and password for the stream.

The username for the stream is wb and the password should be unique API Key displayed at the bottom of your WebUI like this:

random key

You can change the API key by setting the WB_API ENV variable.

If you're running the bridge 100% local, then you can probably set WB_AUTH=False to disable authentication and run it like it was before.

Please see the release log for more info:
https://github.com/mrlt8/docker-wyze-bridge/releases/tag/v2.9.0

@xcellentavi
Copy link
Author

Authentication for the webUI and streams are on by default now, so you probably need to set the username and password for the stream.

The username for the stream is wb and the password should be unique API Key displayed at the bottom of your WebUI like this:

random key You can change the API key by setting the `WB_API` ENV variable.

If you're running the bridge 100% local, then you can probably set WB_AUTH=False to disable authentication and run it like it was before.

Please see the release log for more info: https://github.com/mrlt8/docker-wyze-bridge/releases/tag/v2.9.0

Got it, and thank you so much for the quick reply! Really appreciate all the hard work and help you have devoted to this project. My fault for not reading the release notes carefully enough. I will correct my settings, and it sounds like this will be a better setup with authentication moving forward.

@xcellentavi
Copy link
Author

@mrlt8 Upgraded back to 2.9.0, tried both with the WB_API key and then I tried WB_AUTH=False, but I am getting constant disconnects either way. The connections are more stable for me on 2.8.3, so I may just stick with that version and continue troubleshooting the client disconnects with other settings tweaking.

@mrlt8
Copy link
Owner

mrlt8 commented May 12, 2024

Hmm, anything in the logs when the disconnects happen?

@xcellentavi
Copy link
Author

Hmm, anything in the logs when the disconnects happen?

No errors, just some warnings about frame size and buffer:

WARNING: Skipping wrong frame_size at start of stream [frame_size=1]

WARNING: clear buffer

It repeats those warnings for each camera and does a "Client stopped reading [camera]" message followed by "New client reading from [camera]" one. Here's a sample (I renamed the cameras, but the number matches each of their message):

[CAMERA1] WARNING: clear buffer
[CAMERA2] WARNING: clear buffer
[CAMERA3] WARNING: clear buffer
[CAMERA4] WARNING: clear buffer
[CAMERA5] WARNING: clear buffer
[WyzeBridge] 📕 Client stopped reading from CAMERA4
[WyzeBridge] 📖 New client reading from CAMERA4
[CAMERA6] WARNING: clear buffer
[WyzeBridge] 📕 Client stopped reading from CAMERA4
[WyzeBridge] 📖 New client reading from CAMERA4
[WyzeBridge] 📕 Client stopped reading from CAMERA2
[WyzeBridge] 📖 New client reading from CAMERA2
[WyzeBridge] 📕 Client stopped reading from CAMERA4
[WyzeBridge] 📖 New client reading from CAMERA4
[CAMERA2] [CONTROL] ERROR - error='[-20021] AV_ER_SENDIOCTRL_ALREADY_CALLED', cmd='_bitrate'
[WyzeBridge] 📕 Client stopped reading from CAMERA2
[WyzeBridge] 📖 New client reading from CAMERA2
[WyzeBridge] 📕 Client stopped reading from CAMERA4
[WyzeBridge] 📖 New client reading from CAMERA4
[WyzeBridge] 📕 Client stopped reading from CAMERA1
[WyzeBridge] 📕 Client stopped reading from CAMERA5
[WyzeBridge] 📕 Client stopped reading from CAMERA3
[WyzeBridge] 📖 New client reading from CAMERA1
[WyzeBridge] 📖 New client reading from CAMERA5
[WyzeBridge] 📖 New client reading from CAMERA3
[CAMERA4] [CONTROL] ERROR - error='[-20029] AV_ER_CLEANBUF_ALREADY_CALLED', cmd='_bitrate'
[WyzeBridge] 📕 Client stopped reading from CAMERA4
[CAMERA4] WARNING: Audio pipe closed
[CAMERA4] Stream stopped
[WyzeBridge] ❌ '/CAMERA4' stream is down
[WyzeBridge] ❌ '/CAMERA4' stream is down
[WyzeBridge] 📕 Client stopped reading from CAMERA1
[WyzeBridge] 📕 Client stopped reading from CAMERA3

@hossvw
Copy link

hossvw commented May 13, 2024

Seeing similar here. Can't get RTSP to work after upgrading to 2.9.0

Rebroadcast Plugin]: rtsp outgoing message
[Rebroadcast Plugin]: DESCRIBE rtsp://xxx.local:8554/gate-camera RTSP/1.0
[Rebroadcast Plugin]: Accept: application/sdp
[Rebroadcast Plugin]: CSeq: 2
[Rebroadcast Plugin]: User-Agent: Scrypted
[Rebroadcast Plugin]: Authorization: Basic d2I6Y1JNdEN4eEo4bm1yUUE3eVJhR3Y2TWduVlRIeWxfaHNrdXJYZlRkQg==
[Rebroadcast Plugin]:
[HomeKit]: addresses {
[HomeKit]: sourceAddress: '192.168.0.202',
[HomeKit]: sourceVideoPort: 59947,
[HomeKit]: sourceAudioPort: 65321,
[HomeKit]: targetAddress: '192.168.0.165',
[HomeKit]: targetVidioPort: 50789,
[HomeKit]: targetAudioPort: 53595
[HomeKit]: }
[HomeKit]: handleStreamRequest {
[HomeKit]: sessionID: 'a29115f5-0d02-40e1-b277-66d9c7a53e13',
[HomeKit]: type: 'start',
[HomeKit]: video: {
[HomeKit]: codec: 0,
[HomeKit]: profile: 1,
[HomeKit]: level: 2,
[HomeKit]: packetizationMode: 0,
[HomeKit]: cvoId: undefined,
[HomeKit]: width: 1280,
[HomeKit]: height: 720,
[HomeKit]: fps: 30,
[HomeKit]: pt: 99,
[HomeKit]: ssrc: 636561199,
[HomeKit]: max_bit_rate: 299,
[HomeKit]: rtcp_interval: 0.5,
[HomeKit]: mtu: 1378
[HomeKit]: },
[HomeKit]: audio: {
[HomeKit]: codec: 'OPUS',
[HomeKit]: channel: 1,
[HomeKit]: bit_rate: 0,
[HomeKit]: sample_rate: 24,
[HomeKit]: packet_time: 20,
[HomeKit]: pt: 110,
[HomeKit]: ssrc: 3203342298,
[HomeKit]: max_bit_rate: 24,
[HomeKit]: rtcp_interval: 5,
[HomeKit]: comfort_pt: 13,
[HomeKit]: comfortNoiseEnabled: false
[HomeKit]: }
[HomeKit]: }
[HomeKit]: { isLowBandwidth: false, isWatch: false, destination: 'local' }
[Rebroadcast Plugin]: Selected stream Stream 1
[Rebroadcast Plugin]: rebroadcast error Error: timeout waiting for data, killing parser session
[Rebroadcast Plugin]: at /@scrypted/prebuffer-mixin/main.nodejs.js:1:69796
[Rebroadcast Plugin]: at Timeout. (/@scrypted/prebuffer-mixin/main.nodejs.js:1:69810)
[Rebroadcast Plugin]: at listOnTimeout (node:internal/timers:569:17)
[Rebroadcast Plugin]: at process.processTimers (node:internal/timers:512:7)
[Rebroadcast Plugin]: rtsp outgoing message
[Rebroadcast Plugin]: TEARDOWN rtsp://xxxlocal:8554/gate-camera RTSP/1.0
[Rebroadcast Plugin]: CSeq: 3
[Rebroadcast Plugin]: User-Agent: Scrypted
[Rebroadcast Plugin]: Authorization: Basic d2I6Y1JNdEN4eEo4bm1yUUE3eVJhR3Y2TWduVlRIeWxfaHNrdXJYZlRkQg==
[Rebroadcast Plugin]:
[Rebroadcast Plugin]: Gate Camera restarting prebuffer session in 5 seconds
[Rebroadcast Plugin]: Stream 1 prebuffer session ended with error r [Error]: Operation Timed Out
[Rebroadcast Plugin]: at Timeout._onTimeout (/@scrypted/prebuffer-mixin/main.nodejs.js:1:76155)
[Rebroadcast Plugin]: at listOnTimeout (node:internal/timers:569:17)
[Rebroadcast Plugin]: at process.processTimers (node:internal/timers:512:7) {
[Rebroadcast Plugin]: promise: Promise { }
[Rebroadcast Plugin]: }
[Rebroadcast Plugin]: Stream 1 prebuffer session started
[Rebroadcast Plugin]: Stream 1 prebuffer session starting
stream url rtsp://xxx.local:8554/gate-camera

@mrlt8
Copy link
Owner

mrlt8 commented May 13, 2024

Thank you. I'm looking into this.

@bpapa9013
Copy link

Authentication for the webUI and streams are on by default now, so you probably need to set the username and password for the stream.

The username for the stream is wb and the password should be unique API Key displayed at the bottom of your WebUI like this:

random key You can change the API key by setting the `WB_API` ENV variable.

If you're running the bridge 100% local, then you can probably set WB_AUTH=False to disable authentication and run it like it was before.

Please see the release log for more info: https://github.com/mrlt8/docker-wyze-bridge/releases/tag/v2.9.0

Thank you for the clarification! I'm also using BlueIris to record/motion sense/AI verification on my streams. I was initially confused as to which API key I needed to use to connect to the streams. Your comment on this thread makes it clear, but you might want to update the changelog and wiki to explicitly state that you need to use the WB API key provided in the WebUI, and not the Wyze API key provided in their user account management on their site. Just a suggestion, I figured it out pretty quick from looking at these issue threads, but might save some other users some time if you made that more explicit in the changelog and wiki.

But thanks a ton for your work on this project, it works very well for me and I would have probably spent 2-3x more on non-Wyze cams to serve my needs if not for this software being available.

mrlt8 added a commit that referenced this issue May 16, 2024
mrlt8 added a commit that referenced this issue May 17, 2024
* Tweak AV sync and ffmpeg cmd #1175 #1196 #1194 #1193 #1186

* Catch AccessTokenError

* don't drop timestamp #1175 #1196 #1194 #1193 #1186

* Don't use_wallclock_as_timestamps  #1175 #1196 #1194 #1193 #1186

* keep audio in sync #1175 #1196 #1194 #1193 #1186

* Ignore whitespaces in api key/id #1188

* Remove quotes from credentials #1158

* HA Add FORCE_FPS option #1161

* FORCE_FPS option for all cameras #1161

* changelog
@xcellentavi
Copy link
Author

@mrlt8 v.2.9.2 is working a lot better, but I am running into the same disconnects and errors as mentioned in #1218 I will test out your suggestions in that issue, but this is already getting better with all your hard work, thank you!

@xcellentavi
Copy link
Author

Added the environmental variables ON_DEMAND=False to my unraid template and upgraded to v.2.9.3 released a little while ago, but I am still getting the following disconnects and errors (renamed cameras and not showing IP address but everything matches otherwise):

[CAMERA2] WARNING: clear buffer
[WyzeBridge] 🎉 Connecting to WyzeCam Pan V3 - CAMERA3 on (LOCAL_IP_ADDRESS)
[CAMERA2] WARNING: Audio pipe closed
[CAMERA2] FFMPEG stopped
[CAMERA3] 📡 Getting 180kb/s HD stream (H264/15fps) via LAN mode (WiFi: 70%) FW: 4.50.4.9222 🔒
[WyzeBridge] 🎉 Connecting to WyzeCam Pan V3 - CAMERA2 on (LOCAL_IP_ADDRESS)
[CAMERA3] 🔊 Audio Enabled - ALAW/16,000Hz
[WyzeBridge] ✅ '/CAMERA3 stream is UP! (3/3)
[CAMERA2] 📡 Getting 200kb/s HD stream (H264/20fps) via LAN mode (WiFi: 59%) FW: 4.50.4.9222 🔒
[CAMERA2] [Exception] Unable to identify audio.
[WyzeBridge] 🎉 Connecting to WyzeCam Pan V3 - CAMERA2 on (LOCAL_IP_ADDRESS)
[WyzeBridge] 📖 New client reading from CAMERA3
[CAMERA3] WARNING: Audio pipe closed
[CAMERA3] Stream stopped
[WyzeBridge] ❌ '/CAMERA3' stream is down
[WyzeBridge] 📕 Client stopped reading from CAMERA3
[WyzeBridge] 🎉 Connecting to WyzeCam Pan V3 - CAMERA3 on (LOCAL_IP_ADDRESS)
[WyzeBridge] ❌ '/CAMERA3' stream is down
[WyzeBridge] 🎉 Connecting to WyzeCam Pan V3 - CAMERA3 on (LOCAL_IP_ADDRESS)
[CAMERA3] 📡 Getting 180kb/s HD stream (H264/15fps) via LAN mode (WiFi: 70%) FW: 4.50.4.9222 🔒
[CAMERA3] 🔊 Audio Enabled - ALAW/16,000Hz
[CAMERA3] WARNING: Skipping wrong frame_size at start of stream [frame_size=1]
[WyzeBridge] ✅ '/CAMERA3 stream is UP! (3/3)
[CAMERA2] [-13] IOTC_ER_TIMEOUT
[WyzeBridge] 🎉 Connecting to WyzeCam Pan V3 - CAMERA2 on (LOCAL_IP_ADDRESS)
[CAMERA4] [video] super slow
[CAMERA4] WARNING: clear buffer
[WyzeBridge] 📕 Client stopped reading from CAMERA4
[WyzeBridge] 📖 New client reading from CAMERA4
[CAMERA2] 📡 Getting 200kb/s HD stream (H264/20fps) via LAN mode (WiFi: 59%) FW: 4.50.4.9222 🔒
[WyzeBridge] 📖 New client reading from CAMERA3
[CAMERA2] [Exception] Unable to identify audio.
[WyzeBridge] 🎉 Connecting to WyzeCam Pan V3 - CAMERA2 on (LOCAL_IP_ADDRESS)
[CAMERA4] WARNING: Audio pipe closed
[CAMERA4] [-20021] AV_ER_SENDIOCTRL_ALREADY_CALLED

Let me know if other details are needed to troubleshoot, thank you!

@mrlt8
Copy link
Owner

mrlt8 commented May 22, 2024

@xcellentavi is the connection more stable if you disable audio?

@xcellentavi
Copy link
Author

@mrlt8 I just set ENABLE_AUDIO=False instead of deleting it for now, but still getting [CONTROL] ERROR - error='[-20018] AV_ER_CLIENT_EXIT', cmd='_bitrate' on 2 of my cameras, also the [-13] IOTC_ER_TIMEOUT and [-20021] AV_ER_SENDIOCTRL_ALREADY_CALLED warning messages.

mrlt8 added a commit that referenced this issue May 25, 2024
@mrlt8
Copy link
Owner

mrlt8 commented May 25, 2024

@xcellentavi could you try the edge builds to see if that helps reduce some of those errors?

@xcellentavi
Copy link
Author

@mrlt8 I Just installed edge build, but I am still getting the following errors and warnings throughout:

[CONTROL] ERROR - error='[-20018] AV_ER_CLIENT_EXIT', cmd='_bitrate'
[-13] IOTC_ER_TIMEOUT
[Exception] Unable to identify audio.
[-20011] AV_ER_TIMEOUT
FFMPEG stopped
WARNING: Audio pipe closed
WARNING: Skipping wrong frame_size at start of stream [frame_size=1]

Let me know if other details and information would be helpful from the logs.

Thank you!

@mrlt8
Copy link
Owner

mrlt8 commented May 29, 2024

Could you try the latest edge build? Could you also see if setting ON_DEMAND=false helps?

@xcellentavi
Copy link
Author

@mrlt8 just tried the latest edge build from 14 hours ago, still getting the same group of errors. ON_DEMAND=false was already in my unraid template.

It seems to be struggling with just 2 of my cameras, the WyzCam V3 and the WyzeCam Pan V3. The good news is the error messages are popping up less and less, I watched the logs for a few minutes and only got one of these errors:

[CONTROL] ERROR - error='[-20010] AV_ER_INVALID_SID', cmd='_bitrate'

The rest were a bunch of these warnings:

WARNING: Skipping wrong frame_size at start of stream [frame_size=1]
WARNING: Audio pipe closed
WARNING: clear buffer
FFMPEG stopped
[Exception] Unable to identify audio.

I'm optimistic that this is improving with each build, but let me know if there are other settings I should be adjusting.

Thank you!

@xcellentavi
Copy link
Author

Checked the logs this morning, and just seeing the following message scrolling every 20 seconds or so:

Connection closed because of no response from remote.

Only the 2 cameras with errors and warnings are not working; all the other Wyze cameras are still streaming. I can't figure out what could cause this. The wifi signal is as strong as the other cameras, and everything is running smoothly in the wyze app. All firmware is up to date, so I don't know what else I could troubleshoot to help pinpoint the problem...

@mrlt8
Copy link
Owner

mrlt8 commented May 30, 2024

Can you try rebooting the problematic cameras? The latest firmware also super buggy and seems to kick off multiple connections if you open the app.

@xcellentavi
Copy link
Author

Restarted the cameras from the wyze app and then closed it immediately, restarted the container, streams came back up but still errors and warnings as before. I do have more than one of each model giving me an issue, so I don't think it's the firmware (I could be wrong) and a 3rd camera is giving me these messages:

[video] super slow
WARNING: clear buffer
[video] super slow

@mrlt8
Copy link
Owner

mrlt8 commented May 30, 2024

You should be able to ignore those warnings if the streams are working.

Most of those are related to the av sync. If you don't need audio, you can disable it and most of these issues should go away.

@xcellentavi
Copy link
Author

I see another edge build from 25 minutes ago, I updated to that one (not sure what edge-qsv and edge-hw are for so I only select the edge one). I set ENABLE_AUDIO=false and it's still producing errors and warnings:

[-20021] AV_ER_SENDIOCTRL_ALREADY_CALLED
[video] super slow
[-20011] AV_ER_TIMEOUT
[CONTROL] ERROR - error='[-20018] AV_ER_CLIENT_EXIT', cmd='_bitrate'
[-13] IOTC_ER_TIMEOUT

I have 6 streams, so I'm not sure if that is making this difficult to work or if I should adjust any other settings.

@xcellentavi
Copy link
Author

You should be able to ignore those warnings if the streams are working.

Most of those are related to the av sync. If you don't need audio, you can disable it and most of these issues should go away.

Yea, the errors wouldn't bother me if the streams were working, but they are down in the logs and I was hoping they would help figure out a solution. I understand if this is just not going to be fixed, but still appreciate the attention you put into trying to help with this!

@mrlt8
Copy link
Owner

mrlt8 commented May 30, 2024

Does downgrading back to 2.8.3 resolve the issues?

@xcellentavi
Copy link
Author

It's not 100% when I switch back to 2.8.3, but all the streams do work, and then 1 of the cameras stops and starts with no signal on blue iris. So it's better on 2.8.3 for me, but I'm still seeing the [-13] IOTC_ER_TIMEOUT and dropped stream for 1 of the v3 cameras.

@mrlt8
Copy link
Owner

mrlt8 commented May 31, 2024

Thanks, I'll try to see if there were any changes that might be causing the issue from 2.8.3.

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

No branches or pull requests

4 participants