mediamtx icon indicating copy to clipboard operation
mediamtx copied to clipboard

RTSP server disconnects clients sessions (VLC)

Open RobotnickIsrael opened this issue 2 years ago • 1 comments

Which version are you using?

v20.0.1

Which operating system are you using?

Linux centOS

Describe the issue

VLC client gets disconnected after 60 seconds. RTSP Simple server logs writes the session is being closed because of no data from client. From what I read, some VLC clients only send every 70 seconds a message, and I guess rtsp simple server expects a message after 60 seconds. Ususally I get: "session destroyed, no RTSP requests received in a while". One time I also got "conn closed (path SETUP request must end with a slash. This typically happens when VLC fails a request and switches to an unsupported RTSP dialect" ... INF [RTSP] (destroyed not in use) ... closed (session not found)

*This does not happen if I use gstreamer as a client, only if I use the VLC (3.0.8) I have on my local antifactory.

Is there a way to increase the timeout to wait for these keepalive messages? Couldn't find it on the configuration file.

Describe how to replicate the issue

  1. start the server
  2. publish with some address to rtsp simple server
  3. read with VLC 3.0.8

Did you attach the server logs?

No, but wrote the important messages above.

Did you attach a network dump?

No. There is no network problem, as I said this doesnt happen when gstreamer is the client so Im guessing it's the keepalive time. Since there are good chances user will use older VLC and its impossible to update all VLC's, I would rather find a server side solution like increasing timeout time.

RobotnickIsrael avatar Oct 30 '22 09:10 RobotnickIsrael

Hello @RobotnickIsrael , the timeout (and consequently the interval between GET_PARAMETER requests) is dictated by the server to the client through the Session header:

RTSP/1.0 200
Session: 123456;timeout=60

VLC respects this parameter, therefore something else is happening. Keep in mind VLC binaries shipped in some recent distributions don't have RTSP support anymore due to licensing issues.

Therefore, please post:

  1. the OS version
  2. server logs of communications between rtsp-simple-server and VLC, with logLevel: debug

aler9 avatar Nov 03 '22 09:11 aler9

I'm seeing the same issue. In the below instance, my rtsp stream was playing in VLC for 15-minutes, then terminated. From the rtsp-simple-server log, it looks like there was a valid keepalive handshake, then 20-seconds later comes the timeout. Here are the system information and logs:

dev@devbox:~/$ vlc --version
VLC media player 3.0.9.2 Vetinari (revision 3.0.9.2-0-gd4c1aefe4d)
VLC version 3.0.9.2 Vetinari (3.0.9.2-0-gd4c1aefe4d)
Compiled by buildd on lgw01-amd64-060.buildd (Apr  9 2020 19:29:44)
Compiler: gcc version 9.3.0 (Ubuntu 9.3.0-10ubuntu2)
root@gimbal:[~/Scratch] 19 # lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.5 LTS
Release:	18.04
Codename:	bionic
root@gimbal:[~/Scratch] 21 # rtsp-simple-server --version
v0.21.0
2023/01/20 12:24:49 DEB [RTSP] [conn 127.0.0.1:36154] [c->s] GET_PARAMETER rtsp://127.0.0.1:8900/live RTSP/1.0
CSeq: 19
Date: Fri, 20 Jan 2023 20:24:49 GMT
Session: 4251221979 
User-Agent: GStreamer/1.14.5

2023/01/20 12:24:49 DEB [RTSP] [conn 127.0.0.1:36154] [s->c] RTSP/1.0 200 OK
CSeq: 19
Content-Type: text/parameters
Server: gortsplib
Session: 4251221979 

2023/01/20 12:25:09 INF [RTSP] [conn 192.168.168.50:37276] closed (terminated)
2023/01/20 12:25:09 INF [RTSP] [session 9db39e26] destroyed (no RTSP requests received in a while)

rss_log.txt

WMichelsen avatar Jan 23 '23 16:01 WMichelsen

This issue is very old and author didn't provide enough data to replicate the problem. Please reopen the issue in case the problem persists.

aler9 avatar Sep 05 '23 08:09 aler9

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[bot] avatar Mar 09 '24 15:03 github-actions[bot]