skynav / ttt

Timed Text Toolkit
BSD 2-Clause "Simplified" License
74 stars 15 forks source link

ttv validation warning when using "begin" and "dur" to specify subtitle times (IMSC 1.1) #273

Closed MsLizzie closed 4 years ago

MsLizzie commented 4 years ago

Hi again.

I believe this snippet should validate as IMSC 1.1 without errors or warnings, as it is not mandatory to specify an end time explicitly:

<p region="r1" begin="1s" dur="6s">
  <span>line 1</span><br/>
  <span>line 2</span>
</p>

However this results in the following warnings:

[W]:{file:/Users/elizabeth.stone/Downloads/duration_test.xml}:[19,11]:Timeable content '{http://www.w3.org/ns/ttml}span' is missing explicit @begin and/or @end on self or ancestor. [W]:{file:/Users/elizabeth.stone/Downloads/duration_test.xml}:[20,11]:Timeable content '{http://www.w3.org/ns/ttml}span' is missing explicit @begin and/or @end on self or ancestor. [W]:{file:/Users/elizabeth.stone/Downloads/duration_test.xml}:[18,48]:Timeable content '{http://www.w3.org/ns/ttml}p' is missing explicit @begin and/or @end on self or ancestor.

Liz

skynavga commented 4 years ago

IMSC 1.0, 1.1, etc. specify [1] that both begin and either end or dur SHOULD be specified, which, if not satisfied, translates to a warning being emitted in TTV. So you are indeed violating the SHOULD prescription of IMSC, thus the warning.

[1] https://www.w3.org/TR/2018/REC-ttml2-20181108/#styling-attribute-vocabulary

MsLizzie commented 4 years ago

So, I'm confused :-)

I read this as: Both begin and (either end or dur) SHOULD be specified = (begin and end) or (begin and dur) SHOULD be specified

So using begin and dur only DOES satisfy the condition. Also, begin and end or begin and dur are equally valid, and the only 2 useful pssoibiliies, although strictly speaking begin and end and dur would be allowed.

I still don't understand the warning for begin and dur.

Also, in the TTML2 spec, there are many examples which only use begin and dur, exactly the same as my xml snippet above.

Why you would want to use duration instead of an explicit end time is another story. I've only ever seen this in 1 real-world IMSC file!

Just trying to understand here.

Thanks

Liz

skynavga commented 4 years ago

Could you attach a minimum input file that demonstrates your problem. Thanks.

MsLizzie commented 4 years ago

Hi, sorry for the delay getting back to you. I've attached an example file that produces these warnings in the verifier:

[W]:{file:test.xml}:[58,23]:Timeable content '{http://www.w3.org/ns/ttml}span' is missing explicit @begin and/or @end on self or ancestor. [W]:{file:test.xml}:[57,62]:Timeable content '{http://www.w3.org/ns/ttml}p' is missing explicit @begin and/or @end on self or ancestor. [W]:{file:test.xml.txt}:[61,23]:Timeable content '{http://www.w3.org/ns/ttml}span' is missing explicit @begin and/or @end on self or ancestor. [W]:{file:test.xml.txt}:[60,66]:Timeable content '{http://www.w3.org/ns/ttml}p' is missing explicit @begin and/or @end on self or ancestor.

Note that you get exactly the same warnings if you remove the "dur" attributes completely, so it looks like the validator is completely ignoring duration. test.xml.zip

Thanks for your help Liz

skynavga commented 4 years ago

Thanks, I will investigate further.

cconcolato commented 4 years ago

Any update on this issue?