Be more tolerant of bad VTT #2358
Labels
component: captions/subtitles
The issue involves captions or subtitles
component: WebVTT
The issue involves WebVTT subtitles specifically
flag: seeking PR
We are actively seeking PRs for this; we do not currently expect the core team will resolve this
priority: P4
Nice to have / wishful thinking
status: archived
Archived and locked; will not be updated
type: enhancement
New feature or request
Milestone
Have you read the FAQ and checked for duplicate open issues?
Yes
Is your feature request related to a problem? Please describe.
Small defects in a vtt file can cause the entire thing to be dropped. Specifically, linefeeds in cue text and multiple linefeeds between a cue timestamp and its text. Trying to parse such a file in the demo player results in an error
this.data_ is undefined
.I have my ever-useful two second clip demo prepared with such a vtt file. It's the Italian language.
Demo Link
The content of that vtt file is
Describe the solution you'd like
Technically a vtt file structured in this way is not compliant with the standard, yet there is much of it around due to ffmpeg. If you have extraneous linefeeds in an srt or ass file, and you ask ffmpeg to turn it into a vtt, it'll make a file that looks like the above. It would be nice if Shaka could render such files.
Describe alternatives you've considered
I have a patch in for review on the ffmpeg mailing list, but even if future files are compliant, that doesn't fix the issue for vtt files which have already been created.
Additional context
This is a feature request because I'm unsure if strict parsing was intended by the original implementer. Although other players display such malformed vtt files, they are technically not obliged to do so.
The text was updated successfully, but these errors were encountered: