On Fri, 14 Jan 2011 10:01:38 +0100, Silvia Pfeiffer <[email protected]> wrote:

There are two sections - the first one concerns the WebVTT format and
the second one the <track> specification.

Thanks for compiling all of this feedback, Silvia! As usual, my inline replies are sometimes terse, not to be mistaken for impatience or disrespect :)


A. Feedback on the WebVTT format

1. Introduce file-wide metadata

WebVTT requires a structure to add header-style metadata. We are here
talking about lists of name-value pairs as typically in use for header
information. The metadata can be optional, but we need a defined means
of adding them.

Required attributes in WebVTT files should be the main language in use
and the kind of data found in the WebVTT file - information that is
currently provided in the <track> element by the @srclang and @kind
attributes. These are necessary to allow the files to be interpreted
correctly by non-browser applications, for transcoding or to determine
if a file was created as a caption file or something else, in
particular the @kind=metadata. @srclang also sets the base
directionality for BiDi calculations.

Are there non-browsers that use the language for font-selection or bidi? Is auto-detection not likely to give a better user experience? Are there any other use cases for knowing the language of the captions *after* they've been opened?

Why do non-browser players need to know the kind? All kinds are processed in the same way except metadata, and there's no reason to use metadata tracks with external players.

Further metadata fields that are typically used by authors to keep
specific authoring information or usage hints are necessary, too. As
examples of current use see the format of MPlayer mpsub’s header
metadata [2], EBU STL’s General Subtitle Information block [3], and
even CEA-608’s Extended Data Service with its StartDate, Station,
Program, Category and TVRating information [4]. Rather than specifying
a specific subset of potential fields we recommend to just have the
means to provide name-value pairs and leave it to the negotiation
between the author and the publisher which fields they expect of each
other.

This approach has worked very well with Vorbis Comments, probably mostly because all interesting fields have been pre-defined in http://www.xiph.org/vorbis/doc/v-comment.html

For a web format though, wouldn't some kind of wiki registry be good to avoid total mayhem, especially if there are some predefined fields? (Not having file-wide metadata would also avoid such mayhem.)


2. Introduce file-wide cue settings

At the moment if authors want to change the default display of cues,
they can only set them per cue (with the D:, S:, L:, A: and T:. cue
settings) or have to use an external CSS file through a HTML page with
the ::cue pseudo-element. In particular when considering that all
Asian language files would require a “D:vertical” marker, it becomes
obvious that this replication of information in every cue is
inefficient and a waste of bandwidth, storage, and application speed.
A cue setting default section should be introduced into a file
header/setup area of WebVTT which will avoid such replication.

An example document with cue setting defaults in the header could look
as follows:
==
WEBVTT
Language=zh
Kind=Caption
CueSettings= A:end D:vertical

00:00:15.000 --> 00:00:17.950
在左边我们可以看到...

00:00:18.160 --> 00:00:20.080
在右边我们可以看到...

00:00:20.110 --> 00:00:21.960
...捕蝇草械.
==

Note that you might consider that the solution to this problem is to
use external CSS to specify a change to all cues. However, this is not
acceptable for non-browser applications and therefore not an
acceptable solution to this problem.

Indeed, repeating settings on each cue would be annoying. However, file-wide settings seems like it would easily be too broad, and you'd have to explicitly reverse the effect on the cues where you don't want it to apply. Maybe classes of cue settings or some kind of macros would work better.

Nitpick: Modern Chinese, including captions, is written left-to-right, top-to-bottom, just like English.


3. Cue settings requirements

