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

RTSP Relay Tearing down connections frequently #81

Closed
AlpineWhite opened this issue Sep 11, 2020 · 9 comments
Closed

RTSP Relay Tearing down connections frequently #81

AlpineWhite opened this issue Sep 11, 2020 · 9 comments
Labels
bug Something isn't working

Comments

@AlpineWhite
Copy link

AlpineWhite commented Sep 11, 2020

Which version are you using?

v0.9.13

Describe the problem

In relay mode, server returns unhandled exception GET_PARAMETER and the rtsp connection is torn down and rebuilt on what appears to be another port.

[1/0/0] [client 10.10.40.15:50666] is receiving on path 'proxied', 1 track via tcp
[1/0/1] [client 10.10.40.15:50666] GET_PARAMETER
[1/0/1] [client 10.10.40.15:50666] ERR: unhandled method 'GET_PARAMETER'
[0/0/0] [client 10.10.40.15:50666] disconnected
[1/0/0] [client 10.10.40.15:50667] connected
[1/0/0] [client 10.10.40.15:50667] DESCRIBE
[1/0/0] [client 10.10.40.15:50667] SETUP
[1/0/0] [client 10.10.40.15:50667] PLAY
[1/0/0] [client 10.10.40.15:50667] is receiving on path 'proxied', 1 track via tcp
[1/0/1] [client 10.10.40.15:50667] GET_PARAMETER
[1/0/1] [client 10.10.40.15:50667] ERR: unhandled method 'GET_PARAMETER'
[0/0/0] [client 10.10.40.15:50667] disconnected
[1/0/0] [client 10.10.40.15:50668] connected
[1/0/0] [client 10.10.40.15:50668] DESCRIBE
[1/0/0] [client 10.10.40.15:50668] SETUP
[1/0/0] [client 10.10.40.15:50668] PLAY
[1/0/0] [client 10.10.40.15:50668] is receiving on path 'proxied', 1 track via tcp
[1/0/1] [client 10.10.40.15:50668] GET_PARAMETER
[1/0/1] [client 10.10.40.15:50668] ERR: unhandled method 'GET_PARAMETER'
[0/0/0] [client 10.10.40.15:50668] disconnected
[1/0/0] [client 10.10.40.15:50669] connected
[1/0/0] [client 10.10.40.15:50669] DESCRIBE
[1/0/0] [client 10.10.40.15:50669] SETUP
[1/0/0] [client 10.10.40.15:50669] PLAY
[1/0/0] [client 10.10.40.15:50669] is receiving on path 'proxied', 1 track via tcp
[1/0/1] [client 10.10.40.15:50669] GET_PARAMETER
[1/0/1] [client 10.10.40.15:50669] ERR: unhandled method 'GET_PARAMETER'
[0/0/0] [client 10.10.40.15:50669] disconnected
[1/0/0] [client 10.10.40.15:50670] connected
[1/0/0] [client 10.10.40.15:50670] DESCRIBE
[1/0/0] [client 10.10.40.15:50670] SETUP
[1/0/0] [client 10.10.40.15:50670] PLAY
[1/0/0] [client 10.10.40.15:50671] is receiving on path 'proxied', 1 track via tcp
[1/0/1] [client 10.10.40.15:50671] GET_PARAMETER
[1/0/1] [client 10.10.40.15:50671] ERR: unhandled method 'GET_PARAMETER'
[0/0/0] [client 10.10.40.15:50671] disconnected
[1/0/0] [client 10.10.40.15:50672] connected
[1/0/0] [client 10.10.40.15:50672] DESCRIBE
[1/0/0] [client 10.10.40.15:50672] SETUP

Issue is observed when running WyzeCam v2 on Dafang firmware hacks (as well as standard FW) with Blue Iris, Xprotect Exxentials, and Shinobi. Server is on dedicated Ubuntu server VM 2/2 VCPU 4096 RAM and the NVR is run on a different VM with 4/4 VCPU and 8192 RAM.

When the connection is torn down, the web API for the camera has no break in output.

All cameras set for VBR 2500kb/s bitrate, no motion detect, no audio, no MJPEG, only H264 RTSP.

@aler9
Copy link
Member

aler9 commented Sep 12, 2020

Hello, this can be fixed quickly, but i need a network dump.

