video-dev / hls.js

HLS.js is a JavaScript library that plays HLS in browsers with support for MSE.
https://hlsjs.video-dev.org/demo
Other
14.94k stars 2.59k forks source link

Hlsjs Player getting Stuck after playing few seconds #5412

Open symit-dev opened 1 year ago

symit-dev commented 1 year ago

What version of Hls.js are you using?

v1.4.0

What browser (including version) are you using?

Chrome Version 112.0.5615.138 (Official Build) (64-bit)

What OS (including version) are you using?

Windows 11

Test stream

https://hlsjs.video-dev.org/demo/?src=https%3A%2F%2Faged-recipe-2466.cifap869069220.workers.dev%2F0000%2F%3FRUYADQFERAkABw%3D%3D%3FAAEzNPe4Xyq_HDZMOdCLTes6f-stynRfUbI%3FXkYBBAJKQAkEAkdAAgU%3D%3F206246%3FBQACAgUAAx0EdeYcCwABAyWmZEKzbVjb5f77bZwWEfHXqSlEzvAAAukPAAIuqRlWEfg0SMGx8b8vBA%3FoutputVideo.m3u8&demoConfig=eyJlbmFibGVTdHJlYW1pbmciOnRydWUsImF1dG9SZWNvdmVyRXJyb3IiOnRydWUsInN0b3BPblN0YWxsIjpmYWxzZSwiZHVtcGZNUDQiOmZhbHNlLCJsZXZlbENhcHBpbmciOi0xLCJsaW1pdE1ldHJpY3MiOi0xfQ==

Configuration

{
  "debug": true,
  "enableWorker": true,
  "lowLatencyMode": true,
  "backBufferLength": 90
}

Additional player setup steps

No response

Checklist

Steps to reproduce

  1. Visit the Test URL 2.Play in Chrome Browser

Expected behaviour

Play Video Without Getting Stuck This is working fine in Mozilla Firefox but not in Chrome Browser

What actually happened?

When Playing in Chrome it's getting stuck after few seconds after 1 Min 30 Seconds can't even seek

while it's working fine in Mozilla Firefox browser Version 112.0.1

Console output

Using Hls.js config: {debug: true, enableWorker: true, lowLatencyMode: true, backBufferLength: 90}
logger.ts:74 [log] > Debug logs enabled for "Hls instance" in hls.js version 1.4.0
hls.ts:411 [log] > stopLoad
hls.ts:379 [log] > loadSource:https://aged-recipe-2466.cifap869069220.workers.dev/0000/?RUYADQFERAkABw==?AAEzNPe4Xyq_HDZMOdCLTes6f-stynRfUbI?XkYBBAJKQAkEAkdAAgU=?206246?BQACAgUAAx0EdeYcCwABAyWmZEKzbVjb5f77bZwWEfHXqSlEzvAAAukPAAIuqRlWEfg0SMGx8b8vBA?outputVideo.m3u8
stream-controller.ts:566 [log] > [stream-controller]: Trigger BUFFER_RESET
hls.ts:351 [log] > attachMedia
buffer-controller.ts:794 [log] > [buffer-controller]: Media source opened
base-stream-controller.ts:1713 [log] > [subtitle-stream-controller]: STOPPED->IDLE
level-controller.ts:269 [log] > [level-controller]: manifest loaded, 1 level(s) found, first bitrate: 0
buffer-controller.ts:142 [log] > 1 bufferCodec event(s) expected
hls.ts:401 [log] > startLoad(-1)
level-controller.ts:351 [log] > [level-controller]: Switching to level 0 from level -1
base-stream-controller.ts:1713 [log] > [stream-controller]: STOPPED->IDLE
base-stream-controller.ts:1713 [log] > [subtitle-stream-controller]: IDLE->STOPPED
base-stream-controller.ts:1713 [log] > [subtitle-stream-controller]: STOPPED->IDLE
stream-controller.ts:631 [log] > [stream-controller]: Level 0 loaded [0,1203], cc [0, 0] duration:8425.788999999992
buffer-controller.ts:686 [log] > [buffer-controller]: Updating Media Source duration to 8425.789
base-stream-controller.ts:714 [log] > [stream-controller]: Loading fragment 0 cc: 0 of [0-1203] level: 0, target: 0
base-stream-controller.ts:1713 [log] > [stream-controller]: IDLE->FRAG_LOADING
transmuxer-interface.ts:85 [log] > injecting Web Worker for "main"
transmuxer-interface.ts:227 [log] > [transmuxer-interface, main]: Starting new transmux session for sn: 0 p: -1 level: 0 id: 1
        discontinuity: true
        trackSwitch: true
        contiguous: false
        accurateTimeOffset: true
        timeOffset: 0
        initSegmentChange: true
