Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add subtitle->audio track linking #471

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions ebml_matroska.xml
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,15 @@ The format depends on the `ChapProcessCodecID` used; see (#chapprocesscodecid-el
<documentation lang="en" purpose="definition">Specifies a chapter edition UID to which this `TrackTranslate` applies.</documentation>
<documentation lang="en" purpose="usage notes">When no `TrackTranslateEditionUID` is specified in the `TrackTranslate`, the `TrackTranslate` applies to all chapter editions found in the `Segment` using the given `TrackTranslateCodec`.</documentation>
</element>
<element name="TrackLinks" path="\Segment\Tracks\TrackEntry\TrackLinks" id="0x6FAC" type="master" minver="5" maxOccurs="1">
<documentation lang="en" purpose="definition">List of associated audio tracks for a given subtitle track.</documentation>
<documentation lang="en" purpose="usage notes">The parent `TrackEntry` **MUST** have a TrackType of `subtitle`.</documentation>
</element>
<element name="TrackLink" path="\Segment\Tracks\TrackEntry\TrackLinks\TrackLink" id="0x6FAD" minver="5" minOccurs="1" type="uinteger">
<documentation lang="en" purpose="definition">Specify that a subtitle track is suitable for use with the audio Track UID specified (in the u-integer).</documentation>
<documentation lang="en" purpose="usage notes">The value **MUST** match the `UID` value of an audio track found in this `Segment`.
Multiple subtitle tracks may link to the same audio track, and the same subtitle track may link to multiple audio tracks by providing multiple TrackLink elements.</documentation>
</element>
<element name="Video" path="\Segment\Tracks\TrackEntry\Video" id="0xE0" type="master" maxOccurs="1">
<documentation lang="en" purpose="definition">Video settings.</documentation>
<extension type="libmatroska" cppname="TrackVideo"/>
Expand Down
23 changes: 23 additions & 0 deletions notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -1093,6 +1093,27 @@ An overlay track **SHOULD** be rendered in the same channel as the track it's li
When content is found in such a track, it **SHOULD** be played on the rendering channel
instead of the original track.

## Track Links

A track link indicates that a given subtitle track is suitable for use with a given audio track,
and that it **SHOULD** be eligible for autoselection ((#default-track-selection)) when that audio track is selected.

For instance:
- A subtitle track containing a translation of an audio track in another language should be
linked to that track, but should not be linked to another audio track featuring a dub
into the same language with a different translation.
A subtitle track containing a transcription of the dub, if present, should be linked to the dub audio track.
- A forced subtitle track containing onscreen text consistent with the dialogue in an audio track
of the same language should be linked to that track, but should not be linked to another audio track
featuring a different translation into the same language.
- A subtitle track containing a transcription of an audio commentary track should be linked to
that audio commentary track, but not to other tracks featuring separate commentary recordings.

Track links are only necessary when the set of tracks available creates ambiguity about which
subtitles are appropriate for which audio, and function as a hint to the player to improve
its automatic track selection behavior. In cases where there is no such ambiguity, there is
rcombs marked this conversation as resolved.
Show resolved Hide resolved
no need to explicitly specify track links.

## Multi-planar and 3D Videos

There are two different ways to compress 3D videos: have each eye track in a separate track
Expand Down Expand Up @@ -1238,3 +1259,5 @@ the Forced track should be selected nonetheless, rather than selecting no track
On the other hand, if the user's preferences _do_ call for captions, the non-Forced tracks
should be preferred, as the Forced track will not contain captioning for the dialogue.

If a given subtitle track has any TrackLink entries ((#track-links)), it should only be eligible
for default selection if one of the linked audio tracks has been selected (whether automatically or explicitly).