Ready-to-use SRT / WebRTC / RTSP / RTMP / LL-HLS media server and media proxy that allows to read, publish, proxy, record and playback video and audio streams.
When a FFmpeg process publishing to the server is stopped and its clients are disconnected, the goroutines associated to the RTCPSender object keep running, leading to possible goroutine leaks:
goroutine 26 [select]:
github.com/aler9/gortsplib/pkg/rtcpsender.(*RTCPSender).run(0xc0000849c0)
/home/user/go/pkg/mod/github.com/aler9/gortsplib@v0.0.0-20221021150213-7d8e3cf5bc03/pkg/rtcpsender/rtcpsender.go:64 +0x132
created by github.com/aler9/gortsplib/pkg/rtcpsender.New
/home/user/go/pkg/mod/github.com/aler9/gortsplib@v0.0.0-20221021150213-7d8e3cf5bc03/pkg/rtcpsender/rtcpsender.go:45 +0x10a
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.
Which version are you using?
v0.20.1
Which operating system are you using?
Describe the issue
When a FFmpeg process publishing to the server is stopped and its clients are disconnected, the goroutines associated to the RTCPSender object keep running, leading to possible goroutine leaks:
To better identify the problem, we modified the
run()
function in our local installation of gortsplib/pkg/rtcpsender/rtcpsender.go like this:Even after both publisher and client processes are killed, the first message is printed forever and the loop never reaches its termination.
Describe how to replicate the issue
ffmpeg -re -stream_loop -1 -i out.mp4 -c copy -f rtsp rtsp://localhost:8554/mystream
ffplay rtsp://localhost:8554/mystream
Did you attach the server logs?
yes
Last messages are repeated every 10 seconds.
Did you attach a network dump?
no