question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Broken] Wrong timestamps on WebVTT parsed subtitles

See original GitHub issue

Checklist

  • I’m reporting a broken site support issue
  • I’ve verified that I’m running yt-dlp version 2021.07.07
  • I’ve checked that all provided URLs are alive and playable in a browser
  • I’ve checked that all URLs and arguments with special characters are properly quoted or escaped
  • I’ve searched the bugtracker for similar bug reports including closed ones
  • I’ve read bugs section in FAQ

Verbose log

[debug] Command-line config: ['--write-subs', '--skip-download', '-v', 'https://devstreaming-cdn.apple.com/videos/streaming/examples/img_bipbop_adv_example_ts/master.m3u8']
[debug] Encodings: locale cp1252, fs utf-8, out utf-8, pref cp1252
[debug] yt-dlp version 2021.07.07 (exe)
[debug] Plugin Extractors: ['SamplePlugin']
[debug] Python version 3.8.10 (CPython 64bit) - Windows-10-10.0.19043-SP0
[debug] exe versions: ffmpeg 2021-06-09-git-e01bf559df-full_build-www.gyan.dev, ffprobe 2021-06-09-git-e01bf559df-full_build-www.gyan.dev
[debug] Proxy map: {}
[debug] [generic] Extracting URL: https://devstreaming-cdn.apple.com/videos/streaming/examples/img_bipbop_adv_example_ts/master.m3u8
[generic] master: Requesting header
[generic] master: Downloading m3u8 information
[debug] Formats sorted by: hasvid, ie_pref, lang, quality, res, fps, vcodec:vp9.2(10), acodec, filesize, fs_approx, tbr, vbr, abr, asr, proto, vext, aext, hasaud, source, id
[debug] Downloading subtitles: en
[debug] Default format spec: bestvideo*+bestaudio/best
[info] master: Downloading 1 format(s): 8366+aud3-English
[info] Writing video subtitles to: master [master].en.vtt
[debug] Invoking downloader on "https://devstreaming-cdn.apple.com/videos/streaming/examples/img_bipbop_adv_example_ts/s1/en/prog_index.m3u8"
[hlsnative] Downloading m3u8 manifest
[hlsnative] Total fragments: 100
[download] Destination: master [master].en.vtt
[download] 100% of 29.83KiB in 02:02

Description

Parsed WebVTT subtitles have the wrong timestamps. Expected (not parsed):

WEBVTT
X-TIMESTAMP-MAP=MPEGTS:900000,LOCAL:00:00:00.000

1
00:00:00.008 --> 00:00:00.992
Subtitles: Bip!

2
00:00:01.000 --> 00:00:01.992
Subtitles: Bop!

3
00:00:02.000 --> 00:00:02.992
Subtitles: Bip!

4
00:00:03.000 --> 00:00:03.992
Subtitles: Bop!

...

Got:

WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

1
08:00:00.000 --> 32:00:16.000
Subtitles: Bip!

2
00:00:00.001 --> 32:00:16.001
Subtitles: Bop!

3
00:00:00.002 --> 32:00:16.002
Subtitles: Bip!

4
00:00:00.003 --> 32:00:16.003
Subtitles: Bop!

...

Also observed in: https://www.vidio.com/watch/2234540-stand-by-me-doraemon-2 (geolocked and paywalled, verified by me) https://roosterteeth.com/watch/gen-lock-season-1-1 (semi-geolocked, verified by XMarksTheSpot (discord), @nao20010128nao, and me)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
fstirlitzcommented, Jul 10, 2021

Confirmed. And I even know where the bug is:

https://github.com/yt-dlp/yt-dlp/blob/73d829c144601c105f7ee1a3d8f2aed6d8e1b76d/yt_dlp/webvtt.py#L125-L127

The variables on the LHS should be swapped.

(I guess I should have followed https://github.com/yt-dlp/yt-dlp/pull/247#discussion_r619641163 after all.)

0reactions
pukkandancommented, Jul 11, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

[Broken] webvtt parser error in PBS subtitles #921 - GitHub
There are two places where our current parser is failing with PBS subtitles. X-TIMESTAMP-MAP=MPEGTS:198018, LOCAL:00:00:00.000. When parsing ...
Read more >
WebVTT subtitle cues after the first hour are missing ... - GitLab
Any WebVTT subtitle cues that occur after the first hour are missing from the merged output. The expected correct behavior would be to...
Read more >
WebVTT: The Web Video Text Tracks Format - W3C
Abstract. This specification defines WebVTT, the Web Video Text Tracks format. Its main use is for marking up external text track resources ...
Read more >
Web Video Text Tracks Format (WebVTT) - Web APIs | MDN
Web Video Text Tracks Format (WebVTT) is a format for displaying timed text tracks (such as subtitles or captions) using the element.
Read more >
WebVtt subtitles not displaying( not working) - Stack Overflow
I am using demo player and ExtractorRendererBuilder to stream a video from url which is working fine but when I pass webVtt url...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found