base-stream-controller.ts:385 [log] > [stream-controller]: Loaded fragment 0 of level 0
0cfd9597-8f61-4c2b-b5a1-028b044ea95d:540 [log] > Debug logs enabled for "main" in hls.js version 1.4.0
transmuxer-interface.ts:379 [log] > [mp4-remuxer]: ISGenerated flag reset
transmuxer-interface.ts:379 [log] > [mp4-remuxer]: initPTS & initDTS reset
transmuxer-interface.ts:379 [log] > [mp4-remuxer]: reset next timestamp
base-stream-controller.ts:1713 [log] > [stream-controller]: FRAG_LOADING->PARSING
stream-controller.ts:1251 [log] > [stream-controller]: Init video buffer, container:video/mp4, codecs[level/parsed]=[/avc1.640028]
buffer-controller.ts:759 [log] > [buffer-controller]: creating sourceBuffer(video/mp4;codecs=avc1.640028)
audio-stream-controller.ts:128 [log] > [audio-stream-controller]: InitPTS for cc: 0 found from main: 129754
transmuxer-interface.ts:379 [log] > [transmuxer.ts]: Flushed fragment 0 of level 0
base-stream-controller.ts:1713 [log] > [stream-controller]: PARSING->PARSED
base-stream-controller.ts:543 [log] > [stream-controller]: Buffered main sn: 0 of level 0 (frag:[0.000-8.466] > buffer:[0.000-8.466])
base-stream-controller.ts:1713 [log] > [stream-controller]: PARSED->IDLE
base-stream-controller.ts:714 [log] > [stream-controller]: Loading fragment 1 cc: 0 of [0-1203] level: 0, target: 8.466
base-stream-controller.ts:1713 [log] > [stream-controller]: IDLE->FRAG_LOADING
base-stream-controller.ts:385 [log] > [stream-controller]: Loaded fragment 1 of level 0
base-stream-controller.ts:1713 [log] > [stream-controller]: FRAG_LOADING->PARSING
transmuxer-interface.ts:379 [log] > [transmuxer.ts]: Flushed fragment 1 of level 0
base-stream-controller.ts:1713 [log] > [stream-controller]: PARSING->PARSED
base-stream-controller.ts:543 [log] > [stream-controller]: Buffered main sn: 1 of level 0 (frag:[8.467-16.349] > buffer:[0.000-16.349])
base-stream-controller.ts:1713 [log] > [stream-controller]: PARSED->IDLE
base-stream-controller.ts:714 [log] > [stream-controller]: Loading fragment 2 cc: 0 of [0-1203] level: 0, target: 16.349
base-stream-controller.ts:1713 [log] > [stream-controller]: IDLE->FRAG_LOADING
base-stream-controller.ts:385 [log] > [stream-controller]: Loaded fragment 2 of level 0
base-stream-controller.ts:1713 [log] > [stream-controller]: FRAG_LOADING->PARSING
transmuxer-interface.ts:379 [log] > [transmuxer.ts]: Flushed fragment 2 of level 0
base-stream-controller.ts:1713 [log] > [stream-controller]: PARSING->PARSED
base-stream-controller.ts:543 [log] > [stream-controller]: Buffered main sn: 2 of level 0 (frag:[16.350-21.896] > buffer:[0.000-21.896])
base-stream-controller.ts:1713 [log] > [stream-controller]: PARSED->IDLE
base-stream-controller.ts:714 [log] > [stream-controller]: Loading fragment 3 cc: 0 of [0-1203] level: 0, target: 21.896
base-stream-controller.ts:1713 [log] > [stream-controller]: IDLE->FRAG_LOADING
base-stream-controller.ts:385 [log] > [stream-controller]: Loaded fragment 3 of level 0
base-stream-controller.ts:1713 [log] > [stream-controller]: FRAG_LOADING->PARSING
transmuxer-interface.ts:379 [log] > [transmuxer.ts]: Flushed fragment 3 of level 0
base-stream-controller.ts:1713 [log] > [stream-controller]: PARSING->PARSED
base-stream-controller.ts:543 [log] > [stream-controller]: Buffered main sn: 3 of level 0 (frag:[21.897-34.367] > buffer:[0.000-34.367])
base-stream-controller.ts:1713 [log] > [stream-controller]: PARSED->IDLE
base-stream-controller.ts:714 [log] > [stream-controller]: Loading fragment 4 cc: 0 of [0-1203] level: 0, target: 34.367
base-stream-controller.ts:1713 [log] > [stream-controller]: IDLE->FRAG_LOADING
base-stream-controller.ts:385 [log] > [stream-controller]: Loaded fragment 4 of level 0
base-stream-controller.ts:1713 [log] > [stream-controller]: FRAG_LOADING->PARSING
transmuxer-interface.ts:379 [log] > [transmuxer.ts]: Flushed fragment 4 of level 0
base-stream-controller.ts:1713 [log] > [stream-controller]: PARSING->PARSED
base-stream-controller.ts:543 [log] > [stream-controller]: Buffered main sn: 4 of level 0 (frag:[34.368-40.958] > buffer:[0.000-40.958])
base-stream-controller.ts:1713 [log] > [stream-controller]: PARSED->IDLE
base-stream-controller.ts:714 [log] > [stream-controller]: Loading fragment 5 cc: 0 of [0-1203] level: 0, target: 40.958
base-stream-controller.ts:1713 [log] > [stream-controller]: IDLE->FRAG_LOADING
base-stream-controller.ts:385 [log] > [stream-controller]: Loaded fragment 5 of level 0
base-stream-controller.ts:1713 [log] > [stream-controller]: FRAG_LOADING->PARSING
transmuxer-interface.ts:379 [log] > [transmuxer.ts]: Flushed fragment 5 of level 0
base-stream-controller.ts:1713 [log] > [stream-controller]: PARSING->PARSED
base-stream-controller.ts:543 [log] > [stream-controller]: Buffered main sn: 5 of level 0 (frag:[40.958-44.044] > buffer:[0.000-44.044])
base-stream-controller.ts:1713 [log] > [stream-controller]: PARSED->IDLE
base-stream-controller.ts:714 [log] > [stream-controller]: Loading fragment 6 cc: 0 of [0-1203] level: 0, target: 44.044
base-stream-controller.ts:1713 [log] > [stream-controller]: IDLE->FRAG_LOADING
base-stream-controller.ts:385 [log] > [stream-controller]: Loaded fragment 6 of level 0
transmuxer-interface.ts:379 [warn] > AVC: 1 ms (-90dts) overlapping between fragments detected
onWorkerMessage @ transmuxer-interface.ts:379
TransmuxerInterface.onwmsg @ transmuxer-interface.ts:88
base-stream-controller.ts:1713 [log] > [stream-controller]: FRAG_LOADING->PARSING
transmuxer-interface.ts:379 [log] > [transmuxer.ts]: Flushed fragment 6 of level 0
base-stream-controller.ts:1713 [log] > [stream-controller]: PARSING->PARSED
base-stream-controller.ts:543 [log] > [stream-controller]: Buffered main sn: 6 of level 0 (frag:[44.044-50.551] > buffer:[0.000-50.550])
base-stream-controller.ts:1713 [log] > [stream-controller]: PARSED->IDLE
base-stream-controller.ts:714 [log] > [stream-controller]: Loading fragment 7 cc: 0 of [0-1203] level: 0, target: 50.551
base-stream-controller.ts:1713 [log] > [stream-controller]: IDLE->FRAG_LOADING
base-stream-controller.ts:385 [log] > [stream-controller]: Loaded fragment 7 of level 0
base-stream-controller.ts:1713 [log] > [stream-controller]: FRAG_LOADING->PARSING
transmuxer-interface.ts:379 [log] > [transmuxer.ts]: Flushed fragment 7 of level 0
base-stream-controller.ts:1713 [log] > [stream-controller]: PARSING->PARSED
base-stream-controller.ts:543 [log] > [stream-controller]: Buffered main sn: 7 of level 0 (frag:[50.551-56.265] > buffer:[0.000-56.265])
base-stream-controller.ts:1713 [log] > [stream-controller]: PARSED->IDLE
base-stream-controller.ts:714 [log] > [stream-controller]: Loading fragment 8 cc: 0 of [0-1203] level: 0, target: 56.265
base-stream-controller.ts:1713 [log] > [stream-controller]: IDLE->FRAG_LOADING
base-stream-controller.ts:385 [log] > [stream-controller]: Loaded fragment 8 of level 0
base-stream-controller.ts:1713 [log] > [stream-controller]: FRAG_LOADING->PARSING
transmuxer-interface.ts:379 [log] > [transmuxer.ts]: Flushed fragment 8 of level 0
base-stream-controller.ts:1713 [log] > [stream-controller]: PARSING->PARSED
base-stream-controller.ts:543 [log] > [stream-controller]: Buffered main sn: 8 of level 0 (frag:[56.265-66.691] > buffer:[0.000-66.691])
base-stream-controller.ts:1713 [log] > [stream-controller]: PARSED->IDLE
base-stream-controller.ts:714 [log] > [stream-controller]: Loading fragment 9 cc: 0 of [0-1203] level: 0, target: 66.691
base-stream-controller.ts:1713 [log] > [stream-controller]: IDLE->FRAG_LOADING
base-stream-controller.ts:385 [log] > [stream-controller]: Loaded fragment 9 of level 0
base-stream-controller.ts:1713 [log] > [stream-controller]: FRAG_LOADING->PARSING
transmuxer-interface.ts:379 [log] > [transmuxer.ts]: Flushed fragment 9 of level 0
base-stream-controller.ts:1713 [log] > [stream-controller]: PARSING->PARSED
base-stream-controller.ts:543 [log] > [stream-controller]: Buffered main sn: 9 of level 0 (frag:[66.692-74.407] > buffer:[0.000-74.407])
base-stream-controller.ts:1713 [log] > [stream-controller]: PARSED->IDLE
base-stream-controller.ts:714 [log] > [stream-controller]: Loading fragment 10 cc: 0 of [0-1203] level: 0, target: 74.407
base-stream-controller.ts:1713 [log] > [stream-controller]: IDLE->FRAG_LOADING
base-stream-controller.ts:385 [log] > [stream-controller]: Loaded fragment 10 of level 0
base-stream-controller.ts:1713 [log] > [stream-controller]: FRAG_LOADING->PARSING
transmuxer-interface.ts:379 [log] > [transmuxer.ts]: Flushed fragment 10 of level 0
base-stream-controller.ts:1713 [log] > [stream-controller]: PARSING->PARSED
base-stream-controller.ts:543 [log] > [stream-controller]: Buffered main sn: 10 of level 0 (frag:[74.408-81.999] > buffer:[0.000-81.999])
base-stream-controller.ts:1713 [log] > [stream-controller]: PARSED->IDLE
base-stream-controller.ts:714 [log] > [stream-controller]: Loading fragment 11 cc: 0 of [0-1203] level: 0, target: 81.999
base-stream-controller.ts:1713 [log] > [stream-controller]: IDLE->FRAG_LOADING
base-stream-controller.ts:385 [log] > [stream-controller]: Loaded fragment 11 of level 0
base-stream-controller.ts:1713 [log] > [stream-controller]: FRAG_LOADING->PARSING
transmuxer-interface.ts:379 [log] > [transmuxer.ts]: Flushed fragment 11 of level 0
base-stream-controller.ts:1713 [log] > [stream-controller]: PARSING->PARSED
base-stream-controller.ts:543 [log] > [stream-controller]: Buffered main sn: 11 of level 0 (frag:[81.999-88.421] > buffer:[0.000-88.422])
base-stream-controller.ts:1713 [log] > [stream-controller]: PARSED->IDLE
base-stream-controller.ts:714 [log] > [stream-controller]: Loading fragment 12 cc: 0 of [0-1203] level: 0, target: 88.422
base-stream-controller.ts:1713 [log] > [stream-controller]: IDLE->FRAG_LOADING
base-stream-controller.ts:385 [log] > [stream-controller]: Loaded fragment 12 of level 0
base-stream-controller.ts:1713 [log] > [stream-controller]: FRAG_LOADING->PARSING
transmuxer-interface.ts:379 [log] > [transmuxer.ts]: Flushed fragment 12 of level 0
base-stream-controller.ts:1713 [log] > [stream-controller]: PARSING->PARSED
base-stream-controller.ts:543 [log] > [stream-controller]: Buffered main sn: 12 of level 0 (frag:[88.422-91.634] > buffer:[0.000-91.634])
base-stream-controller.ts:1713 [log] > [stream-controller]: PARSED->IDLE
base-stream-controller.ts:714 [log] > [stream-controller]: Loading fragment 13 cc: 0 of [0-1203] level: 0, target: 91.634
base-stream-controller.ts:1713 [log] > [stream-controller]: IDLE->FRAG_LOADING
base-stream-controller.ts:385 [log] > [stream-controller]: Loaded fragment 13 of level 0
base-stream-controller.ts:1713 [log] > [stream-controller]: FRAG_LOADING->PARSING
transmuxer-interface.ts:379 [log] > [transmuxer.ts]: Flushed fragment 13 of level 0
base-stream-controller.ts:1713 [log] > [stream-controller]: PARSING->PARSED
base-stream-controller.ts:543 [log] > [stream-controller]: Buffered main sn: 13 of level 0 (frag:[91.633-98.182] > buffer:[0.000-98.182])
base-stream-controller.ts:1713 [log] > [stream-controller]: PARSED->IDLE
base-stream-controller.ts:714 [log] > [stream-controller]: Loading fragment 14 cc: 0 of [0-1203] level: 0, target: 98.182
base-stream-controller.ts:1713 [log] > [stream-controller]: IDLE->FRAG_LOADING
base-stream-controller.ts:385 [log] > [stream-controller]: Loaded fragment 14 of level 0
base-stream-controller.ts:1713 [log] > [stream-controller]: FRAG_LOADING->PARSING
transmuxer-interface.ts:379 [log] > [transmuxer.ts]: Flushed fragment 14 of level 0
base-stream-controller.ts:1713 [log] > [stream-controller]: PARSING->PARSED
base-stream-controller.ts:543 [log] > [stream-controller]: Buffered main sn: 14 of level 0 (frag:[98.181-106.272] > buffer:[0.000-106.273])
base-stream-controller.ts:1713 [log] > [stream-controller]: PARSED->IDLE
base-stream-controller.ts:714 [log] > [stream-controller]: Loading fragment 15 cc: 0 of [0-1203] level: 0, target: 106.273
base-stream-controller.ts:1713 [log] > [stream-controller]: IDLE->FRAG_LOADING
base-stream-controller.ts:385 [log] > [stream-controller]: Loaded fragment 15 of level 0
base-stream-controller.ts:1713 [log] > [stream-controller]: FRAG_LOADING->PARSING
transmuxer-interface.ts:379 [log] > [transmuxer.ts]: Flushed fragment 15 of level 0
base-stream-controller.ts:1713 [log] > [stream-controller]: PARSING->PARSED
base-stream-controller.ts:543 [log] > [stream-controller]: Buffered main sn: 15 of level 0 (frag:[106.273-113.364] > buffer:[0.000-113.364])
base-stream-controller.ts:1713 [log] > [stream-controller]: PARSED->IDLE
base-stream-controller.ts:714 [log] > [stream-controller]: Loading fragment 16 cc: 0 of [0-1203] level: 0, target: 113.364
base-stream-controller.ts:1713 [log] > [stream-controller]: IDLE->FRAG_LOADING
base-stream-controller.ts:385 [log] > [stream-controller]: Loaded fragment 16 of level 0
base-stream-controller.ts:1713 [log] > [stream-controller]: FRAG_LOADING->PARSING
transmuxer-interface.ts:379 [log] > [transmuxer.ts]: Flushed fragment 16 of level 0
base-stream-controller.ts:1713 [log] > [stream-controller]: PARSING->PARSED
base-stream-controller.ts:543 [log] > [stream-controller]: Buffered main sn: 16 of level 0 (frag:[113.363-119.160] > buffer:[0.000-119.160])
base-stream-controller.ts:1713 [log] > [stream-controller]: PARSED->IDLE
base-stream-controller.ts:714 [log] > [stream-controller]: Loading fragment 17 cc: 0 of [0-1203] level: 0, target: 119.16
base-stream-controller.ts:1713 [log] > [stream-controller]: IDLE->FRAG_LOADING
base-stream-controller.ts:385 [log] > [stream-controller]: Loaded fragment 17 of level 0
base-stream-controller.ts:1713 [log] > [stream-controller]: FRAG_LOADING->PARSING
transmuxer-interface.ts:379 [log] > [transmuxer.ts]: Flushed fragment 17 of level 0
base-stream-controller.ts:1713 [log] > [stream-controller]: PARSING->PARSED
base-stream-controller.ts:543 [log] > [stream-controller]: Buffered main sn: 17 of level 0 (frag:[119.161-128.461] > buffer:[0.000-128.461])
base-stream-controller.ts:1713 [log] > [stream-controller]: PARSED->IDLE
buffer-controller.ts:881 [log] > [buffer-controller]: Removing [0,0.9761270764118706] from the video SourceBuffer
base-stream-controller.ts:714 [log] > [stream-controller]: Loading fragment 13 cc: 0 of [0-1203] level: 0, target: 91.753
base-stream-controller.ts:1713 [log] > [stream-controller]: IDLE->FRAG_LOADING
transmuxer-interface.ts:227 [log] > [transmuxer-interface, main]: Starting new transmux session for sn: 13 p: -1 level: 0 id: 1
        discontinuity: false
        trackSwitch: false
        contiguous: false
        accurateTimeOffset: true
        timeOffset: 91.633
        initSegmentChange: false
