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 source stop stream after 2 minutes #1739

Closed
12 tasks
Forest-fox opened this issue Apr 26, 2023 · 13 comments · Fixed by bluenviron/gortsplib#318
Closed
12 tasks

RTSP source stop stream after 2 minutes #1739

Forest-fox opened this issue Apr 26, 2023 · 13 comments · Fixed by bluenviron/gortsplib#318
Labels
bug Something isn't working rtsp

Comments

@Forest-fox
Copy link

Forest-fox commented Apr 26, 2023

Which version are you using?

v0.22.2

Which operating system are you using?

  • [x ] 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

I have setup rtsp proxy with one source - h264 video + g711U audio
I can take source directly with rtsp://ip/av0_0
This link setup as source for mediamtx path

If i play stream directly with SMPlayer - all fine, stream plays for a moment, when i stopped it.
But if i play by proxy - got this:

  • stream plays, all fine
  • after ~2minutes stream suddenly stopped with messages in log:
    2023/04/26 16:59:30 INF [path 10.154.249.2] [rtsp source] stopped
    2023/04/26 16:59:30 INF [RTSP] [conn 127.0.0.1:52970] closed (terminated)
    2023/04/26 16:59:30 INF [RTSP] [session 381853316] destroyed (terminated)

Describe how to replicate the issue

  1. start the server
  2. publish with rtsp
  3. read with rtsp

Did you attach the server logs?

yes

Did you attach a network dump?

yes (direct.pcap && proxy.pcap)

Logs and dump in file logs.tar.gz

@Forest-fox
Copy link
Author

v0.23.1 also affected

2023/05/19 09:59:22 INF [path 10.154.184.4] [rtsp source] ready: 2 tracks (H264, G711)
2023/05/19 09:59:22 INF [HLS] [muxer 10.154.184.4] created automatically
2023/05/19 09:59:22 INF [HLS] [muxer 10.154.184.4] is converting into HLS, 1 track (H264)
2023/05/19 09:59:22 INF [path 10.154.184.2] [rtsp source] ready: 2 tracks (H264, G711)
2023/05/19 09:59:22 INF [HLS] [muxer 10.154.184.2] created automatically
2023/05/19 09:59:22 INF [HLS] [muxer 10.154.184.2] is converting into HLS, 1 track (H264)
2023/05/19 09:59:23 INF [path 10.154.184.3] [rtsp source] ready: 2 tracks (H264, G711)
2023/05/19 09:59:23 INF [HLS] [muxer 10.154.184.3] created automatically
2023/05/19 09:59:23 INF [HLS] [muxer 10.154.184.3] is converting into HLS, 1 track (H264)
2023/05/19 09:59:23 INF [path 10.154.204.2] [rtsp source] ready: 2 tracks (H264, G711)
2023/05/19 09:59:23 INF [HLS] [muxer 10.154.204.2] created automatically
2023/05/19 09:59:23 INF [HLS] [muxer 10.154.204.2] is converting into HLS, 1 track (H264)
2023/05/19 09:59:23 INF [path 10.154.48.2] [rtsp source] ready: 2 tracks (H264, G711)
2023/05/19 09:59:23 INF [HLS] [muxer 10.154.48.2] created automatically
2023/05/19 09:59:23 INF [HLS] [muxer 10.154.48.2] is converting into HLS, 1 track (H264)
2023/05/19 09:59:24 INF [path 10.154.249.3] [rtsp source] ready: 2 tracks (H264, G711)
2023/05/19 09:59:24 INF [HLS] [muxer 10.154.249.3] created automatically
2023/05/19 09:59:24 INF [HLS] [muxer 10.154.249.3] is converting into HLS, 1 track (H264)
2023/05/19 09:59:25 INF [path 10.154.184.5] [rtsp source] ready: 2 tracks (H264, G711)
2023/05/19 09:59:25 INF [HLS] [muxer 10.154.184.5] created automatically
2023/05/19 09:59:25 INF [HLS] [muxer 10.154.184.5] is converting into HLS, 1 track (H264)
2023/05/19 09:59:53 INF [path 10.154.52.2] [rtsp source] ERR: EOF
2023/05/19 09:59:53 INF [HLS] [muxer 10.154.52.2] destroyed (terminated)
2023/05/19 09:59:54 INF [path 10.154.184.6] [rtsp source] ERR: EOF
2023/05/19 09:59:54 INF [HLS] [muxer 10.154.184.6] destroyed (terminated)
2023/05/19 09:59:55 INF [path 10.154.249.2] [rtsp source] ERR: EOF
2023/05/19 09:59:55 INF [HLS] [muxer 10.154.249.2] destroyed (terminated)
2023/05/19 09:59:56 INF [path 10.154.52.4] [rtsp source] ERR: EOF
2023/05/19 09:59:56 INF [HLS] [muxer 10.154.52.4] destroyed (terminated)
2023/05/19 09:59:58 INF [path 10.154.52.3] [rtsp source] ERR: EOF
2023/05/19 09:59:58 INF [HLS] [muxer 10.154.52.3] destroyed (terminated)
2023/05/19 09:59:58 INF [path 10.154.52.2] [rtsp source] ready: 2 tracks (H264, G711)
2023/05/19 09:59:58 INF [HLS] [muxer 10.154.52.2] created automatically
2023/05/19 09:59:58 INF [HLS] [muxer 10.154.52.2] is converting into HLS, 1 track (H264)
2023/05/19 09:59:59 INF [path 10.154.184.6] [rtsp source] ready: 2 tracks (H264, G711)
2023/05/19 09:59:59 INF [HLS] [muxer 10.154.184.6] created automatically
2023/05/19 09:59:59 INF [HLS] [muxer 10.154.184.6] is converting into HLS, 1 track (H264)
2023/05/19 10:00:00 INF [path 10.154.249.2] [rtsp source] ready: 2 tracks (H264, G711)

