videojs / video.js

Video.js - open source HTML5 video player
https://videojs.com
Other
38.02k stars 7.45k forks source link

Error: Excessive main segment downloading detected. Switching to playlist... #7842

Closed kooshiel closed 10 months ago

kooshiel commented 2 years ago

Description

My videos play just fine in Safari. But, in Chrome and Firefox, the video begins playing just fine, but then if I seek forward in the video, the playback freezes and the player spits out errors.

In Chrome and Firefox, this error shows in the browser console on initial play:

VIDEOJS: WARN: Segment with index 0 from playlist 4-https://domain.com/b.m3u8 has a duration of 95447.81368888888 when the reported duration is 4.096 and the target duration is 8. For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1

Then if I seek forward, I get this error:

VIDEOJS: WARN: Problem encountered with playlist 0-https://domain.com/d.m3u8. Excessive main segment downloading detected. Switching to playlist 1-https://domain.com/e.m3u8.

The player then switches to 3 different m3u8 files, fails to play, outputs the above error, until it gives up with this error:

VIDEOJS: ERROR: (CODE:3 MEDIA_ERR_DECODE) Playback cannot continue. No available working or supported playlists.

Reduced test case

https://codepen.io/kushiel/pen/XWENBpx

Steps to reproduce

  1. Try to play video in Chrome or Firefox
  2. Seek forward
  3. Video freezes, errors display in console

Errors

VIDEOJS: WARN: Segment with index 0 from playlist 4-https://domain.com/b.m3u8 has a duration of 95447.81368888888 when the reported duration is 4.096 and the target duration is 8. For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1

VIDEOJS: WARN: Problem encountered with playlist 0-https://domain.com/d.m3u8. Excessive main segment downloading detected. Switching to playlist 1-https://domain.com/e.m3u8.

VIDEOJS: ERROR: (CODE:3 MEDIA_ERR_DECODE) Playback cannot continue. No available working or supported playlists.

What version of Video.js are you using?

7.20.1

Video.js plugins used.

No response

What browser(s) including version(s) does this occur with?

Google Chrome 103.0.5060.114 (Official Build) (arm64) / Firefox 102.0.1 (64-bit)

What OS(es) and version(s) does this occur with?

macOS Monterey 12.4

welcome[bot] commented 2 years ago

πŸ‘‹ Thanks for opening your first issue here! πŸ‘‹

If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can. To help make it easier for us to investigate your issue, please follow the contributing guidelines.

video-archivist-bot commented 2 years ago

Hey! We've detected some video files in a comment on this issue. If you'd like to permanently archive these videos and tie them to this project, a maintainer of the project can reply to this issue with the following commands:

damanV5 commented 1 year ago

Same issue here. It happens in case of long duration videos.

misteroneill commented 1 year ago

This issue has been open for a while, but we didn't get around to investigating it yet. Thank you for providing a reduced test case, though!

Can you try it with the current version of Video.js and let us know if it's still an issue?

kooshiel commented 1 year ago

I had to move onto a different video player because of this problem. But, I just updated the above linked reduced test case on codepen to use Video.js 8.0.4 and the problem still exists. I also tried with 8.2.1 and still no luck.

JustynaGerkeTR commented 1 year ago

@misteroneill I got a similar issue, updating to newest version didn't help. Is this something being worked on?

dliebner commented 1 year ago

So this is a vjs bug and not a bug with my HLS encoder probably?

adrums86 commented 11 months ago

Currently some work being done in VHS related to this.

thomasjammet commented 11 months ago

Currently some work being done in VHS related to this.

Oh interesting, can you share about the work being done? I see it's related to this ticket : https://github.com/videojs/video.js/issues/8452

I am facing a similar issue on Chrome (Windows 10), I have an HLS stream live, it is working fine but when I click on the fullscreen button I get the same kind of warning :

VIDEOJS: WARN: Problem encountered with playlist 0-3/index.m3u8?mTrack=3&iMsn=130919&tkn=1336335399. Excessive main segment downloading detected. Switching to playlist 2-5/index.m3u8?mTrack=3&iMsn=130919&tkn=1336335399.

Sometimes it stop working completely.

ajaymiyyapuram commented 11 months ago

Our customers has encountered similar warning during a large live event, several users saw these errors starting 28th minute in livestream in 5 min window and then dropped and stayed low until end of the 2 hour long event. We looked at the upstream CDN and the packaging service and didn't notice any errors. I couldn't reproduce the issue though.

VIDEOJS:,WARN:,Segment with index 9 from playlist 0-index_131.m3u8 has a duration 
of 95449.[7176888889 (tel:7176888889) when the reported duration is 6 and the target duration is 6. 
For HLS content, a duration in excess of the target duration may result in playback issues. 
See the HLS specification section on EXT-X-TARGETDURATION for more details: 
https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1

Looking at the code the duration is retrieved from audioTimingInfo: segmentInfo.audioTimingInfo, videoTimingInfo: segmentInfo.videoTimingInfo, can this mean encoder has sent an incorrect timing info or any other issue? For some customers I didn't see the excessive main segment warning but only had above warning.

Player version: 7.20.3 , stackoverflow question

thomasjammet commented 11 months ago

Currently some work being done in VHS related to this.

Oh interesting, can you share about the work being done? I see it's related to this ticket : #8452

I am facing a similar issue on Chrome (Windows 10), I have an HLS stream live, it is working fine but when I click on the fullscreen button I get the same kind of warning :

VIDEOJS: WARN: Problem encountered with playlist 0-3/index.m3u8?mTrack=3&iMsn=130919&tkn=1336335399. Excessive main segment downloading detected. Switching to playlist 2-5/index.m3u8?mTrack=3&iMsn=130919&tkn=1336335399.

Sometimes it stop working completely.

In my case it was due to a change of source without calling player.pause(), I am not sure this is related with the above issues so. Correct way to change source without having (later) the warning "Excessive main segment downloading detected." when you switch tracks is for me :

player.pause();
player.reset();
player.src(...);
adrums86 commented 11 months ago

@thomasjammet Yeah this has been on our radar for a while, unfortunately a bit of "whack a mole" trying to fix it. This PR is our latest attempt. Feel free to test against this netlify preview build, additional feedback would be helpful for us!

video-archivist-bot commented 11 months ago

Hey! We've detected some video files in a comment on this issue. If you'd like to permanently archive these videos and tie them to this project, a maintainer of the project can reply to this issue with the following commands:

thomasjammet commented 10 months ago

@thomasjammet Yeah this has been on our radar for a while, unfortunately a bit of "whack a mole" trying to fix it. This PR is our latest attempt. Feel free to test against this netlify preview build, additional feedback would be helpful for us!

Hi @adrums86 ! Thanks for sharing! This seems to work with the playlist shared in https://github.com/videojs/video.js/issues/8452 (https://fullscreen-bug.storage.yandexcloud.net/master.m3u8). I'll try to make further test later. Is it possible to have the bundle of this PR? (including VHS and video.js)

video-archivist-bot commented 10 months ago

Hey! We've detected some video files in a comment on this issue. If you'd like to permanently archive these videos and tie them to this project, a maintainer of the project can reply to this issue with the following commands:

adrums86 commented 10 months ago

@thomasjammet Excellent news! We just released this work in v8.7.0 today.

adrums86 commented 10 months ago

This should be fixed in v8.7.0, closing.