The TVSDK can play videos that have multiple profiles with different bit rates, switching between them to provide more than one quality level based on the available bandwidth.
You can set initial, minimum, and maximum bit rates as well as the adaptive bit-rate (ABR) switch policy for a multiple bit rate (MBR) stream. The TVSDK automatically switches to the bit rate that provides the best playback experience within the specified configuration.
The reference implementation configures the following ABR parameters in IPlaybackConfig.
Parameter | Description |
---|---|
Initial bit rate: getABRInitialBitRate | The desired playback bit rate (in bits per second) for the first segment. When playback starts, the closest profile (equal to or greater than the initial bit rate) is used for the first segment. If a minimum bit rate is defined and the initial bit rate is lower than the minimum, the TVSDK selects the profile with the lowest bit rate above the minimum bit rate. Similarly, if the initial rate is above the maximum rate, the TVSDK selects the highest rate below the maximum. If the initial bit rate is zero or undefined, the initial bit rate is determined by the ABR policy. Returns an integer value that represents the byte-per-second profile. |
Minimum bit rate: getABRMinBitRate | The lowest allowed bit rate to which the ABR can switch. ABR switching ignores profiles with a bit rate lower than this. Returns an integer value that represents the bits-per-second profile. |
Maximum bit rate: getABRMaxBitRate | The highest allowed bit rate to which the ABR can switch. ABR switching ignores profiles with a bit rate higher than this. Returns an integer value that represents the bits-per-second profile. |
ABR switching policy: getABRPolicy | The playback switches gradually to the highest-bit-rate profile when possible. You can set the policy for ABR switching, which determines how quickly the TVSDK switches between profiles. The default is Moderate.
If the initial bit rate is zero or not specified and a policy is specified, playback starts with the lowest bit-rate profile for Conservative, the profile closest to the median bit rate of available profiles for Moderate, and the highest bit-rate profile for Aggressive. The policy works within the constraints of the minimum and maximum bit rates, if they are specified. Returns the current setting from the ABRControlParameters enum:
See also ABRPolicy. |
onProfileChanged
events in PlaybackEventListener
.Adaptive bit rate (ABR) is enabled in the TVSDK by default. You can use the Primetime Settings user interface to override the default TVSDK behavior in the reference implementation by configuring custom ABR control.
To enable custom ABR through the Settings user interface:
Open the Primetime Settings dialog.
Select ABR controls.
Tap the Enable ON control so that it displays OFF
.
The PlaybackManager
only sets the ABR parameters if isABRControlEnabled returns true (ON). If it returns false (OFF), the PlaybackManager
uses the default ABR control so the initial, minimum, and maximum bit rates will all be 0 and the ABR policy will be ABR_MODERATE
.
For some low bit-rate playback rates, the TVSDK, by default, switches to the audio-only stream and the playback appears frozen. You can configure the player so that it never encounters a situation where it switches to audio-only.
Implement the IPlaybackConfig interface:
Ensure that getABRMinBitRate is higher than the audio-only bit rate (higher than 64000).
Ensure that isABRControlEnabled is on.