* naming: The usage of single letter abbreviations for cue settings
has created quite a discussion here at Google. We all agree that
file-wide cue settings are required and that this will reduce the need
for cue-specific cue settings. We can thus afford a bit more
readability in the cue settings. We therefore believe that it would be
better if the cue settings were short names rather than single letter
codes. This would be more like CSS, too, and easier to learn and get
right. In the interface description, the 5 dimensions have proper
names which could be re-used (“direction”, “linePosition”,
“textPosition”, “size” and “align"). We therefore recommend replacing
the single-letter cue commands with these longer names.

An example document with more verbose cue settings could look as follows:
==
WEBVTT
Language=zh
Kind=Caption
CueSettings= align:end direction:vertical

00:00:15.000 --> 00:00:17.950 linePosition:80%
在左边我们可以看到...

00:00:18.160 --> 00:00:20.080
在右边我们可以看到...

00:00:20.110 --> 00:00:21.960 size:70%
...捕蝇草械.
==

I agree, every time I see the single-letter settings I have to go look at the spec to figure out what they mean. I'd be happy to have more explicit names. I'd be even happier if they match CSS terminology where possible.


4. Cue formatting requirements

In analysing the available cue formatting functionality, we have found
that some features are missing. Most of these features can be added
through using CSS on cues that have received a <b>, <i>, <c> or <v>
marker. The following features are core to traditional TV and exist in
EBU STL and CEA-608/708 captions. Support of these will be a core
requirement for browsers as well as non-browser applications and it
makes sense to add these to WebVTT rather than relying on external CSS
which cannot be used for non-browser captions:

The unstated requirement here seems to be that WebVTT needs to work as an interchange format for various TV captioning formats even in user agents without any support for CSS (or JavaScript). I'm trying to not make a straw man argument, but if want an interchange format, we should pick TTML, which is explicitly designed to be just that and doesn't depend on CSS.

Is it not enough that a lossy conversion can be made from various formats into WebVTT+CSS(+JavaScript)? If not, the "Web" in "WebVTT" is highly misleading...

* textcolor: In particular on European TV it is common to distinguish
between speakers by giving their speech different colors. The
following colors are supported by EBU STL, CEA-608 and CEA-708 and
should be supported in WebVTT without the use of external CSS: black,
red, green, yellow, blue, magenta, cyan, and white. As default we
recommend white on a grey transparent background.

What's wrong with <v Speaker>? If a completely automatic conversion is needed, why not <c.yellow>...</c>? Both methods have the distinct advantage of making it easy to change or disable the colors with only CSS changes.

* underline: EBU STL, CEA-608 and CEA-708 support underlining of
characters. The underline character is also particularly important for
some Asian languages. Please make it possible to provide text
underlines without the use of CSS in WebVTT.

Which Asian languages? If it's just the Chinese <http://en.wikipedia.org/wiki/Proper_name_mark>, then I don't think that needs <u> or similar. In my experience, use of the Chinese proper name mark is in fact extremely rare in Chinese captions, at least in movies and TV series from the mainland and Taiwan. It would be best to use e.g. 我來自<c.pnm>中國</c> to make it easy to change the style between single/double/wavy/no underline.

* blink: As much as we would like to discourage blinking subtitles,
they are actually a core requirement for EBU STL and CEA-608/708
captions and in use in particular for emergency messages and similar
highly important information. Blinking can be considered optional for
implementation, but we should allow for it in the standard.

00:00.000 --> 00:00.500
blinking

00:01.000 --> 00:02.500
blinking

00:02.000 --> 00:02.500
blinking

Is that enough? In the context of the web there are much better ways to convey very import information than through blinking captions. Event alert() would be better.

* font face: CEA-708 provides a choice of eight font tags: undefined,
monospaced serif, proportional serif, monospaced sans serif,
proportional sans serif, casual, cursive, small capital. These fonts
should be available for WebVTT as well. Is this the case?

Does the choice of font ever carry any semantic meaning? Isn't it a good thing that captions can't specify their own fonts, so that it's easy to pick a style that's suitable for the embedding site?

[On a side note, we wonder if it would make sense to introduce an
@kind=”annotation” type of TimedText track, which can then allow full
innerHTML markup be rendered on top of the video viewport. This would
probably need to be matched with full CSS support, too. It would allow
people to introduce unconventional caption display such as captions in
speech bubbles that can track the characters as they move or know
about what important objects are on the screen, so never overlap them.
Note that script in innerHTML needs to be dealt with carefully to
avoid XSS attacks. @kind=”annotation” is not required for ordinary
captions, so we have not investigated this need in full detail.]

Won't Implement ;) For reasons already discussed at length, I think HTML in captions is a bad idea. Having *both* WebVTT cue text parsing and innerHTML parsing would be even more complicated, though.


5. Markup changes

We have a couple of recommendations for changes mostly for aesthetic
and efficiency reasons. We would like to point out that Google is very
concerned with the dense specification of data and every surplus
character, in particular if it is repeated a lot and doesn’t fulfill a
need, should be removed to reduce the load created on worldwide
networking and storage infrastructures and help render Web pages
faster.

Nipick: Is network load really an issue here? Compared to the video files they accompany, caption files are tiny, even more so with gzip/deflate.

* Time markers: WebVTT time stamps follow no existing standard for
time markers. Has the use of NPT as introduced by RTSP[5] for time
markers been considered (in particular npt-hhmmss)?

[5] http://www.ietf.org/rfc/rfc2326.txt

Unfortunately, the hour component is not optional in NPT. Also, the decimal part of seconds is of arbitrary precision, which doesn't seem necessary.

* Suggest dropping “-->”: In the context of HTML, “-->” is an end
comment marker. It may confuse Web developers and parsers if such a
sign is used as a separator. For example, some translation tools
expect HTML or XML-based interchange formats and interpret the “>” as
part of a tag. Also, common caption convention often uses “>” to
represent speaker identification. Thus it is more difficult to write a
filter which correctly escapes “-->” but retains “>” for speaker ID.

Trying to use an HTML or XML parser to make any sense of WebVTT is going to fail horrendously in any case, so if anything I think it's good that they fail early. Also, a translation tool that has no concept of WebVTT is going to make a mess of various magic strings used in the file format too.

Since the “-->” characters serve no obvious purpose, it should be
possible to safely replace them by a blank that separates start and
end time, thus making the format denser and removing annoying parsing
issues. (Or alternatively use a the npt-range spec of RTSP for time
ranges, which uses “-” as a separator.).

No strong opinion, but I think a non-blank separator is more aesthetically pleasing.

* Duration specification: WebVTT time stamps are always absolute time
stamps calculated in relation to the base time of synchronisation with
the media resource. While this is simple to deal with for machines, it
is much easier for hand-created captions to deal with relative time
stamps for cue end times and for the timestamp markers within cues.
Cue start times should continue to stay absolute time stamps.
Timestamp markers within cues should be relative to the cue start
time. Cue end times should be possible to be specified either as
absolute or relative timestamps. The relative time stamps could be
specified through a prefix of “+” in front of a “ss.mmm” second and
millisecond specification. These are not only simpler to read and
author, but are also more compact and therefore create smaller files.

An example document with relative timestamps is:
==
WEBVTT
Language=en
Kind=Subtitle

00:00:15.000   +2.950
At the left we can see...

00:00:18.160    +1.920
At the right we can see the...

00:00:20.110   +1.850
...the <+0.400>head-<+0.800>snarlers
==

I rather like it, although it might be confusing if "-" means "to absolute time" and "+" means "to relative time". That the intra-cue timings are relative but the timing lines are absolute has bugged me a bit, so if the distinction was more obvious just from the syntax, that'd be great!


6. Format identifier

We are happy to see the introduction of  the magic file identifier for
WebVTT which will make it easier to identify the file format. We do
not believe the “FILE” part of the string is necessary.

I agree, mostly because it's ugly. While we're bikeshedding, "WebSRT" is prettier than "WEBSRT".

However, we
recommend to also introduce a format version number that the file
adheres to, e.g. “WEBVTT 0.7”. This helps to make non-browser systems
that parse such files become aware of format changes. It can also help
identify proprietary standard metadata sets as used by a specific
company, such as “WEBVTT 0.7 ABC-meta1” which could signify that the
file adheres to WEBVTT 0.7 format specification with the ABC-meta1
metadata schema. Parsers are then made aware of what fields to expect
and can alert human operators of unexpected fields or markup.

Browsers can safely ignore such a marker and instead do a best effort
on parsing based on what they understand.

I strongly disagree, WebVTT shouldn't have a version indicator for the same reasons that HTML, CSS and JavaScript don't. Making proprietary extensions easier to maintain should be an anti-goal.


7. Comments

we recommend the introduction of comments.

I agree and think it needs to happen before WebVTT starts to get implemented and used on the web. In other words: now.


8. Line wrapping

CEA-708 captions support automatic line wrapping in a more
sophisticated way than WebVTT -- see
http://en.wikipedia.org/wiki/CEA-708#Word_wrap.

In our experience with YouTube we have found that in certain
situations this type of automatic line wrapping is very useful.
Captions that were authored for display in a full-screen video may
contain too many words to be displayed fully within the actual video
presentation (note that mobile / desktop / internet TV devices may
each have a different amount of space available, and embedded videos
may be of arbitrary sizes). Furthermore, user-selected fonts or font
sizes may be larger than expected, especially for viewers who need
larger print.

WebVTT as currently specified wraps text at the edge of their
containing blocks, regardless of the value of the 'white-space'
property, even if doing so requires splitting a word where there is no
line breaking opportunity. This will tend to create poor quality
captions.  For languages where it makes sense, line wrapping should
only be possible at carriage return, space, or hyphen characters, but
not on &nbsp; characters.  (Note that CEA-708 also contains
non-breaking space and non-breaking transparent space characters to
help control wrapping.)However, this algorithm will not necessarily
work for all languages.

We therefore suggest that a better solution for line wrapping would be
to use the existing line wrapping algorithms of browsers, which are
presumably already language-sensitive.

[Note: the YouTube line wrapping algorithm goes even further by
splitting single caption cues into multiple cues if there is too much
text to reasonably fit within the area. YouTube then adjusts the times
of these caption cues so they appear sequentially.  Perhaps this could
be mentioned as another option for server-side tools.]

Yeah, with SRT people are manually line-wrapping when authoring the captions and often enough the end result is that you get something rendered:

- Who could have guessed that not all fonts are the same
size?
- That's news to me, so I get four lines of text where I
wanted two!

I'm inclined to say that we should normalize all whitespace during parsing and not have explicit line breaks at all. If people really want two lines, they should use two cues. In practice, I don't know how well that would fare, though. What other solutions are there?


B. Feedback on the <track> element


1. Pop-on/paint-on/roll-up support

Three different types of captions are common on TV: pop-on, roll-up
and paint-on. Captions according to CEA-608/708 need to support
captions of all three of these types. We believe they are already
supported in WebVTT, but see a need to re-confirm.

The underlying use case here is live captioning, right? Just copying the styling used on broadcast TV seems like it wouldn't be enough, you also need the ability to erase typos, right? Are there any existing captioning formats that handle live captioning well from which one could draw inspiration?


2. Duplicate track

The HTML spec specifies that it is not allowed to have two tracks that
provide the same kind of data for the same language (potentially
empty) and for the same label (potentially empty). However, we need
clarification on what happens if there is a duplicate track, ie: does
the most recent one win or the first one or will both be made
available in the UI and JavaScript? The spec only states that the
combination of {kind, type, label} must be unique. It doesn't say what
happens if they are not.

In <http://whatwg.org/html#sourcing-out-of-band-text-tracks> all track are added to the list of text tracks, even duplicates.

In other words, it's just a requirement for validators, not user agents.

Further, the spec says nothing about duplicate labels altogether -
what is a browser supposed to do when two tracks have been marked with
the same label?

We'd show the same text in the context menu and let the user be confused, I guess. It's very easy for authors who care about not confusing their users to fix, so I don't think browsers need to be clever here.


4. Addressing individual cues through CSS

As far as we understand, you can currently address all cues through
::cue and you can address a cue part through ::cue-part(<voice> ||
<part> || <position> || <future-compatibility>). However, if we
understand correctly, it doesn’t seem to be possible to address an
individual cue through CSS, even though cues have individual
identifiers. This is either an oversight or a misunderstanding on our
parts. Can you please clarify how it is possible to address an
individual cue through CSS?

Since I've been arguing against the id's in WebVTT, I'm curious about the use case here. Isn't using a unique class good enough?


5. Ability to move captions out of the way

Our experience with automated caption creation and positioning on
YouTube indicates that it is almost impossible to always place the
captions out of the way of where a user may be interested to look at.
We therefore allow users to dynamically move the caption rendering
area to a different viewport position to reveal what is underneath. We
recommend such drag-and-drop functionality also be made available for
TimedTrack captions on the Web, especially when no specific
positioning information is provided.

This would indeed be rather nice, but wouldn't it interfere with text selection? Detaching the captions into a floating, draggable window via the context menu would be a theoretically possible solution, but that's getting rather far ahead of ourselves before we have basic captioning support.

--
Philip Jägenstedt
Core Developer
Opera Software

Reply via email to