Skip to content

Update 0074 with provides #593

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

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
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
20 changes: 8 additions & 12 deletions recipe/0074-multiple-language-captions/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,29 @@ Captions and subtitles may be available in multiple languages for video content

## Implementation notes

This recipe builds on the pattern for [Using Caption and Subtitle Files with Video Content][0219], extending it to represent the availability of captions and subtitles in multiple languages.
This recipe builds on the pattern for [Using Caption Files with Video Content][0219], extending it to represent the availability of captions and subtitles in multiple languages.

Similarly to offering a single caption/subtitle file, the multiple subtitle/caption files are provided as a `supplementing` Annotation on the Canvas that contains the video file. In the case of multiple captions/subtitles, however, the Annotation provides all the available languages as choices. IIIF viewers are then able to offer to end-users the choice for displaying subtitles/captions in one of the available languages during the video playback.

In addition to this implementation, one might consider to provide the captions/subtitles also as multiple timed annotations. Although redundant, providing both implementations will enable more IIIF viewers to display the captions/subtitles, since they may use whichever implementation they support. See [Using Annotations for Timed Text][0079].
Similarly to offering a single caption file, the multiple subtitle/caption files are provided as `supplementing` Annotations on the Canvas that contains the video file, which also contain the `provides` property with the value `subtitles` or `closedCaptions`. One Annotation is used for each of the available captions/subtitles and languages. IIIF viewers are then able to identify which annotations contain captions/subtitles by checking the value of the `provides` property, and offer to end-users the choice for displaying subtitles/captions in one of the available languages during the video playback.

## Restrictions

Formats other than WebVTT (Web Video Text Tracks) are supported by the [Presentation API 3.0](https://iiif.io/api/presentation/3.0/), but current IIIF viewers do not support the display of captions/subtitles. Nevertheless, WebVTT is the format most likely to be implemented.

When using segmented WebVTT with HLS (HTTP Live Streaming), see [Serving HLS Files][0257].
Formats other than WebVTT (Web Video Text Tracks) are supported by the Presentation API 4.0, but WebVTT is the format most likely to be implemented in current IIIF viewers.

## Example

In this example we represent a video with subtitles in two languages: English and Italian.
For expressing the availability of the subtitles in the two languages, we use an Annotation with a Choice body that contains two items, one for each language. The language of each subtitle file is expressed with a `language` property containing a [BCP 47](https://tools.ietf.org/html/bcp47) language code as specified by the [Presentation API 3.0](https://iiif.io/api/presentation/3.0/#language-of-property-values).
In this example we represent a video with captions in Italian and subtitles in English.
For expressing the availability of captions and subtitles in the two languages, we use two Annotations, one for each language. The language of each caption/subtitle file is expressed with a `language` property containing a [BCP 47](https://tools.ietf.org/html/bcp47) language code as specified by the Presentation API 4.0.

In this example we use subtitle files in the WebVTT format. Other format options include SRT (SubRip Text) or TTML (Timed Text Markup Language), but these are less likely to be supported in IIIF viewers.
In this example we use files in the WebVTT format. Other format options include SRT (SubRip Text) or TTML (Timed Text Markup Language), but these are less likely to be supported in IIIF viewers.

{% include manifest_links.html viewers="Ramp, Theseus" manifest="manifest.json" %}

{% include jsonviewer.html src="manifest.json" config='data-line="60-92"'%}
{% include jsonviewer.html src="manifest.json" config='data-line="60-95"'%}

# Related recipes

- [Simplest Manifest - Video][0003]
- [Using Caption and Subtitle Files with Video Content][0219]
- [Using Caption Files with Video Content][0219]
- [Transcripts, Captions, and Subtitles - General Considerations][0231]
- [Using Annotations for Timed Text][0079]
- [Providing Access to Transcript Files of A/V Content][0017]
Expand Down
47 changes: 26 additions & 21 deletions recipe/0074-multiple-language-captions/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,32 +45,37 @@
"id": "{{ id.url }}/anno/page/1",
"type": "AnnotationPage",
"items": [{
"id": "{{ id.url }}/subtitles_captions-files-vtt",
"id": "{{ id.url }}/subtitles_captions-files-vtt-en",
"type": "Annotation",
"motivation": "supplementing",
"provides": [ "subtitles" ],
"body": {
"type": "Choice",
"items": [{
"id": "{{ id.path }}/Per_voi_signore_Modelli_francesi_en.vtt",
"type": "Text",
"format": "text/vtt",
"label": {
"en": ["Captions in WebVTT format"]
},
"language": "en"
}, {
"id": "{{ id.path }}/Per_voi_signore_Modelli_francesi_it.vtt",
"type": "Text",
"format": "text/vtt",
"label": {
"it": ["Sottotitoli in formato WebVTT"]
},
"language": "it"
}
]
"id": "{{ id.path }}/Per_voi_signore_Modelli_francesi_en.vtt",
"type": "Text",
"format": "text/vtt",
"label": {
"en": ["English subtitles in WebVTT format"]
},
"language": "en"
},
"target": "{{ id.path }}/canvas"
}
},
{
"id": "{{ id.url }}/subtitles_captions-files-vtt-it",
"type": "Annotation",
"motivation": "supplementing",
"provides": [ "closedCaptions" ],
"body": {
"id": "{{ id.path }}/Per_voi_signore_Modelli_francesi_it.vtt",
"type": "Text",
"format": "text/vtt",
"label": {
"en": ["Italian captions in WebVTT format"]
},
"language": "it"
},
"target": "{{ id.path }}/canvas"
}
]
}
]
Expand Down
Loading