xbmc / inputstream.adaptive

kodi inputstream addon for several manifest types
Other
451 stars 241 forks source link

Segmented WebVTT with metadata X-TIMESTAMP-MAP can have sync problems #876

Closed CastagnaIT closed 2 years ago

CastagnaIT commented 2 years ago

Bug report

Describe the bug

Here is a clear and concise description of what the problem is:

I have opened this Issue to keep track of the problem and for possible developments/discussions

HLS streams with segmented WebVTT tracks, can have X-TIMESTAMP-MAP values on webvtt data used to sync the subtitles with the video

X-TIMESTAMP-MAP values are handled from Kodi webvtt codec parser: https://github.com/xbmc/xbmc/blob/master/xbmc/cores/VideoPlayer/DVDCodecs/Overlay/OverlayCodecWebVTT.cpp and exacltly we adjust the start/stop pts offset here: https://github.com/xbmc/xbmc/blob/master/xbmc/cores/VideoPlayer/DVDSubtitles/webvtt/WebVTTHandler.cpp#L558-L563

But i think some other is missing, from shaka player it is possible to see some other things in offset calculation: https://github.com/google/shaka-player/blob/master/lib/text/vtt_text_parser.js#L79-L93 that we do not have, and currently i have not understand in full this

this could be the reason why subtitles are not displayed from the first file segment, start/stop subtitle data values are initially out of sync a test HLS stream is: https://s3.amazonaws.com/_bc_dml/example-content/bipbop-advanced/bipbop_16x9_variant.m3u8

Expected Behavior

Here is a clear and concise description of what was expected to happen:

Display subtitles in sync from video starts

Actual Behavior

Subtitles not displayed from video starts

Possible Fix

To investigate

To Reproduce

Steps to reproduce the behavior:

  1. Play as STRM: https://s3.amazonaws.com/_bc_dml/example-content/bipbop-advanced/bipbop_16x9_variant.m3u8

Your Environment

Used Operating system:

note: Once the issue is made we require you to update it with new information should that be required. Team Kodi will consider your problem report however, we will not make any promises the problem will be solved.

glennguy commented 2 years ago

@CastagnaIT There is an issue here https://github.com/xbmc/xbmc/blob/342ee328cef1dc8f59c9fee92ac945f6afc6497f/xbmc/cores/VideoPlayer/DVDSubtitles/webvtt/WebVTTHandler.cpp#L270-L273 with the indexes. GetMatch(1) gives the whole LOCAL string i.e LOCAL:00:19:04.000 The indexes here should be 2,3,4 not 1,2,3.

CastagnaIT commented 2 years ago

thanks i will take a look

CastagnaIT commented 2 years ago

closed the fix works