About the OpenTok scalable video feature
Scalable video can greatly improve the quality of video in multi-party sessions. Using this feature, a client automatically publishes a multi-quality video stream, composed of multiple video resolutions and frame rates. This allows simultaneous subscribing endpoints to consume different video resolutions and frame rates.
The scalable video feature is only available in routed sessions (sessions that use the OpenTok Media Router). See The OpenTok Media Router and media modes.
The OpenTok Media Router dynamically switches between different video resolutions and frame rates for a subscriber's stream, as network conditions on the subscribing endpoint change.
You do not need to add any code to use the scalable video feature. The OpenTok Media Router handles the switching of subscriber stream resolutions and frame rates automatically. The OpenTok Media Router turns on this feature when it determines the session will benefit from it based on the topology of clients connected to the session.
Scalable video is only available in streams published by clients that use:
The OpenTok iOS SDK
The OpenTok Android SDK
The OpenTok Windows SDK
The OpenTok Linux SDK
OpenTok.js in Chrome, Opera, Edge, and Safari
It is only supported for VP8 streams. It is not supported for H.264 streams.
For screen-sharing streams, you need to enable scalable video for the published stream:
In OpenTok.js, for streams that have the video source set to "screen", set the
scalableScreenshare
option for the OT.initPublisher()
method.
In the OpenTok Android SDK, for streams that have the video type set to PublisherKitVideoTypeScreen
, use the
PublisherKit.Builder.scalableScreenshare()
method.
In the OpenTok iOS SDK, for streams that have the OTStreamVideoType
set to OTStreamVideoTypeScreen
, use the
OTPublisherKitSettings.scalableScreenshare
property.
In Windows SDK, for streams that have the VideoSourceType
set to Screen
, use the
Publisher.Builder.ScalableScreenshare
property.
In the Linux SDK, for streams that have the video type set to OTC_PUBLISHER_VIDEO_TYPE_SCREEN
, use the
otc_publisher_settings_set_scalable_screenshare()
function.
By default, scalable video is disabled for screen-sharing streams.
In OpenTok.js, scalable video is enabled by default for streams with a camera or custom video source.
To disable scalable video, set the scalableVideo
option for the OT.initPublisher()
method.
All OpenTok clients can subscribe to scalable video streams. The client SDKs include methods or properties for setting the preferred frame rate and resolution for the stream a subscribing client receives from the OpenTok Media Router:
In OpenTok.js — Subscriber.setPreferredFrameRate()
and
Subscriber.setPreferredResolution()
In the OpenTok Android SDK — SubscriberKit.setPreferredFrameRate()
and
OSubscriberKit.setPreferredResolution()
In the OpenTok iOS SDK — OTSubscriberKit.preferredFrameRate
and
SubscriberKit.preferredResolution
In Windows SDK — Subscriber.PreferredFramerate
and
Subscriber.PreferredResolution
.
For more information, see this article.