From e86d29340af063e90e06e89b2ad8c61abcf9003c Mon Sep 17 00:00:00 2001 From: Nuno Freire Date: Mon, 10 Feb 2025 17:11:47 +0000 Subject: [PATCH 1/3] Adaptation of recipe 0074 for Presentation APIv4 --- .../0074-multiple-language-captions/index.md | 8 ++-- .../manifest.json | 47 ++++++++++--------- 2 files changed, 31 insertions(+), 24 deletions(-) diff --git a/recipe/0074-multiple-language-captions/index.md b/recipe/0074-multiple-language-captions/index.md index c5668299a..c72c4205f 100644 --- a/recipe/0074-multiple-language-captions/index.md +++ b/recipe/0074-multiple-language-captions/index.md @@ -21,18 +21,20 @@ This recipe builds on the pattern for [Using Caption and Subtitle Files with Vid 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. +Similarly to offering a single caption/subtitle 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. 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. + 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]. ## 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. +Formats other than WebVTT (Web Video Text Tracks) are supported by the Presentation API 4.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]. ## 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 subtitles in two languages: English and Italian. +For expressing the availability of the subtitles in the two languages, we use two Annotations, 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 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. diff --git a/recipe/0074-multiple-language-captions/manifest.json b/recipe/0074-multiple-language-captions/manifest.json index 3206288ec..ecd373793 100644 --- a/recipe/0074-multiple-language-captions/manifest.json +++ b/recipe/0074-multiple-language-captions/manifest.json @@ -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" + } ] } ] From 62dd8f4a685b2f0368c666db16cea7b23d2f0a18 Mon Sep 17 00:00:00 2001 From: Nuno Freire Date: Mon, 10 Feb 2025 18:06:57 +0000 Subject: [PATCH 2/3] Removed some old text --- recipe/0074-multiple-language-captions/index.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/recipe/0074-multiple-language-captions/index.md b/recipe/0074-multiple-language-captions/index.md index c72c4205f..91025bd7f 100644 --- a/recipe/0074-multiple-language-captions/index.md +++ b/recipe/0074-multiple-language-captions/index.md @@ -19,9 +19,7 @@ Captions and subtitles may be available in multiple languages for video content 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. -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. - -Similarly to offering a single caption/subtitle 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. 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. +Similarly to offering a single caption/subtitle 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. 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]. @@ -40,7 +38,7 @@ In this example we use subtitle files in the WebVTT format. Other format options {% 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 From fcd822ad60bab1222470b384d2aab676cb9715f1 Mon Sep 17 00:00:00 2001 From: Nuno Freire Date: Mon, 10 Mar 2025 12:17:28 +0000 Subject: [PATCH 3/3] Comments from 2025-02-18 meeting --- .../0074-multiple-language-captions/index.md | 18 +++++++----------- .../manifest.json | 4 ++-- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/recipe/0074-multiple-language-captions/index.md b/recipe/0074-multiple-language-captions/index.md index 91025bd7f..857138d95 100644 --- a/recipe/0074-multiple-language-captions/index.md +++ b/recipe/0074-multiple-language-captions/index.md @@ -17,24 +17,20 @@ 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 `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. - -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 4.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 two Annotations, 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 4.0. +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" %} @@ -43,7 +39,7 @@ In this example we use subtitle files in the WebVTT format. Other format options # 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] diff --git a/recipe/0074-multiple-language-captions/manifest.json b/recipe/0074-multiple-language-captions/manifest.json index ecd373793..a1f64f798 100644 --- a/recipe/0074-multiple-language-captions/manifest.json +++ b/recipe/0074-multiple-language-captions/manifest.json @@ -48,7 +48,7 @@ "id": "{{ id.url }}/subtitles_captions-files-vtt-en", "type": "Annotation", "motivation": "supplementing", - "provides": "subtitles", + "provides": [ "subtitles" ], "body": { "id": "{{ id.path }}/Per_voi_signore_Modelli_francesi_en.vtt", "type": "Text", @@ -64,7 +64,7 @@ "id": "{{ id.url }}/subtitles_captions-files-vtt-it", "type": "Annotation", "motivation": "supplementing", - "provides": "closedCaptions", + "provides": [ "closedCaptions" ], "body": { "id": "{{ id.path }}/Per_voi_signore_Modelli_francesi_it.vtt", "type": "Text",