Stream switching/adapting in HLS

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
takoi Offline
Fan
Posts: 503
Joined: Oct 2009
Reputation: 6
Location: Norway
Post: #1
Here's an example:
http://links.latincdn.com/vod/hls/big_bu...p_001.m3u8

It contains the following streams:

Code:
#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1896000
big_buck_bunny_1080p_h264_HLS_16x9_480p_001/big_buck_bunny_1080p_h264_HLS_16x9_480p_001.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1596000
big_buck_bunny_1080p_h264_HLS_16x9_480p_001_1500Kb/big_buck_bunny_1080p_h264_HLS_16x9_480p_001_1500Kb.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1296000
big_buck_bunny_1080p_h264_HLS_16x9_480p_001_1200Kb/big_buck_bunny_1080p_h264_HLS_16x9_480p_001_1200Kb.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=996000
big_buck_bunny_1080p_h264_HLS_16x9_480p_001_900Kb/big_buck_bunny_1080p_h264_HLS_16x9_480p_001_900Kb.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=864000
big_buck_bunny_1080p_h264_HLS_16x9_480p_001_768Kb/big_buck_bunny_1080p_h264_HLS_16x9_480p_001_768Kb.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=608000
big_buck_bunny_1080p_h264_HLS_16x9_480p_001_512Kb/big_buck_bunny_1080p_h264_HLS_16x9_480p_001_512Kb.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=352000
big_buck_bunny_1080p_h264_HLS_16x9_480p_001_256Kb/big_buck_bunny_1080p_h264_HLS_16x9_480p_001_256Kb.m3u8
Code:
Stream #0:0: Audio: aac ([15][0][0][0] / 0x000F), 44100 Hz, stereo, s16
    Metadata:
      variant_bitrate : 1896000
    Stream #0:1: Video: h264 (Baseline) ([27][0][0][0] / 0x001B), yuv420p, 852x480 [SAR 1:1 DAR 71:40], 24 tbr, 90k tbn, 48 tbc
    Metadata:
      variant_bitrate : 1896000
    Stream #0:2: Audio: aac ([15][0][0][0] / 0x000F), 44100 Hz, stereo, s16
    Metadata:
      variant_bitrate : 1596000
    Stream #0:3: Video: h264 (Baseline) ([27][0][0][0] / 0x001B), yuv420p, 852x480 [SAR 1:1 DAR 71:40], 24 tbr, 90k tbn, 48 tbc
    Metadata:
      variant_bitrate : 1596000
    Stream #0:4: Audio: aac ([15][0][0][0] / 0x000F), 44100 Hz, stereo, s16
    Metadata:
      variant_bitrate : 1296000
    Stream #0:5: Video: h264 (Baseline) ([27][0][0][0] / 0x001B), yuv420p, 852x480 [SAR 1:1 DAR 71:40], 24 tbr, 90k tbn, 48 tbc
    Metadata:
      variant_bitrate : 1296000
    Stream #0:6: Audio: aac ([15][0][0][0] / 0x000F), 44100 Hz, stereo, s16
    Metadata:
      variant_bitrate : 996000
    Stream #0:7: Video: h264 (Baseline) ([27][0][0][0] / 0x001B), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 24 tbr, 90k tbn, 48 tbc
    Metadata:
      variant_bitrate : 996000
    Stream #0:8: Audio: aac ([15][0][0][0] / 0x000F), 44100 Hz, stereo, s16
    Metadata:
      variant_bitrate : 864000
    Stream #0:9: Video: h264 (Baseline) ([27][0][0][0] / 0x001B), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 24 tbr, 90k tbn, 48 tbc
    Metadata:
      variant_bitrate : 864000
    Stream #0:10: Audio: aac ([15][0][0][0] / 0x000F), 44100 Hz, stereo, s16
    Metadata:
      variant_bitrate : 608000
    Stream #0:11: Video: h264 (Baseline) ([27][0][0][0] / 0x001B), yuv420p, 512x288 [SAR 1:1 DAR 16:9], 24 tbr, 90k tbn, 48 tbc
    Metadata:
      variant_bitrate : 608000
    Stream #0:12: Audio: aac ([15][0][0][0] / 0x000F), 44100 Hz, stereo, s16
    Metadata:
      variant_bitrate : 352000
    Stream #0:13: Video: h264 (Baseline) ([27][0][0][0] / 0x001B), yuv420p, 512x288 [SAR 1:1 DAR 16:9], 24 tbr, 90k tbn, 48 tbc
    Metadata:
      variant_bitrate : 352000

How, if you play the master m3u8, xbmc seems to always just pick the first stream and stick with it, no matter what. Not automatically switching as expected. Am i doing something wrong here or is it that adaptive bitrate is not supported?
If it isn't, is there a way to pick the stream to play manually? For audio I can use setAudioStream through python or select it through gui, which works fine. But what about video stream?
find quote
spiff Offline
Grumpy Bastard Developer
Posts: 12,174
Joined: Nov 2003
Reputation: 82
Post: #2
not yet supported. i started working on it ages ago, there's a (dysfunctional) pr. haven't found the time to look at it again.

however the fact that nrk is moving to hls, will bump it on my priorities..

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote