Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

subtitle stream controller seems to break when loadSource is called a second time on a single hls.js instance #4089

Closed
2 tasks
MasterEvilAce opened this issue Jun 23, 2021 · 6 comments
Labels

Comments

@MasterEvilAce
Copy link

MasterEvilAce commented Jun 23, 2021

What version of Hls.js are you using?

1.0.7 (but issue seems to affect entire 1.0.0+ branch?)

What browser and OS (including versions) are you using?

Brave Browser 1.25.73 Chromium 91.0.4472.106 (64 bit)
(Seems not browser specific as I can replicate this in Firefox)

Test stream:

Configuration:

ONE hls.js instance
two different playlists which both include subtitles

const hls = new Hls({
debug: true,
autoStartLoad: false,

backBufferLength: 30,
maxBufferLength: 60,
maxMaxBufferLength: 120,

});

Checklist

  • [ 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

Steps to reproduce

  1. Create one hls.js instance with autoStart=false
  2. for the first playlist call loadSource(url). then startLoad(0). then video.play(). (this is my specific implementation.. unsure if happens with autoStart, etc)
  3. do the same as step handle xhr timeout and i/o errors #2, except with the second playlist. (NOTE: I have only tested this AFTER the first playlist has ended completely.)

Expected behavior

Subtitles load and display for both playlists

Actual behavior

The first playlist loads subtitle fragments as expected. The subtitles display as expected.

When loadSource is called again with the second playlist, the SUBTITLE playlist is loaded, as is the FIRST subtitle fragment. No other fragments are ever loaded or displayed on the second playlist (or any playlist after.)

I can also confirm that the hls instance's subtitleTracks is populated, and that subtitleTrack=0 (the first track.) Toggling subtitleTrack to -1 and back to 0 does not fix the issue or seem to do anything at all.
Seeking around by setting videoElement.currentTime does not trigger subtitles to start loading, again.

I am confirming that no network requests are being made via chrome dev tools' network tab. The subtitle controller is just not requesting the fragments?

Console output

Console output is as expected.. there are no errors. But after the first subtitle fragment is loaded for the second playlist, the subtitle controller seems to not report anything at all.

For media errors reported on Chrome browser, please also paste the output of chrome://media-internals
@MasterEvilAce
Copy link
Author

MasterEvilAce commented Aug 30, 2021

This still exists even in 1.0.10. (apparently it exists in 0.15 alpha2 canary builds as well, but I did not bother debugging events)
I am not intimately familiar with the flow of processing, but I can confirm a few more things.

After we loadSource and play the second playlist...

SUBTITLE_TRACKS_UPDATED is triggered
SUBTITLE_TRACK_LOADED for subtitle playlist
FRAG_LOADED for first subtitle fragment
SUBTITLE_FRAG_PROCESSED is NOT triggered
no further FRAG_LOADED for subtitle fragments happens

Playlist plays completely fine, just without subtitles. There is nothing wrong with HLS playlists themselves, as they play perfectly fine as long as they are the first loadSource for an HLS instance. Reusing an existing HLS instance causes this problem. I even call hls.stopLoad() inbetween playlists, but it doesn't matter.

@SivanA-Kaltura
Copy link
Contributor

SivanA-Kaltura commented Feb 17, 2022

@MasterEvilAce Do the m3u8 files you use have a different order for the subtitle tracks ? If so, then this is similar to an issue I'm seeing as well

@MasterEvilAce
Copy link
Author

No? All playlists have one subtitle track. All HLS playlists start at 0-index segments that are 6s each. Still happens with 1.1.4. Only solution I've found is to create a new HLS instance from scratch for each video. Other than this I have not noticed any issues with re-using the same HLS instance for multiple videos... but it's a pretty big issue if subtitles are important.

@SivanA-Kaltura
Copy link
Contributor

Seems like a different issue than mine then. Thanks.

@stale
Copy link

stale bot commented Apr 17, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the Stale label Apr 17, 2022
@stale
Copy link

stale bot commented Apr 30, 2022

This issue has been automatically closed because it has not had recent activity. If this issue is still valid, please ping a maintainer and ask them to label it accordingly.

@stale stale bot closed this as completed Apr 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants