Description
Describe the feature
We request that MediaMTX expose a configurable option for the STUN gather timeout to enhance flexibility and adaptability in WebRTC configurations. This feature could be implemented by allowing the setting of STUNGatherTimeout via a method such as settingsEngine.SetSTUNGatherTimeout()
and naming the configuration parameter webrtcSTUNGatherTimeout
.
Problem Statement:
Currently, MediaMTX does not provide an option to configure the STUN gather timeout for WebRTC connections. The default timeout may not suit all use cases, particularly in environments with varying network conditions or latency requirements. This limitation can hinder the efficiency and reliability of WebRTC applications that rely on MediaMTX.
Proposed Solution:
Expose Configuration Option: Introduce a new parameter webrtcSTUNGatherTimeout
in the MediaMTX configuration file.
Implementation: Use settingsEngine.SetSTUNGatherTimeout()
internally to apply the user-defined timeout.
Default Value: Retain the current default timeout value if the user does not explicitly set webrtcSTUNGatherTimeout
.
Benefits:
Flexibility: Users can optimize the STUN timeout for their specific network conditions.
Performance: Enhanced connection stability and reduced latency for WebRTC applications.
User Control: Increased configurability aligns with the diverse needs of MediaMTX users.
Real world use
For less than 1% of our /whep
API calls, the entire call takes exactly 5 seconds, all of this time is spent gathering ICE candidates. This makes our application feel sluggish, we would like to set the value to 1-2 seconds, improving responsiveness.
We look forward to discussing this proposal further and providing any additional input required to facilitate its implementation.