From c661b2ac0a35dba6f68e1e821ec356f30b6491d2 Mon Sep 17 00:00:00 2001 From: Nuno Freire Date: Thu, 15 May 2025 13:44:00 +0100 Subject: [PATCH 1/5] v3 + v4 versions --- recipe/0079-annotations-for-captions/index.md | 33 +++++ .../lunchroom_manners-captions-en.json | 115 ++++++++++++++++ .../manifest.json | 47 +++++++ .../0079-annotations-for-captions/recipe.md | 36 +++++ .../v4/lunchroom_manners-captions-en.json | 124 ++++++++++++++++++ .../v4/manifest.json | 47 +++++++ .../v4/recipe.md | 52 ++++++++ 7 files changed, 454 insertions(+) create mode 100644 recipe/0079-annotations-for-captions/index.md create mode 100644 recipe/0079-annotations-for-captions/lunchroom_manners-captions-en.json create mode 100644 recipe/0079-annotations-for-captions/manifest.json create mode 100644 recipe/0079-annotations-for-captions/recipe.md create mode 100644 recipe/0079-annotations-for-captions/v4/lunchroom_manners-captions-en.json create mode 100644 recipe/0079-annotations-for-captions/v4/manifest.json create mode 100644 recipe/0079-annotations-for-captions/v4/recipe.md diff --git a/recipe/0079-annotations-for-captions/index.md b/recipe/0079-annotations-for-captions/index.md new file mode 100644 index 000000000..3c95d9833 --- /dev/null +++ b/recipe/0079-annotations-for-captions/index.md @@ -0,0 +1,33 @@ +--- +title: Using Annotations for Timed Text +id: 79 +layout: recipe +tags: [video, caption, subtitle, presentation] +summary: "Providing captions, represented as annotations, to a video resource." +viewers: + - Ramp + - Theseus +v4-viewers: + - Mirador +topic: + - AV +code: + - iiif-prezi3 +top_tabs: + - label: Version 3 + content: "{% capture my_include %}{%- include_relative recipe.md version='3' -%}{% endcapture %}{{ my_include | markdownify }}" + - label: Version 4 + content: "{% capture my_include %}{%- include_relative v4/recipe.md version='4' -%}{% endcapture %}{{ my_include | markdownify }}" +--- + +{{ theme.block-center-start }} + +{% include blocks/tabs.html tabs=page.top_tabs %} + +{{ theme.block-end }} + \ No newline at end of file diff --git a/recipe/0079-annotations-for-captions/lunchroom_manners-captions-en.json b/recipe/0079-annotations-for-captions/lunchroom_manners-captions-en.json new file mode 100644 index 000000000..7f3d8ecfb --- /dev/null +++ b/recipe/0079-annotations-for-captions/lunchroom_manners-captions-en.json @@ -0,0 +1,115 @@ +{ + "@context": "http://iiif.io/api/presentation/3/context.json", + "id": "{{ id.url }}", + "type": "AnnotationPage", + "items": [ + { + "id": "https://data.europeana.eu/annotation/2051943/data_euscreenXL_EUS_2BAA81D23D6F41578CB2C2071D0325FC/en/a1", + "type": "Annotation", + "motivation": "supplementing", + "body": { + "type": "TextualBody", + "format": "text/plain", + "language": "en", + "value": "[music]" + }, + "target": "{{ id.path }}/canvas#t=1.200,21.000" + }, + { + "id": "https://data.europeana.eu/annotation/2051943/data_euscreenXL_EUS_2BAA81D23D6F41578CB2C2071D0325FC/en/a2", + "type": "Annotation", + "motivation": "supplementing", + "body": { + "type": "TextualBody", + "format": "text/plain", + "language": "en", + "value": "Just before lunch one day, a puppet show \nwas put on at school." + }, + "target": "{{ id.path }}/canvas#t=22.200,26.600" + }, + { + "id": "https://data.europeana.eu/annotation/2051943/data_euscreenXL_EUS_2BAA81D23D6F41578CB2C2071D0325FC/en/a3", + "type": "Annotation", + "motivation": "supplementing", + "body": { + "type": "TextualBody", + "format": "text/plain", + "language": "en", + "value": "It was called \"Mister Bungle Goes to Lunch\"." + }, + "target": "{{ id.path }}/canvas#t=26.700,31.500" + }, + { + "id": "https://data.europeana.eu/annotation/2051943/data_euscreenXL_EUS_2BAA81D23D6F41578CB2C2071D0325FC/en/a4", + "type": "Annotation", + "motivation": "supplementing", + "body": { + "type": "TextualBody", + "format": "text/plain", + "language": "en", + "value": "It was fun to watch." + }, + "target": "{{ id.path }}/canvas#t=31.600,34.500" + }, + { + "id": "https://data.europeana.eu/annotation/2051943/data_euscreenXL_EUS_2BAA81D23D6F41578CB2C2071D0325FC/en/a5", + "type": "Annotation", + "motivation": "supplementing", + "body": { + "type": "TextualBody", + "format": "text/plain", + "language": "en", + "value": "In the puppet show, Mr. Bungle came to the \nboys' room on his way to lunch." + }, + "target": "{{ id.path }}/canvas#t=36.100,41.300" + }, + { + "id": "https://data.europeana.eu/annotation/2051943/data_euscreenXL_EUS_2BAA81D23D6F41578CB2C2071D0325FC/en/a6", + "type": "Annotation", + "motivation": "supplementing", + "body": { + "type": "TextualBody", + "format": "text/plain", + "language": "en", + "value": "He looked at his hands. His hands were dirty \nand his hair was messy." + }, + "target": "{{ id.path }}/canvas#t=41.400,46.200" + }, + { + "id": "https://data.europeana.eu/annotation/2051943/data_euscreenXL_EUS_2BAA81D23D6F41578CB2C2071D0325FC/en/a7", + "type": "Annotation", + "motivation": "supplementing", + "body": { + "type": "TextualBody", + "format": "text/plain", + "language": "en", + "value": "But Mr. Bungle didn't stop to wash his hands \nor comb his hair." + }, + "target": "{{ id.path }}/canvas#t=46.300,51.100" + }, + { + "id": "https://data.europeana.eu/annotation/2051943/data_euscreenXL_EUS_2BAA81D23D6F41578CB2C2071D0325FC/en/a8", + "type": "Annotation", + "motivation": "supplementing", + "body": { + "type": "TextualBody", + "format": "text/plain", + "language": "en", + "value": "He went right to lunch." + }, + "target": "{{ id.path }}/canvas#t=51.200,54.900" + }, + { + "id": "https://data.europeana.eu/annotation/2051943/data_euscreenXL_EUS_2BAA81D23D6F41578CB2C2071D0325FC/en/a9", + "type": "Annotation", + "motivation": "supplementing", + "body": { + "type": "TextualBody", + "format": "text/plain", + "language": "en", + "value": "Then, instead of getting into line at the \nlunchroom, Mr. Bungle pushed everyone aside \nand went right to the front." + }, + "target": "{{ id.path }}/canvas#t=57.900,65.700" + } + ] +} \ No newline at end of file diff --git a/recipe/0079-annotations-for-captions/manifest.json b/recipe/0079-annotations-for-captions/manifest.json new file mode 100644 index 000000000..e70c3e515 --- /dev/null +++ b/recipe/0079-annotations-for-captions/manifest.json @@ -0,0 +1,47 @@ +{ + "@context": "http://iiif.io/api/presentation/3/context.json", + "id": "{{ id.url }}", + "type": "Manifest", + "label": { + "en": [ + "Lunchroom Manners" + ] + }, + "items": [ + { + "id": "{{ id.path }}/canvas", + "type": "Canvas", + "height": 360, + "width": 480, + "duration": 572.034, + "items": [ + { + "id": "{{ id.path }}/canvas/page", + "type": "AnnotationPage", + "items": [ + { + "id": "{{ id.path }}/canvas/page/annotation1", + "type": "Annotation", + "motivation": "painting", + "body": { + "id": "https://fixtures.iiif.io/video/indiana/lunchroom_manners/high/lunchroom_manners_1024kb.mp4", + "type": "Video", + "height": 360, + "width": 480, + "duration": 572.034, + "format": "video/mp4" + }, + "target": "{{ id.path }}/canvas" + } + ] + } + ], + "annotations": [ + { + "id": "{{ id.path }}/lunchroom_manners-captions-en.json", + "type": "AnnotationPage" + } + ] + } + ] +} diff --git a/recipe/0079-annotations-for-captions/recipe.md b/recipe/0079-annotations-for-captions/recipe.md new file mode 100644 index 000000000..1da6a0e82 --- /dev/null +++ b/recipe/0079-annotations-for-captions/recipe.md @@ -0,0 +1,36 @@ +## Use Case + +You want to represent captions for your video content as timed annotations. + +## Implementation notes + +This recipe follows the pattern for [Using Caption Files with Video Content][0219], but shows an alternative form of representing a caption file using annotations. + +In this recipe, annotations are used to mark up video content shown on a canvas of the manifest. The time alignment of the captions with the video content is achieved by annotations that target the canvas by using Media Fragments URIs with a [temporal dimenstion](https://www.w3.org/TR/media-frags/#naming-time). + +## Restrictions + + + +## Example + +In this example we show the same captions and video from [Using Caption Files with Video Content][0219]. but the `annotations` section of the manifest links to a `AnnotationPage` instead of the WebVTT file. For readability, the example contains only the annotations that concern the captions of the first minute of the video. + +The `AnnotationPage` contains one annotation per individual caption entry, and these are provided as `supplementing` annotations on the Canvas that contains the video file. The references to the canvas uses Media Fragment URIs with a begin time and an end time. The language of the captions 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. + +{% include manifest_links.html viewers="Clover, Ramp, Aviary, Theseus" manifest="manifest.json" %} + +{% include jsonviewer.html src="manifest.json" config='data-line="39-44"'%} + +{% include jsonviewer.html src="lunchroom_manners-captions-en.json" config='data-line="6-18"'%} + +# Related recipes + +- [Simplest Manifest - Video][0003] +- [Using Caption Files with Video Content][0219] +- [Using Caption and Subtitle Files in Multiple Languages with Video Content][0074] +- [Using Transcript Files with Audio or Video Content][0253] +- [Providing Access to Transcripts of A/V Content][0017] + +{% include acronyms.md %} +{% include links.md %} diff --git a/recipe/0079-annotations-for-captions/v4/lunchroom_manners-captions-en.json b/recipe/0079-annotations-for-captions/v4/lunchroom_manners-captions-en.json new file mode 100644 index 000000000..1f8400814 --- /dev/null +++ b/recipe/0079-annotations-for-captions/v4/lunchroom_manners-captions-en.json @@ -0,0 +1,124 @@ +{ + "@context": "http://iiif.io/api/presentation/4/context.json", + "id": "{{ id.url }}", + "type": "AnnotationPage", + "items": [ + { + "id": "https://data.europeana.eu/annotation/2051943/data_euscreenXL_EUS_2BAA81D23D6F41578CB2C2071D0325FC/en/a1", + "type": "Annotation", + "motivation": "supplementing", + "provides": [ "closedCaptions" ], + "body": { + "type": "TextualBody", + "format": "text/plain", + "language": "en", + "value": "[music]" + }, + "target": "{{ id.path }}/canvas#t=1.200,21.000" + }, + { + "id": "https://data.europeana.eu/annotation/2051943/data_euscreenXL_EUS_2BAA81D23D6F41578CB2C2071D0325FC/en/a2", + "type": "Annotation", + "motivation": "supplementing", + "provides": [ "closedCaptions" ], + "body": { + "type": "TextualBody", + "format": "text/plain", + "language": "en", + "value": "Just before lunch one day, a puppet show \nwas put on at school." + }, + "target": "{{ id.path }}/canvas#t=22.200,26.600" + }, + { + "id": "https://data.europeana.eu/annotation/2051943/data_euscreenXL_EUS_2BAA81D23D6F41578CB2C2071D0325FC/en/a3", + "type": "Annotation", + "motivation": "supplementing", + "provides": [ "closedCaptions" ], + "body": { + "type": "TextualBody", + "format": "text/plain", + "language": "en", + "value": "It was called \"Mister Bungle Goes to Lunch\"." + }, + "target": "{{ id.path }}/canvas#t=26.700,31.500" + }, + { + "id": "https://data.europeana.eu/annotation/2051943/data_euscreenXL_EUS_2BAA81D23D6F41578CB2C2071D0325FC/en/a4", + "type": "Annotation", + "motivation": "supplementing", + "provides": [ "closedCaptions" ], + "body": { + "type": "TextualBody", + "format": "text/plain", + "language": "en", + "value": "It was fun to watch." + }, + "target": "{{ id.path }}/canvas#t=31.600,34.500" + }, + { + "id": "https://data.europeana.eu/annotation/2051943/data_euscreenXL_EUS_2BAA81D23D6F41578CB2C2071D0325FC/en/a5", + "type": "Annotation", + "motivation": "supplementing", + "provides": [ "closedCaptions" ], + "body": { + "type": "TextualBody", + "format": "text/plain", + "language": "en", + "value": "In the puppet show, Mr. Bungle came to the \nboys' room on his way to lunch." + }, + "target": "{{ id.path }}/canvas#t=36.100,41.300" + }, + { + "id": "https://data.europeana.eu/annotation/2051943/data_euscreenXL_EUS_2BAA81D23D6F41578CB2C2071D0325FC/en/a6", + "type": "Annotation", + "motivation": "supplementing", + "provides": [ "closedCaptions" ], + "body": { + "type": "TextualBody", + "format": "text/plain", + "language": "en", + "value": "He looked at his hands. His hands were dirty \nand his hair was messy." + }, + "target": "{{ id.path }}/canvas#t=41.400,46.200" + }, + { + "id": "https://data.europeana.eu/annotation/2051943/data_euscreenXL_EUS_2BAA81D23D6F41578CB2C2071D0325FC/en/a7", + "type": "Annotation", + "motivation": "supplementing", + "provides": [ "closedCaptions" ], + "body": { + "type": "TextualBody", + "format": "text/plain", + "language": "en", + "value": "But Mr. Bungle didn't stop to wash his hands \nor comb his hair." + }, + "target": "{{ id.path }}/canvas#t=46.300,51.100" + }, + { + "id": "https://data.europeana.eu/annotation/2051943/data_euscreenXL_EUS_2BAA81D23D6F41578CB2C2071D0325FC/en/a8", + "type": "Annotation", + "motivation": "supplementing", + "provides": [ "closedCaptions" ], + "body": { + "type": "TextualBody", + "format": "text/plain", + "language": "en", + "value": "He went right to lunch." + }, + "target": "{{ id.path }}/canvas#t=51.200,54.900" + }, + { + "id": "https://data.europeana.eu/annotation/2051943/data_euscreenXL_EUS_2BAA81D23D6F41578CB2C2071D0325FC/en/a9", + "type": "Annotation", + "motivation": "supplementing", + "provides": [ "closedCaptions" ], + "body": { + "type": "TextualBody", + "format": "text/plain", + "language": "en", + "value": "Then, instead of getting into line at the \nlunchroom, Mr. Bungle pushed everyone aside \nand went right to the front." + }, + "target": "{{ id.path }}/canvas#t=57.900,65.700" + } + ] +} \ No newline at end of file diff --git a/recipe/0079-annotations-for-captions/v4/manifest.json b/recipe/0079-annotations-for-captions/v4/manifest.json new file mode 100644 index 000000000..de6ea5209 --- /dev/null +++ b/recipe/0079-annotations-for-captions/v4/manifest.json @@ -0,0 +1,47 @@ +{ + "@context": "http://iiif.io/api/presentation/4/context.json", + "id": "{{ id.url }}", + "type": "Manifest", + "label": { + "en": [ + "Lunchroom Manners" + ] + }, + "items": [ + { + "id": "{{ id.path }}/canvas", + "type": "Canvas", + "height": 360, + "width": 480, + "duration": 572.034, + "items": [ + { + "id": "{{ id.path }}/canvas/page", + "type": "AnnotationPage", + "items": [ + { + "id": "{{ id.path }}/canvas/page/annotation1", + "type": "Annotation", + "motivation": "painting", + "body": { + "id": "https://fixtures.iiif.io/video/indiana/lunchroom_manners/high/lunchroom_manners_1024kb.mp4", + "type": "Video", + "height": 360, + "width": 480, + "duration": 572.034, + "format": "video/mp4" + }, + "target": "{{ id.path }}/canvas" + } + ] + } + ], + "annotations": [ + { + "id": "{{ id.path }}/lunchroom_manners-captions-en.json", + "type": "AnnotationPage" + } + ] + } + ] +} diff --git a/recipe/0079-annotations-for-captions/v4/recipe.md b/recipe/0079-annotations-for-captions/v4/recipe.md new file mode 100644 index 000000000..ea24cbad6 --- /dev/null +++ b/recipe/0079-annotations-for-captions/v4/recipe.md @@ -0,0 +1,52 @@ +--- +title: Using Annotations for Timed Text +id: 79 +layout: recipe +tags: [video, caption, subtitle, presentation] +summary: "Providing captions, represented as annotations, to a video resource." +viewers: + - Clover + - Ramp + - Aviary + - Theseus +topic: AV +--- + +## Use Case + +You want to represent captions for your video content as timed annotations. + +## Implementation notes + +This recipe follows the pattern for [Using Caption Files with Video Content][0219], but shows an alternative form of representing a caption file using annotations. + +In this recipe, annotations are used to mark up video content shown on a canvas of the manifest. The time alignment of the captions with the video content is achieved by annotations that target the canvas by using Media Fragments URIs with a [temporal dimenstion](https://www.w3.org/TR/media-frags/#naming-time). The `provides` property of the Annotation is used by the IIIF client to identify the annotations containing captions and be used as such by the media player. + +## Restrictions + + + +## Example + +In this example we show the same captions and video from [Using Caption Files with Video Content][0219]. but the `annotations` section of the manifest links to a `AnnotationPage` instead of the WebVTT file. For readability, the example contains only the annotations that concern the captions of the first minute of the video. + +The `AnnotationPage` contains one annotation per individual caption entry, and these are provided as `supplementing` annotations on the Canvas that contains the video file. The references to the canvas uses Media Fragment URIs with a begin time and an end time. The annotations also contain the `provides` property with the value `closedCaptions` to inform the IIIF viewer that these annotations are representing captions. The language of the captions 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. + +Note: This recipe may also be applied for subtitles. In such cases, the `provides` property of the annotations must have the value `subtitles`. + +{% include manifest_links.html viewers="Clover, Ramp, Aviary, Theseus" manifest="manifest.json" %} + +{% include jsonviewer.html src="manifest.json" config='data-line="39-44"'%} + +{% include jsonviewer.html src="lunchroom_manners-captions-en.json" config='data-line="6-18"'%} + +# Related recipes + +- [Simplest Manifest - Video][0003] +- [Using Caption Files with Video Content][0219] +- [Using Caption and Subtitle Files in Multiple Languages with Video Content][0074] +- [Using Transcript Files with Audio or Video Content][0253] +- [Providing Access to Transcripts of A/V Content][0017] + +{% include acronyms.md %} +{% include links.md %} From a0e2304b0aa8a9fb56bb1b5d3cd42b8bd6aa60f5 Mon Sep 17 00:00:00 2001 From: Nuno Freire Date: Thu, 15 May 2025 13:45:00 +0100 Subject: [PATCH 2/5] v3 + v4 versions --- .../0074-multiple-language-captions/index.md | 20 ++++---- .../manifest.json | 47 ++++++++++--------- 2 files changed, 34 insertions(+), 33 deletions(-) diff --git a/recipe/0074-multiple-language-captions/index.md b/recipe/0074-multiple-language-captions/index.md index c5668299a..857138d95 100644 --- a/recipe/0074-multiple-language-captions/index.md +++ b/recipe/0074-multiple-language-captions/index.md @@ -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] diff --git a/recipe/0074-multiple-language-captions/manifest.json b/recipe/0074-multiple-language-captions/manifest.json index 3206288ec..a1f64f798 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 b7b1700e9a315bd88ece1880edf2e4bf4709f0ee Mon Sep 17 00:00:00 2001 From: Nuno Freire Date: Tue, 17 Jun 2025 16:31:56 +0100 Subject: [PATCH 3/5] link fix --- recipe/0079-annotations-for-captions/v4/recipe.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/0079-annotations-for-captions/v4/recipe.md b/recipe/0079-annotations-for-captions/v4/recipe.md index ea24cbad6..ecb753802 100644 --- a/recipe/0079-annotations-for-captions/v4/recipe.md +++ b/recipe/0079-annotations-for-captions/v4/recipe.md @@ -34,7 +34,7 @@ The `AnnotationPage` contains one annotation per individual caption entry, and t Note: This recipe may also be applied for subtitles. In such cases, the `provides` property of the annotations must have the value `subtitles`. -{% include manifest_links.html viewers="Clover, Ramp, Aviary, Theseus" manifest="manifest.json" %} +{% include manifest_links.html viewers="Clover, Ramp, Aviary, Theseus" manifest="v4/manifest.json" %} {% include jsonviewer.html src="manifest.json" config='data-line="39-44"'%} From 0bf068ddce8d312bf411859d8aeeeecc6d2508c3 Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Tue, 22 Jul 2025 16:58:55 +0100 Subject: [PATCH 4/5] Removing duplicate front matter --- .../0079-annotations-for-captions/v4/recipe.md | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/recipe/0079-annotations-for-captions/v4/recipe.md b/recipe/0079-annotations-for-captions/v4/recipe.md index ecb753802..0103ab3fb 100644 --- a/recipe/0079-annotations-for-captions/v4/recipe.md +++ b/recipe/0079-annotations-for-captions/v4/recipe.md @@ -1,17 +1,3 @@ ---- -title: Using Annotations for Timed Text -id: 79 -layout: recipe -tags: [video, caption, subtitle, presentation] -summary: "Providing captions, represented as annotations, to a video resource." -viewers: - - Clover - - Ramp - - Aviary - - Theseus -topic: AV ---- - ## Use Case You want to represent captions for your video content as timed annotations. @@ -36,9 +22,9 @@ Note: This recipe may also be applied for subtitles. In such cases, the `provide {% include manifest_links.html viewers="Clover, Ramp, Aviary, Theseus" manifest="v4/manifest.json" %} -{% include jsonviewer.html src="manifest.json" config='data-line="39-44"'%} +{% include jsonviewer.html src="v4/manifest.json" config='data-line="39-44"'%} -{% include jsonviewer.html src="lunchroom_manners-captions-en.json" config='data-line="6-18"'%} +{% include jsonviewer.html src="v4/lunchroom_manners-captions-en.json" config='data-line="6-18"'%} # Related recipes From 9d0c26f2382bb7170c53969abb0be7c6b184bc2a Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Tue, 22 Jul 2025 17:01:14 +0100 Subject: [PATCH 5/5] Only a v4 recipe for this one --- recipe/0079-annotations-for-captions/index.md | 2 - .../lunchroom_manners-captions-en.json | 115 ------------------ .../manifest.json | 47 ------- .../0079-annotations-for-captions/recipe.md | 36 ------ 4 files changed, 200 deletions(-) delete mode 100644 recipe/0079-annotations-for-captions/lunchroom_manners-captions-en.json delete mode 100644 recipe/0079-annotations-for-captions/manifest.json delete mode 100644 recipe/0079-annotations-for-captions/recipe.md diff --git a/recipe/0079-annotations-for-captions/index.md b/recipe/0079-annotations-for-captions/index.md index 3c95d9833..a8e27e372 100644 --- a/recipe/0079-annotations-for-captions/index.md +++ b/recipe/0079-annotations-for-captions/index.md @@ -14,8 +14,6 @@ topic: code: - iiif-prezi3 top_tabs: - - label: Version 3 - content: "{% capture my_include %}{%- include_relative recipe.md version='3' -%}{% endcapture %}{{ my_include | markdownify }}" - label: Version 4 content: "{% capture my_include %}{%- include_relative v4/recipe.md version='4' -%}{% endcapture %}{{ my_include | markdownify }}" --- diff --git a/recipe/0079-annotations-for-captions/lunchroom_manners-captions-en.json b/recipe/0079-annotations-for-captions/lunchroom_manners-captions-en.json deleted file mode 100644 index 7f3d8ecfb..000000000 --- a/recipe/0079-annotations-for-captions/lunchroom_manners-captions-en.json +++ /dev/null @@ -1,115 +0,0 @@ -{ - "@context": "http://iiif.io/api/presentation/3/context.json", - "id": "{{ id.url }}", - "type": "AnnotationPage", - "items": [ - { - "id": "https://data.europeana.eu/annotation/2051943/data_euscreenXL_EUS_2BAA81D23D6F41578CB2C2071D0325FC/en/a1", - "type": "Annotation", - "motivation": "supplementing", - "body": { - "type": "TextualBody", - "format": "text/plain", - "language": "en", - "value": "[music]" - }, - "target": "{{ id.path }}/canvas#t=1.200,21.000" - }, - { - "id": "https://data.europeana.eu/annotation/2051943/data_euscreenXL_EUS_2BAA81D23D6F41578CB2C2071D0325FC/en/a2", - "type": "Annotation", - "motivation": "supplementing", - "body": { - "type": "TextualBody", - "format": "text/plain", - "language": "en", - "value": "Just before lunch one day, a puppet show \nwas put on at school." - }, - "target": "{{ id.path }}/canvas#t=22.200,26.600" - }, - { - "id": "https://data.europeana.eu/annotation/2051943/data_euscreenXL_EUS_2BAA81D23D6F41578CB2C2071D0325FC/en/a3", - "type": "Annotation", - "motivation": "supplementing", - "body": { - "type": "TextualBody", - "format": "text/plain", - "language": "en", - "value": "It was called \"Mister Bungle Goes to Lunch\"." - }, - "target": "{{ id.path }}/canvas#t=26.700,31.500" - }, - { - "id": "https://data.europeana.eu/annotation/2051943/data_euscreenXL_EUS_2BAA81D23D6F41578CB2C2071D0325FC/en/a4", - "type": "Annotation", - "motivation": "supplementing", - "body": { - "type": "TextualBody", - "format": "text/plain", - "language": "en", - "value": "It was fun to watch." - }, - "target": "{{ id.path }}/canvas#t=31.600,34.500" - }, - { - "id": "https://data.europeana.eu/annotation/2051943/data_euscreenXL_EUS_2BAA81D23D6F41578CB2C2071D0325FC/en/a5", - "type": "Annotation", - "motivation": "supplementing", - "body": { - "type": "TextualBody", - "format": "text/plain", - "language": "en", - "value": "In the puppet show, Mr. Bungle came to the \nboys' room on his way to lunch." - }, - "target": "{{ id.path }}/canvas#t=36.100,41.300" - }, - { - "id": "https://data.europeana.eu/annotation/2051943/data_euscreenXL_EUS_2BAA81D23D6F41578CB2C2071D0325FC/en/a6", - "type": "Annotation", - "motivation": "supplementing", - "body": { - "type": "TextualBody", - "format": "text/plain", - "language": "en", - "value": "He looked at his hands. His hands were dirty \nand his hair was messy." - }, - "target": "{{ id.path }}/canvas#t=41.400,46.200" - }, - { - "id": "https://data.europeana.eu/annotation/2051943/data_euscreenXL_EUS_2BAA81D23D6F41578CB2C2071D0325FC/en/a7", - "type": "Annotation", - "motivation": "supplementing", - "body": { - "type": "TextualBody", - "format": "text/plain", - "language": "en", - "value": "But Mr. Bungle didn't stop to wash his hands \nor comb his hair." - }, - "target": "{{ id.path }}/canvas#t=46.300,51.100" - }, - { - "id": "https://data.europeana.eu/annotation/2051943/data_euscreenXL_EUS_2BAA81D23D6F41578CB2C2071D0325FC/en/a8", - "type": "Annotation", - "motivation": "supplementing", - "body": { - "type": "TextualBody", - "format": "text/plain", - "language": "en", - "value": "He went right to lunch." - }, - "target": "{{ id.path }}/canvas#t=51.200,54.900" - }, - { - "id": "https://data.europeana.eu/annotation/2051943/data_euscreenXL_EUS_2BAA81D23D6F41578CB2C2071D0325FC/en/a9", - "type": "Annotation", - "motivation": "supplementing", - "body": { - "type": "TextualBody", - "format": "text/plain", - "language": "en", - "value": "Then, instead of getting into line at the \nlunchroom, Mr. Bungle pushed everyone aside \nand went right to the front." - }, - "target": "{{ id.path }}/canvas#t=57.900,65.700" - } - ] -} \ No newline at end of file diff --git a/recipe/0079-annotations-for-captions/manifest.json b/recipe/0079-annotations-for-captions/manifest.json deleted file mode 100644 index e70c3e515..000000000 --- a/recipe/0079-annotations-for-captions/manifest.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "@context": "http://iiif.io/api/presentation/3/context.json", - "id": "{{ id.url }}", - "type": "Manifest", - "label": { - "en": [ - "Lunchroom Manners" - ] - }, - "items": [ - { - "id": "{{ id.path }}/canvas", - "type": "Canvas", - "height": 360, - "width": 480, - "duration": 572.034, - "items": [ - { - "id": "{{ id.path }}/canvas/page", - "type": "AnnotationPage", - "items": [ - { - "id": "{{ id.path }}/canvas/page/annotation1", - "type": "Annotation", - "motivation": "painting", - "body": { - "id": "https://fixtures.iiif.io/video/indiana/lunchroom_manners/high/lunchroom_manners_1024kb.mp4", - "type": "Video", - "height": 360, - "width": 480, - "duration": 572.034, - "format": "video/mp4" - }, - "target": "{{ id.path }}/canvas" - } - ] - } - ], - "annotations": [ - { - "id": "{{ id.path }}/lunchroom_manners-captions-en.json", - "type": "AnnotationPage" - } - ] - } - ] -} diff --git a/recipe/0079-annotations-for-captions/recipe.md b/recipe/0079-annotations-for-captions/recipe.md deleted file mode 100644 index 1da6a0e82..000000000 --- a/recipe/0079-annotations-for-captions/recipe.md +++ /dev/null @@ -1,36 +0,0 @@ -## Use Case - -You want to represent captions for your video content as timed annotations. - -## Implementation notes - -This recipe follows the pattern for [Using Caption Files with Video Content][0219], but shows an alternative form of representing a caption file using annotations. - -In this recipe, annotations are used to mark up video content shown on a canvas of the manifest. The time alignment of the captions with the video content is achieved by annotations that target the canvas by using Media Fragments URIs with a [temporal dimenstion](https://www.w3.org/TR/media-frags/#naming-time). - -## Restrictions - - - -## Example - -In this example we show the same captions and video from [Using Caption Files with Video Content][0219]. but the `annotations` section of the manifest links to a `AnnotationPage` instead of the WebVTT file. For readability, the example contains only the annotations that concern the captions of the first minute of the video. - -The `AnnotationPage` contains one annotation per individual caption entry, and these are provided as `supplementing` annotations on the Canvas that contains the video file. The references to the canvas uses Media Fragment URIs with a begin time and an end time. The language of the captions 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. - -{% include manifest_links.html viewers="Clover, Ramp, Aviary, Theseus" manifest="manifest.json" %} - -{% include jsonviewer.html src="manifest.json" config='data-line="39-44"'%} - -{% include jsonviewer.html src="lunchroom_manners-captions-en.json" config='data-line="6-18"'%} - -# Related recipes - -- [Simplest Manifest - Video][0003] -- [Using Caption Files with Video Content][0219] -- [Using Caption and Subtitle Files in Multiple Languages with Video Content][0074] -- [Using Transcript Files with Audio or Video Content][0253] -- [Providing Access to Transcripts of A/V Content][0017] - -{% include acronyms.md %} -{% include links.md %}