Stream switching/adapting in HLS

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
takoi Offline
Fan
Posts: 699
Joined: Oct 2009
Reputation: 10
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
Retired Developer
Posts: 12,386
Joined: Nov 2003
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..
find quote
a_wein Offline
Junior Member
Posts: 2
Joined: Sep 2013
Reputation: 0
Post: #3
Any update on this issue?
find quote
takoi Offline
Fan
Posts: 699
Joined: Oct 2009
Reputation: 10
Location: Norway
Post: #4
Since frodo it picks the best stream based on the bandwidth setting instead, which is good enough for me. Adaptive switching is probably very hard to get right anyway.
(This post was last modified: 2013-09-19 17:23 by takoi.)
find quote
a_wein Offline
Junior Member
Posts: 2
Joined: Sep 2013
Reputation: 0
Post: #5
(2013-09-19 17:22)takoi Wrote:  Since frodo it picks the best stream based on the bandwidth setting instead, which is good enough for me. Adaptive switching is probably very hard to get right anyway.

Thanks for this hint. Thats fine for me too.
I'll just upgrade to 12.2 now. (Sorry - I should have tested the latest release prior to complaining.)
find quote