base-stream-controller.ts:385 [log] > [stream-controller]: Loaded fragment 13 of level 0
transmuxer-interface.ts:379 [log] > [mp4-remuxer]: reset next timestamp
base-stream-controller.ts:1713 [log] > [stream-controller]: FRAG_LOADING->PARSING
transmuxer-interface.ts:379 [log] > [transmuxer.ts]: Flushed fragment 13 of level 0
base-stream-controller.ts:1713 [log] > [stream-controller]: PARSING->PARSED
base-stream-controller.ts:543 [log] > [stream-controller]: Buffered main sn: 13 of level 0 (frag:[91.633-98.182] > buffer:)
base-stream-controller.ts:1713 [log] > [stream-controller]: PARSED->IDLE
base-stream-controller.ts:714 [log] > [stream-controller]: Loading fragment 14 cc: 0 of [0-1203] level: 0, target: 98.181
base-stream-controller.ts:1713 [log] > [stream-controller]: IDLE->FRAG_LOADING
base-stream-controller.ts:385 [log] > [stream-controller]: Loaded fragment 14 of level 0
base-stream-controller.ts:1713 [log] > [stream-controller]: FRAG_LOADING->PARSING
transmuxer-interface.ts:379 [log] > [transmuxer.ts]: Flushed fragment 14 of level 0
base-stream-controller.ts:1713 [log] > [stream-controller]: PARSING->PARSED
base-stream-controller.ts:543 [log] > [stream-controller]: Buffered main sn: 14 of level 0 (frag:[98.181-106.272] > buffer:)
base-stream-controller.ts:1713 [log] > [stream-controller]: PARSED->IDLE
robwalch commented 1 year ago

I recommend unchecking "Auto-recover media-errors" before capturing logs, so that we only get the logs up to the point of failure.

Looks like an issue with decoding sn 13, but I can see playback issues when setting the start position to anything other than 0.

I also have tried playing the stream in Safari and while I can play past the 90 second mark, any attempt to seek breaks playback, so I'm left to assume there is something very wrong with this stream.

symit-dev commented 1 year ago

i have generated this stream file using ffmpeg all files are working fine but this file breaking playback even i retired generating stream files
Also Firefox handle it without any error or any other player like VLC ( yeah that's not browser player )

if you have any suggestion regrading ffmpeg stream generating them suggest me ffmpeg args thanks

robwalch commented 3 days ago

@symit-dev are you still able to reproduce this issue in hls.js v1.5.17 or v1.6.0-beta.1?