Even without clients (setup always remux)

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

aler9 commented May 19, 2023

Hello @Forest-fox, i'm trying to debug the logs you provided but i think you're reporting two separate issues:

  • the initial log you posted reports [path 10.154.249.2] [rtsp source] stopped - probably it has to do with sourceOnDemand: yes
  • the second log you posted reports [rtsp source] ERR: EOF - probably it's issue v0.23.0 drops with Reolink RLC-520A #1812

@Forest-fox
Copy link
Author

Yes, issue is second variant with [rtsp source] ERR: EOF / muxer destroyed (terminated)

@Forest-fox
Copy link
Author

Have checked version 0.23.2 - also affected
Log, configuration and network dump - 0.23.2-logs.tar.gz

@aler9
Copy link
Member

aler9 commented May 28, 2023

From the logs it seems that the camera closes the TCP connection after exactly 2 minutes and 15 seconds. This may be linked to the ability to keep a RTSP session running even when its TCP connection gets closed, which is currently missing (bluenviron/gortsplib#162).

If this hypothesis is right, you might be able to temporarily fix the issue by setting sourceProtocol: tcp int he configuration file.

@Forest-fox
Copy link
Author

Tried to set sourceProtocol: tcp for path - not working. Same behavior.

@aler9
Copy link
Member

aler9 commented Jun 2, 2023

Can you post a network dump of 3 minutes of communication between SMPlayer and the camera? this is needed in order to compare a working setup with the server behavior.

@Forest-fox
Copy link
Author

@aler9
Copy link
Member

aler9 commented Jun 24, 2023

Hello, from the logs you posted it seems that the difference between MediaMTX and SMPlayer is that MediamTX doesn't send RTCP receiver reports to the camera, because the camera doesn't send RTCP sender reports, while SMPlayer, which is GStreamer-based, sends them anyway without waiting for sender reports.

I've created a fix (bluenviron/gortsplib#318) but before merging it i need you to test the following nightly release in order to check whether the issue has been solved.

[link removed]

@Forest-fox
Copy link
Author

Thanks! I'll test at Monday and give feedback.

@Forest-fox
Copy link
Author

I can confirm, that problem resolved with fixed version.
None errors. Stream works fine for more than 10 minutes.

@aler9
Copy link
Member

aler9 commented Jul 1, 2023

added in v0.23.7

Copy link
Contributor

github-actions bot commented Jan 3, 2024

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 3, 2024
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

Successfully merging a pull request may close this issue.

2 participants