Hls.js: Some discontinuities hang because of bufferStalledError+bufferNudgeOnStall in Chrome (since 0.7.1 / 0.7.0)

Created on 23 Mar 2017  路  2Comments  路  Source: video-dev/hls.js

Environment

  • [x] The stream has correct Access-Control-Allow-Origin headers (CORS)
  • [x] There are no network errors such as 404s in the browser console when trying to play the stream
  • [x] The issue observed is not already reported by searching on Github under https://github.com/video-dev/hls.js/issues
  • [x] The issue occurs in the latest reference client on http://video-dev.github.io/hls.js/demo and not just on my page
  • Link to playable M3U8 file: https://medialaan.ambroos.io/hls/bufferStalledError.m3u8
  • Hls.js version: 0.7.1+ (probably 0.7.0, but discontinuities are broken there)
  • Browser name/version: Chrome, stable and newer
  • OS name/version: observed on Windows 7 and macOS Sierra so far

I strongly suspect this was introduced with the fix for #951.
May be related to #1046.

Steps to reproduce
  1. Play the test stream (https://medialaan.ambroos.io/hls/bufferStalledError.m3u8)
  2. Seek to right before one of the first discontinuity transition at 0:45ish (or just wait until you get there)

The issue also occurs further on with other discontinuities.

Expected behavior

Video continues playing smoothly through the discontinuity. (OK in Firefox, Edge.)

Actual behavior

In Chrome only, video appears to hang for a few seconds, then a bufferStalledError + bufferNudgeOnStall error are raised and the video skips ahead a little (and a few seconds of content is skipped over).

Console output
...
[log] > SN just loaded, load next one: 9
[log] > Loading 9 of [0 ,21],level 0, currentTime:39.805,bufferEnd:69.781
[log] > main stream:IDLE->FRAG_LOADING
[log] > Loaded  9 of [0 ,21],level 0
[log] > main stream:FRAG_LOADING->PARSING
[log] > Parsing 9 of [0 ,21],level 0, cc 3
[log] > Parsed audio,PTS:[70.315,77.824],DTS:[70.315/77.824],nb:176,dropped:0
[log] > Parsed video,PTS:[69.861,77.341],DTS:[69.781/77.301],nb:188,dropped:0
[log] > main stream:PARSING->PARSED
[log] > main buffered : [0.000,44.184][44.331,59.731][59.861,77.301]
[log] > latency/loading/parsing/append/kbps:17/245/10/4/31508
[log] > main stream:PARSED->IDLE
[warn] > playback stalling in high buffer @47.158507
(anonymous) @ logger.js:39
_checkBuffer @ stream-controller.js:1478
doTick @ stream-controller.js:174
tick @ stream-controller.js:123
(index):523 Object {type: "mediaError", details: "bufferStalledError", fatal: false, buffer: 12.572159}
(anonymous) @ (index):523
EventEmitter.emit @ events.js:96
trigger @ hls.js:82
_checkBuffer @ stream-controller.js:1479
doTick @ stream-controller.js:174
tick @ stream-controller.js:123
[log] > adjust currentTime from 47.158507 to 47.258507
(index):523 Object {type: "mediaError", details: "bufferNudgeOnStall", fatal: false}
(anonymous) @ (index):523
EventEmitter.emit @ events.js:96
trigger @ hls.js:82
_checkBuffer @ stream-controller.js:1490
doTick @ stream-controller.js:174
tick @ stream-controller.js:123
[log] > media seeking to 47.259
[log] > media seeked to 47.259
[log] > SN just loaded, load next one: 10
[log] > Loading 10 of [0 ,21],level 0, currentTime:47.377,bufferEnd:77.301
[log] > main stream:IDLE->FRAG_LOADING
[log] > Loaded  10 of [0 ,21],level 0
[log] > main stream:FRAG_LOADING->PARSING
[log] > Parsing 10 of [0 ,21],level 0, cc 3
[log] > Parsed audio,PTS:[77.824,80.000],DTS:[77.824/80.000],nb:51,dropped:0
[log] > Parsed video,PTS:[77.381,79.901],DTS:[77.301/79.861],nb:64,dropped:0
[log] > main stream:PARSING->PARSED
[log] > main buffered : [0.000,44.184][44.331,59.731][59.861,79.861]
[log] > latency/loading/parsing/append/kbps:17/75/4/2/29287
[log] > main stream:PARSED->IDLE
...
00:00:00 00 pipeline_state  kCreated
00:00:00 00 event   WEBMEDIAPLAYER_CREATED
00:00:00 00 url blob:http://streambox.fr/841051d5-1199-4032-abb8-f919ea2b6b5a
00:00:00 00 pipeline_state  kStarting
00:00:00 646    found_audio_stream  true
00:00:00 646    audio_codec_name    aac
00:00:00 646    found_video_stream  true
00:00:00 646    video_codec_name    h264
00:00:00 647    audio_dds   false
00:00:00 647    audio_decoder   FFmpegAudioDecoder
00:00:00 648    video_dds   false
00:00:00 648    video_decoder   GpuVideoDecoder
00:00:00 648    pipeline_state  kPlaying
00:00:00 651    audio_buffering_state   BUFFERING_HAVE_ENOUGH
00:00:00 669    video_buffering_state   BUFFERING_HAVE_ENOUGH
00:00:00 669    pipeline_buffering_state    BUFFERING_HAVE_ENOUGH
00:00:00 669    event   PLAY
00:00:00 651    duration    153.239999
00:00:44 895    video_buffering_state   BUFFERING_HAVE_NOTHING
00:00:47 895    pipeline_buffering_state    BUFFERING_HAVE_NOTHING
00:00:51 47 seek_target 47.258507
00:00:51 47 pipeline_state  kSeeking
00:00:51 47 audio_buffering_state   BUFFERING_HAVE_NOTHING
00:00:51 50 pipeline_state  kPlaying
00:00:51 51 audio_buffering_state   BUFFERING_HAVE_ENOUGH
00:00:51 57 video_buffering_state   BUFFERING_HAVE_ENOUGH
00:00:51 57 pipeline_buffering_state    BUFFERING_HAVE_ENOUGH
00:00:53 535    event   PAUSE
Bug

Most helpful comment

this bug has been introduced by https://github.com/video-dev/hls.js/commit/b799f175a1bff2e4f3df65d49869215c173e31ba
should be fixed now, please recheck against latest demo page

All 2 comments

this bug has been introduced by https://github.com/video-dev/hls.js/commit/b799f175a1bff2e4f3df65d49869215c173e31ba
should be fixed now, please recheck against latest demo page

@mangui Looks good!

We'll stick with the last 0.6.x until there's a new release. Thanks a lot for the extremely fast fix!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

NicholasAsimov picture NicholasAsimov  路  3Comments

shalommeoded picture shalommeoded  路  3Comments

ronag picture ronag  路  4Comments

mmmmoj picture mmmmoj  路  3Comments

phillydogg28 picture phillydogg28  路  4Comments