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

v0.23.0 drops with Reolink RLC-520A #1812

Closed
1 of 13 tasks
blu006 opened this issue May 17, 2023 · 17 comments
Closed
1 of 13 tasks

v0.23.0 drops with Reolink RLC-520A #1812

blu006 opened this issue May 17, 2023 · 17 comments
Labels
bug Something isn't working rtsp

Comments

@blu006
Copy link

blu006 commented May 17, 2023

Which version are you using?

v0.23.0

Which operating system are you using?

  • Linux amd64 standard
  • Linux amd64 Docker
  • Linux arm64 standard
  • Linux arm64 Docker
  • Linux arm7 standard
  • Linux arm7 Docker
  • Linux arm6 standard
  • Linux arm6 Docker
  • Windows amd64 standard
  • Windows amd64 Docker (WSL backend)
  • macOS amd64 standard
  • macOS amd64 Docker
  • Other (please describe)

Describe the issue

v0.23.0 drops connection with the camera with the message [rtsp source] ERR: TCP timeout.

The previous version, v0.22.2 works as expected.

Describe how to replicate the issue

  1. start the server
  2. read the camera with RTSP

Did you attach the server logs?

no

Did you attach a network dump?

no

Future Server Log and Network Dumps

I can provide a side-by-side comparison complete with configuration files, logs, and network dumps in the near future

@blu006
Copy link
Author

blu006 commented May 17, 2023

Screenshot of information from the camera in question
image

@Tokolosh
Copy link

exactly the same is happening with a hanwha techwin xnf-8010rv on rtsp

@0ip
Copy link

0ip commented May 17, 2023

With v0.23.0, streaming from my RLC-520A (RTSP) via WebRTC/WHEP stops as well after about a minute. I'm receiving the same error message as @blu006.
Another camera I own, a TP-Link Tapo C200, suffers the same fate, but occasionally there is an error message like ERR: EOF, or none at all.

@aler9
Copy link
Member

aler9 commented May 17, 2023

Until now no one provided any useful data that allows to replicate the issue, and without that it's impossible to identify the bug.

Please provide a network dump of communication exclusively between the server and the camera and a server log with log level set to debug.

@aler9 aler9 added bug Something isn't working rtsp labels May 18, 2023
@Tokolosh
Copy link

Tokolosh commented May 18, 2023

This is a debug log i was able to do on a testing machine with a local network camera - IP and Ports obfuscated with IP:PORT.
with v22.2 everything is working fine
mediamtx-v23-error.txt

@aler9
Copy link
Member

aler9 commented May 18, 2023

@Tokolosh there are no issues in the log you posted, with the exception of the warning "N RTP packets lost" that was added in v0.23.0 to warn about insufficient bandwidth but doesn't cause a stream to get dropped.

@Tokolosh
Copy link

@aler9 V22.2 works flawlessly and there are no bandwidth issues (during test only the test pc and a single ptz camera were on a seperate gigabit switch - camera feed is 16mbit)
V23 always disconnects with the mentioned error (RTP packets lost) but V22.2 does not drop at all on the exact same setup.
so something must have changed between versions

@aler9
Copy link
Member

aler9 commented May 18, 2023

@Tokolosh my aim is to find the error exactly as you, i just wanted to say that the error "RTP packets lost" is not an error but is a warning message that doesn't cause a stream to be dropped. It was added to to detect insufficient bandwidth. Errors that cause the stream to be dropped are the mentioned ERR: TCP timeout or ERR: EOF

@aler9
Copy link
Member

aler9 commented May 19, 2023

I checked the log of the underlying RTSP library (gortsplib) and the only major difference i could found between v0.23.0 and v0.22.2 is the one introduced with bluenviron/gortsplib#265 . I reverted the change and compiled a nightly release, that is attached here. Please test it and let me know whether it solves the issue.

[link removed]

@blu006
Copy link
Author

blu006 commented May 19, 2023

Thanks for the nightly build! I tried with the nightly build that @aler9 made, and it still has the same issue with the same ERR: TCP timeout. Weird.

Anyway, I know I still need to provide a debug log along with a wireshark dump.

@Tokolosh
Copy link

Thanks for the nightly build! I tried with the nightly build that @aler9 made, and it still has the same issue with the same ERR: TCP timeout. Weird.

Anyway, I know I still need to provide a debug log along with a wireshark dump.

i'm getting the same as well. However i am also checking up on my connecting clients (restreamer/vlc/etc) to see if the problem could be on that end. I'll be back once i have more details.

@Tokolosh
Copy link

V23.1 seems stable with VLC (tested for 1 hour with no drops) - latest datarhei restreamer however is having issues (still testing things though)

@mrgard
Copy link

mrgard commented May 20, 2023

Fault seems to be that keep-alive to IP-camera is not being sent (e.g. missing GET_PARAMETER sent to IP-camera), and then after timeout the IP-camera will close the connection.

Compared old and new code in client.go in gortsplib, seems to be a new calculation method for timeout.
Reinserted old calc method, recompiled, then it works fine!

//New calc method in v0.23 - fails:
//c.keepalivePeriod = time.Duration(((*sx.Timeout)*10)/8) * time.Second

//Old method used earlier - works:
c.keepalivePeriod = time.Duration(float64(*sx.Timeout)*0.8) * time.Second

Thanx @aler9 for a very good toolkit, keep up the good work!

@aler9
Copy link
Member

aler9 commented May 20, 2023

@mrgard thanks for debugging the issue, the point of that code was avoiding float64 computations after a user reported wrong results on ARM32 architectures, but I inverted numerator and denominator. I'll release a new version ASAP.

aler9 added a commit to bluenviron/gortsplib that referenced this issue May 20, 2023
this fixes a regression introduced with #277
aler9 added a commit to bluenviron/gortsplib that referenced this issue May 20, 2023
@aler9
Copy link
Member

aler9 commented May 20, 2023

fixed in v0.23.2.

@aler9 aler9 closed this as completed May 20, 2023
@0ip
Copy link

0ip commented May 20, 2023

Thank you @mrgard and @aler9

Copy link
Contributor

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 Nov 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working rtsp
Projects
None yet
Development

No branches or pull requests

5 participants