WEBVTT doesn't support magic-less metadata headers
|Reported by:||mid-kid||Owned by:|
|Blocking:||Reproduced by developer:||no|
|Analyzed by developer:||no|
FFmpeg version: 4.3.1
WEBVTT is a weird format, but I just encountered a file that is written like:
Region: id=r1 width=100% lines=3 regionanchor=0%,96% viewportanchor=0%,100% scroll=none
Region: id=r2 width=100% lines=1 regionanchor=0%,96% viewportanchor=0%,100% scroll=none
00:00:01.240 --> 00:00:13.200 region:r1 line:88% align:left
FFmpeg interprets the block with the "Region:" metadata as a cue, due to being separated with two newlines from the "WEBVTT" magic, and the block not starting with "NOTE" (libavformat/webvttdec.c). This causes the subtitles not to show up in the MPV video player at all. Removing this extra newline between the magic and the region metadata solves the issue, but let's assume I can't modify these subtitle files.
According to the spec, a webvtt file starts the magic, followed by optionally a tab or space, any additional characters, and *one or more line terminators*. This can be followed by zero or more metadata headers, which consist of a name, a colon, and a value.
Unless I missed something, I believe these files are according to spec, and ffmpeg should be fixed to support this.