Frequently Asked Questions
Why does the first subscription of my WebRTC stream take a significantly longer time than subsequent subscriptions?
QUESTION:
Why does the first subscription of my WebRTC stream take a significantly longer time than subsequent subscriptions?
ANSWER:
Publishing an RTMP stream will yield nearly instantaneous subscribing via RTMP, but when the first RTC subscriber joins, there is set-up involved, meaning roughly 4-8 seconds in most cases. Subsequent RTC subscribers will be speedier due to the set-up already having been done for the first.
In the STUN spec (which is used in WebRTC) there is a minimum of 3 seconds that must be supported for interconnection. Red5 Pro actually does it faster, usually in the order of about 100 ms. So in most cases what you are really “waiting” around for when subscribing to WebRTC is a keyframe or configuration data which can flow from a publisher every 3-6 seconds or more, depending upon the encoder settings.