WebVTT files without X-TIMESTAMP-MAP=MPEGTS have sync issues
Description
Testing an HLS Stream with WebVTT captions file that is missing a X-TIMESTAMP-MAP=MPEGTS:900000,LOCAL:00:00:00.000 entry. The captions were rendered early. I compared this to HLS.JS wich renders the captions at the correct time. Discussing with @gkatsev he asked me to open an issue.
yeah, it seems like it only applies various offsets if the timestamp map is present
6:14
it's probably a more sensible approach
6:14
can you open a ticket against VHS? And we'll be able to take a look at it, otherwise, we'll forget
Sources
Is a certain source or a certain segment affected? please provide a public (accessible over the internet) link to it below.
Steps to reproduce
Explain in detail the exact steps necessary to reproduce the issue.
- Play a file with WebVTT captions missing
X-TIMESTAMP-MAP - Toggle Captions
- Captions will not be rendered at correct time
Results
Expected
Don't apply any offsets
Error output
N/A
Additional Information
N/A
videojs-http-streaming version
Latest here: https://videojs-http-streaming.netlify.app/
videojs version
Latest here: https://videojs-http-streaming.netlify.app/
Browsers
Latest Chrome
Platforms
OS X
Other Plugins
N/A
Other JavaScript
N/A
👋 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.
Just checking if you do have any updates on this.
For me it got resolved either by:
- Adding the
X-TIMESTAMP-MAP=MPEGTS - Using this whilst transcoding https://stackoverflow.com/questions/61835223/ffmpeg-burnt-in-subtitles-out-of-sync-when-converting-to-hls/61899776#61899776
To add X-TIMESTAMP-MAP=MPEGTS with the right value, I used ffprobe:
$ ffprobe -show_frames https://website.com/video.m3u8
[FRAME]
media_type=video
stream_index=1
key_frame=1
pts=133200
pts_time=1.480000
pkt_dts=133200
pkt_dts_time=1.480000
best_effort_timestamp=133200
best_effort_timestamp_time=1.480000
pkt_duration=3600
pkt_duration_time=0.040000
pkt_pos=564
pkt_size=949
width=1280
height=720
pix_fmt=yuv420p
sample_aspect_ratio=1:1
pict_type=I
coded_picture_number=0
display_picture_number=0
interlaced_frame=0
top_field_first=0
repeat_pict=0
color_range=tv
color_space=bt709
color_primaries=bt709
color_transfer=bt709
chroma_location=left
[SIDE_DATA]
side_data_type=H.26[45] User Data Unregistered SEI message
[/SIDE_DATA]
[/FRAME]
We can see the famous 1.4 second here:
pkt_dts=133200 pkt_dts_time=1.480000
That's exactly how much my subtitles are off!
So I need to add:
WEBVTT
X-TIMESTAMP-MAP=MPEGTS:133200,LOCAL:00:00:00.000
To the top of my subtitles files and it's fixed.