[whatwg] Fwd: Discussing WebSRT and alternatives/improvements
philipj at opera.com
Wed Aug 11 08:26:33 PDT 2010
On Wed, 11 Aug 2010 15:38:32 +0200, Silvia Pfeiffer
<silviapfeiffer1 at gmail.com> wrote:
> On Wed, Aug 11, 2010 at 10:30 PM, Philip Jägenstedt
> <philipj at opera.com>wrote:
>> On Wed, 11 Aug 2010 01:43:01 +0200, Silvia Pfeiffer <
>> silviapfeiffer1 at gmail.com> wrote:
>> On Tue, Aug 10, 2010 at 7:49 PM, Philip Jägenstedt <philipj at opera.com
>>> I have checked the parse spec and
>>> implies that a tag starting with a number is a parse error. Both, the
>>> timestamps and the voice markers thus seem problems when going with an
>>> innerHTML parser. Is there a way to resolve this? I mean: I'd quite
>>> drop the voice markers for a <span @class> but I am not sure what to do
>>> about the timestamps. We could do what I did in WMML and introduce a
>>> element with the timestamp as a @at attribute, but that is again more
>>> verbose. We could also introduce an @at attribute in <span> which would
>>> at least end up in the DOM and can be dealt with specially.
>> What should numerical voices be replaced with? Personally I'd much
>> write <philip> and <silvia> to mark up a conversation between us two,
>> as I
>> think it'd be quite hard to keep track of the numbers if editing
>> with many different speakers. However, going with that and using an HTML
>> parser is quite a hack. Names like <mark> and <li> may already have
>> parsing rules or default CSS.
> In HTML it is <span class="philip">..</span> and <span
> class="silvia">...</span>. I don't see anything wrong with that. And it's
> only marginally longer than <philip> ... </philip> and
>> Going with HTML in the cues, we either have to drop voices and inner
>> timestamps or invent new markup, as HTML can't express either. I don't
>> either of those are really good solutions, so right now I'm not
>> that reusing the innerHTML parser is a good way forward.
> I don't see a need for the voices - they already have markup in HTML, see
> above. But I do wonder about the timestamps. I'd much rather keep the
> innerHTML parser if we can, but I don't know enough about how the
> could be introduced in a non-breakable manner. Maybe with a data-
> Maybe <span data-t="00:00:02.100">...</span>?
data- attributes are reserved for use by scripts on the same page, but we
*could* of course introduce new elements or attributes for this purpose.
However, adding features to HTML only for use in WebSRT seems a bit odd.
>> That would make text/srt and text/websrt synonymous, which is kind of
>>> No, it's only pointless if you are a browser vendor. For everyone else
>>> a huge advantage to be able to choose between a guaranteed simple
>>> a complex format with all the bells and whistles.
>>> The advantages of taking text/srt is that all existing software to
>>>> SRT can be used to create WebSRT
>>> That's not strictly true. If they load a WebSRT file that was created
>>> some other software for further editing and that WebSRT file uses
>>> WebSRT functionality, the authoring software will break.
>> Right, especially settings appended after the timestamps are quite
>> to be stripped when saving the file.
> Or may even break the software if it's badly implemented, or may end up
> inside the cue text - just like the other control instructions which will
> end up as plain text inside the cue. You won't believe how many people
> pointed out to me that my SRT test parser exposed an <i> tag markup in
> cue text rather than interpreting it, when I was experimenting with
> SRT cues in a HTML div without touching the cue text content. Extraneous
> markup is really annoying.
Indeed, but given the option of seeing no subtitles at all and seeing some
markup from time to time, which do you prefer? For a long time I was using
a media player that didn't handle "HTML" in SRT and wasn't very amused at
seeing <i> and similar, but it was sure better than no subtitles at all. I
doubt it will take long for popular software to start ignoring things
trailing the timestamp and things in square brackets, which is all you
need for basic "compatibility". Some of the tested software already does
>> and servers that already send text/srt don't need to be updated. In
>>>> case I think we should support only one mime type.
>>> What's the harm in supporting two mime types but using the same parser
>>> parse them?
>> Most content will most likely be plain old SRT without voices, <ruby> or
>> similar. People will create them using existing software with the .srt
>> extension and serve them using the text/srt MIME type. When they later
>> decide to add some <ruby> or similar, it will just work without
>> changing the
>> extension or MIME type. The net result is that text/srt and text/websrt
>> exactly the same thing, making it a wasted effort.
> From a Web browser perspective, yes. But not from a caption authoring
> perspective. At first, I would author a SRT file. Later, I want to add
> fancy stuff. So, I load it into the application again. Then I add the
> stuff. It tells me that I cannot save it as SRT, but have to save it as
> WebSRT, so I don't lose the information. Good! Now, the pipeline that I
> set up for SRT files transcoding and burning onto video and which cannot
> deal with WebSRT will not accept the WebSRT file. Good again! Makes me
> extend my pipeline or go to the provider and upgrade my software, so I
> the full feature support and the correct rendering. Excellent.
I think that as long as WebSRT is mostly compatible with SRT then people
will keep using SRT tools, with the occasional mishap and disaster. I
won't deny that it breaks expectations of what SRT is, but the alternative
is to make WebSRT fundamentally incompatible so that not even media
frameworks that rely on sniffing would treat it as SRT. However, unless
<track> is a complete failure other applications will eventually want to
support the format that browsers support, so inventing something
completely new has a high cost too.
Since browser vendors get all the benefits and none of the problems it
would be a mistake to only listen to us, of course. It might be worthwhile
contacting developers of applications like VLC, Totem or MPlayer and ask
precisely how annoyed they would be if suddenly one day they had to tweak
their SRT parser because of WebSRT.
>>> Do you find MPlayer's behavior annoying because by rescaling already
>>> rendered text, the text loses resolution and becomes less readable?
>>> definitely not the behaviour I am after.
>> Scaling with the video is annoying with small videos, as the text ends
>> being huge in fullscreen. I assume we're going to do scaling as well as
>> can, so that's not an argument in either direction.
>> I'll have to withdraw any opinion for now, I don't know how to best deal
>> with this.
> Yes, I can imagine that on small video it's bad to scale the text down
> the video, since it becomes unreadable. I thought that a solution would
> to define the screen size for which the text was written and then scale
> text with the video. But maybe there is a function that needs to be
> where there is a minimum font size below which one cannot go and a
> font size above which it's bad, too. It seems that scaling text at the
> rate as video is not appropriate. I wonder if there is an optimal
> that people have found to be best? Worth doing some experiments I guess.
A bit of a guess, but perhaps some combination of CSS3's calc(), min() and
max() could help. If there's some particularly suitable formula, perhaps
it could even be made part of the default stylesheet.
More information about the whatwg