The most helpful content you can provide to fix a communication issue between rtsp-simple-server and an external hardware or software, is a dump of the data exchanged between the server and the target (network dump), that can be generated in this way:

  1. Download wireshark (https://www.wireshark.org/)
  2. Start capturing on the interface used for exchanging RTSP (if the server and the target software are both installed on your pc, the interface is probably "loopback", otherwise it's the one of your network card)
  3. Start the server and replicate the issue
  4. Stop capturing, save the result in .pcap format
  5. Attach

@aler9 aler9 added the bug Something isn't working label Sep 12, 2020
@AlpineWhite
Copy link
Author

Sorry it took a hot minute, Has to learn some more CLI. Please find the attached pcap. YOu can see the teardown at 17.817 in the 'time' column.

captured.zip

@aler9
Copy link
Member

aler9 commented Sep 13, 2020

Hello, this bug should have been fixed, please try the attached nightly release and let me know if it works:

(removed)

@AlpineWhite
Copy link
Author

Definitely a marked improvement. Probably about 5-7x better. I do still see drops over 3-10 seconds about every 5 minutes. pcap attached. The log file looks slightly different, but mostly that it would appear to be hitting hard with GET_PARAMETER requests. I have since added 50% more cores to both the relay host and NVR (4 and 6 respectively) but still seeing this:

``
[3/0/3] [client 10.10.40.15:49816] GET_PARAMETER
[3/0/3] [client 10.10.40.15:49816] GET_PARAMETER
[3/0/3] [client 10.10.40.15:49816] TEARDOWN
[2/0/2] [client 10.10.40.15:49816] disconnected
[3/0/2] [client 10.10.40.15:49819] connected
[3/0/2] [client 10.10.40.15:49819] OPTIONS
[3/0/2] [client 10.10.40.15:49819] DESCRIBE
[3/0/2] [client 10.10.40.15:49819] SETUP
[3/0/2] [client 10.10.40.15:49819] PLAY
[3/0/2] [client 10.10.40.15:49819] is receiving on path 'proxied1', 1 track via tcp
[3/0/3] [client 10.10.40.15:49819] GET_PARAMETER
[3/0/3] [client 10.10.40.15:49819] GET_PARAMETER
[3/0/3] [client 10.10.40.15:49819] GET_PARAMETER
[3/0/3] [client 10.10.40.15:49819] GET_PARAMETER
[3/0/3] [client 10.10.40.15:49819] GET_PARAMETER
[3/0/3] [client 10.10.40.15:49819] GET_PARAMETER
[3/0/3] [client 10.10.40.15:49819] GET_PARAMETER
[3/0/3] [client 10.10.40.15:49819] GET_PARAMETER
[3/0/3] [client 10.10.40.15:49819] GET_PARAMETER
[3/0/3] [client 10.10.40.15:49819] GET_PARAMETER
[3/0/3] [client 10.10.40.15:49819] TEARDOWN
[2/0/2] [client 10.10.40.15:49819] disconnected
[3/0/2] [client 10.10.40.15:49820] connected
[3/0/2] [client 10.10.40.15:49820] OPTIONS
[3/0/2] [client 10.10.40.15:49820] DESCRIBE
[3/0/2] [client 10.10.40.15:49820] SETUP
[3/0/2] [client 10.10.40.15:49820] PLAY
[3/0/2] [client 10.10.40.15:49820] is receiving on path 'proxied1', 1 track via tcp
[3/0/3] [client 10.10.40.15:49820] GET_PARAMETER
[3/0/3] [client 10.10.40.15:49820] GET_PARAMETER
[3/0/3] [client 10.10.40.15:49820] GET_PARAMETER
[3/0/3] [client 10.10.40.15:49820] GET_PARAMETER
[3/0/3] [client 10.10.40.15:49820] TEARDOWN
[2/0/2] [client 10.10.40.15:49820] disconnected
[3/0/2] [client 10.10.40.15:49825] connected
[3/0/2] [client 10.10.40.15:49825] OPTIONS
[3/0/2] [client 10.10.40.15:49825] DESCRIBE
[3/0/2] [client 10.10.40.15:49825] SETUP
[3/0/2] [client 10.10.40.15:49825] PLAY
[3/0/2] [client 10.10.40.15:49825] is receiving on path 'proxied1', 1 track via tcp
[3/0/3] [client 10.10.40.15:49825] GET_PARAMETER
[3/0/3] [client 10.10.40.15:49825] GET_PARAMETER
[3/0/3] [client 10.10.40.15:49825] GET_PARAMETER
[3/0/3] [client 10.10.40.15:49825] GET_PARAMETER

CutDownPCAP.zip

@aler9
Copy link
Member

aler9 commented Sep 14, 2020

Hello,
Your pcap file does not contain any of the GET_PARAMETER or TEARDOWN requests; try capturing the entire sequence. If the file is too big, try filtering out the RTP packets (capture only on the port 8554).

Anyway, i think it's correct that your camera periodically queries the server with GET_PARAMETER requests, they're used like ping requests (even if your camera is the first one i've seen that does it), we just have to find out the reason of the TEARDOWN.

@AlpineWhite
Copy link
Author

I think I got the necessary information. Sorry it took a while. Work has been insane.
captured2.zip

@aler9
Copy link
Member

aler9 commented Nov 8, 2020

Hello, a lot has changed since the above post - in my opinion the latest version may solve this problem.
Please try again with the latest version.
The dump is not necessary anymore since it's not a protocol issue, but a timeout issue - the log is more useful. Thanks.

@aler9
Copy link
Member

aler9 commented Feb 21, 2021

This is probably fixed so i'm closing the issue.

@aler9 aler9 closed this as completed Feb 21, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Jan 1, 2023

This issue is being locked automatically because it has been closed for more than 6 months.
Please open a new issue in case you encounter a similar problem.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants