Subject: [Hls-interest] WebVTT spec no longer clearly defines "metadata header" (i.e. X-TIMESTAMP-MAP)

From: Ian Baker <[email-masked]>
Date: Wed, 10 Jun 2020 15:36:03 +0100

Heya,

Section 3.5 of RFC 8216 defines X-TIMESTAMP-MAP as a WebVTT "metadata
header":

> In order to synchronize timestamps between audio/video and subtitles, an
> X-TIMESTAMP-MAP metadata header SHOULD be added to each WebVTT header.
> This header maps WebVTT cue timestamps to MPEG-2 (PES) timestamps in other
> Renditions of the Variant Stream.

https://tools.ietf.org/html/rfc8216#section-3.5

But it seems WebVTT has removed "metadata header" as a concept from their
spec:
https://github.com/w3c/webvtt/commit/bf72d5be56b2abb07dff34319b13ba56b7755936

This has led to some ambiguity about exactly how the X-TIMESTAMP-MAP should
appear in the WebVTT file, especially relative to the 'WEBVTT' magic bytes.

We (ExoPlayer) recently received a request to parse this header even if it
appears on the same line as 'WEBVTT':
https://github.com/google/ExoPlayer/issues/7462#issuecomment-639182777

I asked for clarification from WebVTT, and they reckon that since they no
longer define a concept of 'WebVTT metadata header' it's up to the HLS spec
to more clearly define how this header is expected to appear:
https://github.com/w3c/webvtt/issues/485

I'm assuming (possibly wrongly!) that when this part of the HLS spec was
written the WebVTT spec contained the unambiguous definition of 'WebVTT
metadata header' which was then removed in the 2016 commit referenced above
- introducing the current ambiguity.

Would it be possible to clarify how X-TIMESTAMP-MAP should appear in WebVTT
files?

Thanks!

Ian

---

From: Roger Pantos <[email-masked]>
Date: Thu, 11 Jun 2020 10:14:31 -0700

> On Jun 10, 2020, at 7:36 AM, Ian Baker <ibaker=[email-masked]> wrote:
> 
> Heya,
> 
> Section 3.5 of RFC 8216 defines X-TIMESTAMP-MAP as a WebVTT "metadata header":
> In order to synchronize timestamps between audio/video and subtitles, an X-TIMESTAMP-MAP metadata header SHOULD be added to each WebVTT header.  This header maps WebVTT cue timestamps to MPEG-2 (PES) timestamps in other Renditions of the Variant Stream.
> https://tools.ietf.org/html/rfc8216#section-3.5 <https://tools.ietf.org/html/rfc8216#section-3.5>
> 
> But it seems WebVTT has removed "metadata header" as a concept from their spec:
> https://github.com/w3c/webvtt/commit/bf72d5be56b2abb07dff34319b13ba56b7755936 <https://github.com/w3c/webvtt/commit/bf72d5be56b2abb07dff34319b13ba56b7755936>
> 
> This has led to some ambiguity about exactly how the X-TIMESTAMP-MAP should appear in the WebVTT file, especially relative to the 'WEBVTT' magic bytes.
> 
> We (ExoPlayer) recently received a request to parse this header even if it appears on the same line as 'WEBVTT':
> https://github.com/google/ExoPlayer/issues/7462#issuecomment-639182777 <https://github.com/google/ExoPlayer/issues/7462#issuecomment-639182777>
> 
> I asked for clarification from WebVTT, and they reckon that since they no longer define a concept of 'WebVTT metadata header' it's up to the HLS spec to more clearly define how this header is expected to appear:
> https://github.com/w3c/webvtt/issues/485 <https://github.com/w3c/webvtt/issues/485>
> 
> I'm assuming (possibly wrongly!) that when this part of the HLS spec was written the WebVTT spec contained the unambiguous definition of 'WebVTT metadata header' which was then removed in the 2016 commit referenced above - introducing the current ambiguity. 
> 
> Would it be possible to clarify how X-TIMESTAMP-MAP should appear in WebVTT files?

Hello Ian. Thanks for bringing this to our attention. I think you’re right; WebVTT was added to the HLS spec in 2012. Four years later(!) when the notion of a Metadata Header (and in fact the header block) was removed from WebVTT, HLS didn’t get the memo.

As you say, the most straightforward approach is for the HLS spec to document the placement of X-TIMESTAMP-MAP explicitly. Probably along with some language indicating that it’s a legacy VTT syntax that was removed before VTT hit CR. At this point there’s probably more VTT content containing X-TIMESTAMP-MAP out there in the world than not, so we have to continue to support that syntax. 

To be clear, what HLS expects (and what the VTT spec defined prior to that 2016 change) is for the X-TIMESTAMP-MAP line to be among a set of non-blank lines immediately after the WEBVTT header line, followed by two or more line terminators, followed by the rest of the body.

Roger Pantos
Apple Inc.

> 
> Thanks!
> 
> Ian
> 
> 
> 
> -- 
> Hls-interest mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/hls-interest