w3c / imsc-hrm

IMSC Hypothetical Render Model
https://w3c.github.io/imsc-hrm/spec/imsc-hrm.html
Other
1 stars 6 forks source link

HRM imposes disproportionate cost to short gaps between ISDs #49

Closed palemieux closed 1 year ago

palemieux commented 1 year ago

To improve readability, it is common practice to leave a short gap (2-3 frames at TV fps) between successive subtitles, when the gap between the subtitles would have been less than 1 second. See, for example, https://partnerhelp.netflixstudios.com/hc/en-us/articles/360051554394-Timed-Text-Style-Guide-Subtitle-Timing-Guidelines .

In the current model, the HRM uses the duration of the resulting empty ISD as the time available to draw the next (non-empty) ISD. Because this duration is so small, documents that use the common practice above fail the HRM.

In reality, the rendering of the subtitle that follows the empty ISD should have started when the previous non-empty ISD was displayed, not when the empty ISD was displayed. More specifically, the HRM should not consider empty ISD as a distinct event, but instead coalesce it with the previous non-empty ISD so that the clearing of the root container region associated with the empty ISD is performed as part of (and at the end) of the non-empty ISD.

See sample implementation at https://github.com/sandflow/imscHRM/pull/9

See also the discussion at https://www.linkedin.com/in/simon-hailes-31a1723/recent-activity/shares/

css-meeting-bot commented 1 year ago

The Timed Text Working Group just discussed HRM imposes disproportionate cost to short gaps between ISDs w3c/imsc-hrm#49, and agreed to the following:

The full IRC log of that discussion <nigel> Subtopic: HRM imposes disproportionate cost to short gaps between ISDs w3c/imsc-hrm#49
<nigel> github: https://github.com/w3c/imsc-hrm/issues/49
<nigel> Pierre: Background - this issue has been brewing for some time.
<nigel> .. The issue is that there is in fact a practice, depending on provider, territory etc.,
<nigel> .. where if the gap between two subtitles is shorter than 1 second then it is narrowed to 2 or 3 frames
<nigel> .. at TV framerate, i.e. 20-40ms.
<nigel> .. This is for example in the Netflix guidelines.
<nigel> .. Recently there was a thread on LinkedIn, started by Simon Hailes, where he asked the question.
<nigel> -> https://www.linkedin.com/in/simon-hailes-31a1723/recent-activity/shares/ LinkedIn discussion
<nigel> Pierre: I've seen samples of this for a while. It turns out that sometimes it is an error when converting
<nigel> .. 608, but there's pretty strong evidence that there is practice to introduce that small gap.
<nigel> .. The impact on the HRM is severe because the gaps translate to very short empty ISDs.
<nigel> .. The challenge is that right now the HRM says that you start rendering a non-empty ISD at
<nigel> .. the end of the previous non-empty ISD.
<nigel> .. The issue is that a 20ms gap is too short a time to fully draw the subtitle.
<nigel> .. The rendering should really have started when the previous non-empty ISD was rendered.
<nigel> .. Currently the model assumes that empty ISDs are full subtitles, and include them in a double buffering model,
<nigel> .. and if they're very short there's not enough time.
<nigel> .. The PR suggests a trivial model where empty ISDs become part of the previous ISD, and there's just a single
<nigel> .. clear at the end of each non-empty ISD.
<nigel> .. That means that the gap issue is eliminated. I think it was introduced without knowing there is a gap.
<nigel> .. I've implemented as a PR on the open source code too.
<nigel> q+
<nigel> .. I advise people to try the revised model on their documents and report on it.
<nigel> q?
<nigel> ack nigel
<nigel> Nigel: Are you saying that a clear is implied at the end of every non-empty ISD or just the ones
<nigel> .. followed by an empty ISD?
<nigel> Pierre: All of them.
<nigel> .. It solves another problem, or addresses a weirdness in the current algorithm, where the
<nigel> .. algorithm says there is a cost in clearing the root container for every ISD but not the first one.
<nigel> .. Presumably you start with a clear root container.
<nigel> .. Of course clearing the root container at the end of the ISD removes that branch.
<atai> q+
<nigel> Nigel: There's a practice of incrementally adding words on each ISD so it may not be right to clear at the
<nigel> .. end of every ISD, only those followed by an empty ISD.
<nigel> Pierre: There was already a clear at the beginning of processing each ISD, so it's a minor change.
<nigel> ack ata
<nigel> Andreas: How you describe this, it makes sense to me Pierre.
<nigel> .. If I understand correctly I cannot imagine that any conformant documents for the previous HRM would
<nigel> .. no longer be conformant with the new HRM.
<nigel> .. Also, decoders that depend on the previous model: would they still accept this?
<nigel> .. A document that has this gap and is not currently conformant but would be conformant after this change,
<nigel> .. would it still play back okay?
<nigel> Pierre: In practice, my guess is the impact will be minimal.
<nigel> .. As part of the exit criteria we need large catalogues tested against the HRM to make sure we are
<nigel> .. not doing something crazy.
<nigel> Andreas: Are there any processors that use the HRM to validate content being received and refuse to play
<nigel> .. based on validity rather than their capabilities?
<nigel> Pierre: Never heard of that.
<nigel> Andreas: The proposed change better reflects the main purpose of the HRM. I see this as a bug fix.
<nigel> Pierre: I can't say why it was originally written this way, but it does simplify, especially from an
<nigel> .. implementation perspective, and makes it easier to implement.
<nigel> .. One note, the introduction mentions that it is used prior to distribution. I don't think
<nigel> .. player level implementation makes any sense.
<nigel> SUMMARY: Please review
<nigel> q?