AirenSoft / OvenMediaEngine

OvenMediaEngine (OME) is a Sub-Second Latency Live Streaming Server with Large-Scale and High-Definition. #WebRTC #LLHLS
https://OvenMediaEngine.com/ome
GNU Affero General Public License v3.0
2.53k stars 1.06k forks source link

RTSP-Pull: connection to source randomly gets lost #1187

Closed jonas-resch closed 1 year ago

jonas-resch commented 1 year ago

Describe the bug When using RTSP-Pull the connection to the source randomly gets lost. After a few seconds OME successfully reconnects to the source. In other clients, e.g. VLC everything works flawlessy without interruption.

To Reproduce Steps to reproduce the behavior:

  1. Install OME >0.15.6 (Docker or direct install)
  2. Server.txt (I'll send the RTSP url to support@airensoft.com)
  3. Access the stream via demo.ovenplayer.com: wss://OME-URL/live/stream

After some time (sometimes 30s, sometimes a few minutes) the message "Connection with low-latency(OME) Server failed" appears. A few retries after the stream works again.

Expected behavior The stream plays for extended periods of time without interruption.

Logs I'll send the logs alongside the RTSP url to support@airensoft.com since it's a lot of information to obfuscate.

Server (please complete the following information):

Player (please complete the following information):

Additional context From the logs you can see that OME doesn't receive any packets from the webcam (there are no incoming packets. x milliseconds have elapsed since the last packet was received). I tried aumenting the timeout to 6s but it still times out. I think that it is OME related since I tested on two different servers and in VLC everything works fine.

After the timeout OME starts reconnecting to the source. One of the SETUP requests returns the following error "455(Method Not Valid In This State)"

getroot commented 1 year ago

Your RTSP Server has a timeout set.

[04-27 19:21:56.360] I [StreamCollector:630581] RtspcStream | rtspc_stream.cpp:448 | Response SETUP: Response: RTSP/1.0 200 OK
Connection: Keep-Alive
CSeq: 11
Date: Thu, 27 Apr 2023 10:21:45 GMT
Session: 2613658800411225924828208291162;timeout=120
Transport: RTP/AVP/TCP;unicast;interleaved=20-21;ssrc=78CD202E

For Keepalive, RTSP Clients such as VLC or FFPLAY seem to periodically transmit the GET_PARAMETER Option. However, this is not implemented in OME. You can avoid this problem if you can set a very long timeout on your camera.

I will implement this after completing the urgent task I am working on now.

jonas-resch commented 1 year ago

Hi, alright, thank you very much for looking into it!

getroot commented 1 year ago

I implemented RTSP Ping (using get_parameter) and committed. Please test with the master branch. https://github.com/AirenSoft/OvenMediaEngine/commit/6e82e96c79f727529d85ab759c86781566cf070d

jonas-resch commented 1 year ago

Hi @getroot, thank you! I tested with the latest commit. Left the stream running for 30min and it worked without any issues.