This topic describes how to implement media playback using adaptive bitrate streaming, including live streaming.
Adaptive streaming is media streaming which adjusts its bit rate during playback. It offers reduced network usage and buffering time, and increased picture quality compared to traditional media streaming. For more information, see Adaptive bitrate streaming on Wikipedia.
The AVPlay API supports 3 common adaptive streaming engines. The following table lists the file extensions for which adaptive streaming is enabled.
Streaming Engine | File Extensions |
---|---|
Smooth Streaming | .ism/Manifest |
MPEG-DASH | .xml .mpd |
HTTP Live Streaming (HLS) | .m3u8 |
Note
For more information on the versions of HLS supported on SSSP, see the General Features.
The HTML5video
element does not support adaptive streaming. You must use the AVPlay API.
Adaptive streaming media playback is implemented using the AVPlay API in the same way as other media. The AVPlay
instance handles the adaptive streaming media type based on the basic specifications for the stream.
When the AVPlay
instance is in the IDLE state, you can adjust some adaptive streaming parameters by calling the setStreamingProperty()
method with the ADAPTIVE_INFO
property:
...
var bitRateString = 'BITRATES=5000~10000|STARTBITRATE=HIGHEST|SKIPBITRATE=LOWEST';
webapis.avplay.setStreamingProperty('ADAPTIVE_INFO', bitRateString);
...
webapis.avplay.prepare();
The following table specifies the allowed parameters and values for the ADAPTIVE_INFO
property. You can set multiple parameters by separating them with a "|" character.
Parameter | Description | Values |
---|---|---|
"BITRATES" | Bit rate of the stream | Range indicated by a "~" character, or a fixed bit rate. For example:
|
"STARTBITRATE" | Bit rate for the start of adaptive streaming | "LOWEST", "HIGHEST", "AVERAGE", or a fixed number as a string |
"SKIPBITRATE" | Bit rate to ignore during streaming | "LOWEST", "HIGHEST", "AVERAGE", or a fixed number as a string |
"START_TIME" | Resume time for live streaming | Time in milliseconds |
The jumpForward()
, jumpBackward()
, and seekTo()
methods of the AVPlay API, which are related to live seeking, have limited functionality in live streaming. If you want to use live seek, the streaming server must maintain past and future segments. The seekable range is limited to the segments maintained on the server. The following table lists the streaming engines that support live seek.
Streaming Engine | Live Seek Support |
---|---|
Smooth Streaming | Supported |
MPEG-DASH | |
HTTP Live Streaming (HLS) |
1. MPEG-DASH
Item | Recommendation | Remarks |
---|---|---|
Video Codec | HEVC (H.265) |
|
Audio Codec | AAC (2 channel) DD/DD+ (5.1 or 7.1) |
|
Media Format | fMP4(CENC) | |
Resolution | 7680x4320 | Multiple resolutions / bitrates recommended |
Frame rate | 24,25,30 fps | MAX 60 fps (23.97, 24, 25, 50) |
Streaming Method | MPEG-DASH | Recommended Segment Duration : 3 seconds ? |
HDR | HDR10+ | HLG, HDR10, HDR10+ supported in the specification |
DRM | Playready | |
Subtitle | SMPTE-TT WebVTT |
2. HLS
Item | Recommendation | Remarks |
---|---|---|
Video Codec | HEVC (H.265) |
|
Audio Codec | AAC (2 channel) DD/DD+ (5.1 or 7.1) |
|
Media Format | MPEG-TS | |
Resolution | 7680x4320 | Multiple resolutions / bitrates recommended |
Frame rate | 24,25,30 fps | MAX 60 fps (23.97, 24, 25, 50) |
Streaming Method | HLS | Recommended Segment Duration : 3 seconds ? |
HDR | HDR10+ | HLG, HDR10, HDR10+ (supported in the specification) |
DRM | AES-128 | |
Subtitle | SMPTE-TT WebVTT |
1. Check if the SSSP supports 4K / 8K Streaming
See 4K 8K UHD Video.
2. Check if resolution value for all video streams are described in the medata file
(1) If the resolution value for all video streams can be described in the metadata (mpd in case of MPEG-DASH, m3u8 in case of HLS),
HLS | MPEG-DASH |
---|---|
#EXTM3U #EXT-X-VERSION:3 #EXT-X-STREAM-INF:BANDWIDTH=24576000,RESOLUTION=7680x4320 7680x4320_1/output.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=10240000,RESOLUTION=3840x2160 3840x2160_1/output.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=6502400,RESOLUTION=2560x1440 2560x1440_1/output.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=4403200,RESOLUTION=1920x1080 1920x1080_1/output.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=3072000,RESOLUTION=1280x720 1280x720_1/output.m3u8 |
... <AdaptationSet ...> ... <Representation id="2" mimeType="video/mp4" codecs="hev1.2.4.L150.90" width="3840" height="2130" ...> … <Representation id="6" mimeType="video/mp4" codecs="hev1.2.4.L180.90" width="7680" height="4320" ...> ... |
(2) If the resolution value for all video streams is not described in the metadata (mpd in case of MPEG-DASH, m3u8 in case of HLS), or if you want to give a restriction to the content resolution to be played,
set the resolution value with webapis.avplay.setStreamingProperty() API. See AVPlay API guide for the detail information.
...
// call setStreamingProperty() before prepare()
webapis.avplay.setStreamingProperty("ADAPTIVE_INFO", "FIXED_MAX_RESOLUTION=7680x4320");
...
webapis.avplay.prepare();