video.js icon indicating copy to clipboard operation
video.js copied to clipboard

Subtitles only downloading a single file

Open daveisfera opened this issue 1 year ago • 11 comments

Description

Safari and HLS.js download all of the subtitle files, but Video.js appears to only download a single file and then stop rather than downloading all of the files in the manifest

Reduced test case

https://awresports-hls-dev.s3.amazonaws.com/jccc_1_1/m3u8/2024/02/29/19/index.m3u8

Steps to reproduce

  1. Open Video.js demo page ( https://videojs-http-streaming.netlify.app/ )
  2. Add above URL
  3. Load subtitles
  4. Observe that only a single file is downloaded (and usually cancelled)

Errors

No error output is observed

What version of Video.js are you using?

8.10.0

Video.js plugins used.

No response

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

122.0.6261.94 (Official Build) (x86_64)

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

14.3.1

daveisfera avatar Mar 07 '24 21:03 daveisfera

looks like it's failing due to the use EMPTY in the vtt track. I've never seen that before.

Seems like shaka also stops loading it at the first EMPTY

gkatsev avatar Mar 07 '24 22:03 gkatsev

Do you mean that it needs an extension? I changed it to empty.vtt and it still has the same problem.

But if you referring to it being empty as a problem, then that shouldn't be the case, because it states that's possible in the spec:

A WebVTT Segment MAY contain no cues; this indicates that no subtitles are to be displayed during that period.

daveisfera avatar Mar 08 '24 00:03 daveisfera

I changed it so the first track isn't empty and it's still not loading the data, so it appears there's an issue with the handling of EXT-X-MAP or something like that

daveisfera avatar Mar 13 '24 21:03 daveisfera

@gkatsev is it possible that WebVTT EXT-X-MAP is not supported? I saw a similar issue here

coofzilla avatar Mar 14 '24 02:03 coofzilla

Definitely possible that it isn't supported. Last I checked, it seemed like it could have because the init segment gets downloaded in the vtt segment loader (https://github.com/videojs/http-streaming/blob/main/src/vtt-segment-loader.js#L82), which is where I paused my investigation last time. So, it could be downloaded but not applied as expected.

Should be fixed, though, I've rarely seen init segments used for vtt files.

gkatsev avatar Mar 14 '24 03:03 gkatsev

Is there a better way to handle having to set X-TIMESTAMP-MAP for livestreams and VODs?

Using init segments for VTT files is the best option I've found for doing that

daveisfera avatar Mar 14 '24 04:03 daveisfera

to be clear, you shouldn't need to do anything. However, to get things working now, you probably need to make sure that the VTT segments are complete and include the init the body section.

gkatsev avatar Mar 14 '24 04:03 gkatsev

Can you point me at an example that does a livestream with subtitles that doesn't use X-TIMESTAMP-MAP and an init segment with the VTT files?

daveisfera avatar Mar 14 '24 05:03 daveisfera

the timestamp map is still used, it's just in every file. For example, https://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel-multiple-subtitles.ism/.m3u8

gkatsev avatar Mar 14 '24 05:03 gkatsev

Here's 4 different versions of storing the subtitle info with X-TIMESTAMP-MAP and they all work with Safari, but only the init_header one works with Video.js: https://awresports-hls-dev.s3.amazonaws.com/jccc_1_1/m3u8/2024/02/29/19/index_init_empty.m3u8 https://awresports-hls-dev.s3.amazonaws.com/jccc_1_1/m3u8/2024/02/29/19/index_init_header.m3u8 https://awresports-hls-dev.s3.amazonaws.com/jccc_1_1/m3u8/2024/02/29/19/index_map_init.m3u8 https://awresports-hls-dev.s3.amazonaws.com/jccc_1_1/m3u8/2024/02/29/19/index_map_header.m3u8

daveisfera avatar May 16 '24 19:05 daveisfera

Here's another set of the same 4 different versions: https://awresports-hls-dev.s3.amazonaws.com/lp10_0/m3u8/2024/05/12/15/index_init_empty.m3u8 https://awresports-hls-dev.s3.amazonaws.com/lp10_0/m3u8/2024/05/12/15/index_init_header.m3u8 https://awresports-hls-dev.s3.amazonaws.com/lp10_0/m3u8/2024/05/12/15/index_map_init.m3u8 https://awresports-hls-dev.s3.amazonaws.com/lp10_0/m3u8/2024/05/12/15/index_map_header.m3u8

daveisfera avatar May 17 '24 22:05 daveisfera