CaptionDestination

class aws_cdk.aws_medialive_alpha.CaptionDestination

Bases: object

(experimental) The output caption format for a caption encode.

Use the static factory methods to select one of the supported destination types.

Stability:

experimental

ExampleMetadata:

infused

Example:

# Define a caption selector on the input attachment (see Input Attachment Settings below)
caption_selector = medialive.CaptionSelector.embedded("captions")

# WebVTT captions — packaged alongside the video encode in the same output
webvtt = medialive.EncodeConfiguration.caption(
    name="eng_webvtt",
    caption_selector_name=caption_selector.name,
    language_code="eng",
    language_description="English",
    destination=medialive.CaptionDestination.webvtt()
)

# Burned-in captions — rendered into the video, styled via the burn-in options
burn_in = medialive.EncodeConfiguration.caption(
    name="eng_burnin",
    caption_selector_name=caption_selector.name,
    destination=medialive.CaptionDestination.burn_in(
        alignment=medialive.CaptionAlignment.CENTERED,
        font_color=medialive.CaptionFontColor.WHITE,
        outline_color=medialive.CaptionOutlineColor.BLACK,
        font_size=medialive.CaptionFontSize.AUTO
    )
)
Stability:

experimental

Static Methods

classmethod arib()

(experimental) ARIB captions.

Stability:

experimental

Return type:

CaptionDestination

classmethod burn_in(*, alignment=None, background_color=None, background_opacity=None, font=None, font_color=None, font_opacity=None, font_resolution=None, font_size=None, outline_color=None, outline_size=None, shadow_color=None, shadow_opacity=None, shadow_x_offset=None, shadow_y_offset=None, subtitle_rows=None, teletext_grid_control=None, x_position=None, y_position=None)

(experimental) Burned-in captions rendered into the video.

Parameters:
  • alignment (Optional[CaptionAlignment]) – (experimental) Caption alignment. With explicit x/y positions, the font is justified relative to them. Default: CaptionAlignment.CENTERED

  • background_color (Optional[CaptionBackgroundColor]) – (experimental) The color of the rectangle behind the captions. Default: - service default

  • background_opacity (Union[int, float, None]) – (experimental) The opacity of the background rectangle (0 transparent .. 255 opaque). Default: - service default

  • font (Optional[FileLocation]) – (experimental) An external font file (.ttf or .tte) used for burn-in. Provide a FileLocation referencing an S3 bucket (FileLocation.fromBucket, which auto-grants read access) or a URL (FileLocation.url). Default: - service default font

  • font_color (Optional[CaptionFontColor]) – (experimental) The color of the burned-in captions. Default: CaptionFontColor.WHITE

  • font_opacity (Union[int, float, None]) – (experimental) The opacity of the burned-in captions (0 transparent .. 255 opaque). Default: 255

  • font_resolution (Union[int, float, None]) – (experimental) The font resolution in DPI. Default: 96

  • font_size (Optional[CaptionFontSize]) – (experimental) Font size — CaptionFontSize.AUTO to scale with the output, or CaptionFontSize.of(points) for an exact size in points. Default: CaptionFontSize.AUTO

  • outline_color (Optional[CaptionOutlineColor]) – (experimental) The font outline color. Default: CaptionOutlineColor.BLACK

  • outline_size (Union[int, float, None]) – (experimental) The font outline size in pixels. Default: 2

  • shadow_color (Optional[CaptionShadowColor]) – (experimental) The color of the shadow cast by the captions. Default: CaptionShadowColor.NONE

  • shadow_opacity (Union[int, float, None]) – (experimental) The opacity of the shadow (0 transparent .. 255 opaque). Default: 0

  • shadow_x_offset (Union[int, float, None]) – (experimental) The horizontal offset of the shadow in pixels (negative shifts left). Default: - service default

  • shadow_y_offset (Union[int, float, None]) – (experimental) The vertical offset of the shadow in pixels (negative shifts up). Default: - service default

  • subtitle_rows (Optional[str]) – (experimental) For Teletext input, the number of lines for the captions bitmap. Default: - service default

  • teletext_grid_control (Optional[CaptionTeletextGridControl]) – (experimental) Whether a fixed grid is used to generate the subtitle bitmap (Teletext input). Default: CaptionTeletextGridControl.FIXED

  • x_position (Union[int, float, None]) – (experimental) The horizontal position of the captions in pixels from the left. Default: - determined by alignment

  • y_position (Union[int, float, None]) – (experimental) The vertical position of the captions in pixels from the top. Default: - positioned towards the bottom

Stability:

experimental

Return type:

CaptionDestination

classmethod dvb_sub(*, alignment=None, background_color=None, background_opacity=None, font=None, font_color=None, font_opacity=None, font_resolution=None, font_size=None, outline_color=None, outline_size=None, shadow_color=None, shadow_opacity=None, shadow_x_offset=None, shadow_y_offset=None, subtitle_rows=None, teletext_grid_control=None, x_position=None, y_position=None)

(experimental) DVB-Sub bitmap captions.

Parameters:
  • alignment (Optional[CaptionAlignment]) – (experimental) Caption alignment. With explicit x/y positions, the font is justified relative to them. Default: CaptionAlignment.CENTERED

  • background_color (Optional[CaptionBackgroundColor]) – (experimental) The color of the rectangle behind the captions. Default: - service default

  • background_opacity (Union[int, float, None]) – (experimental) The opacity of the background rectangle (0 transparent .. 255 opaque). Default: - service default

  • font (Optional[FileLocation]) – (experimental) An external font file (.ttf or .tte) used for burn-in. Provide a FileLocation referencing an S3 bucket (FileLocation.fromBucket, which auto-grants read access) or a URL (FileLocation.url). Default: - service default font

  • font_color (Optional[CaptionFontColor]) – (experimental) The color of the burned-in captions. Default: CaptionFontColor.WHITE

  • font_opacity (Union[int, float, None]) – (experimental) The opacity of the burned-in captions (0 transparent .. 255 opaque). Default: 255

  • font_resolution (Union[int, float, None]) – (experimental) The font resolution in DPI. Default: 96

  • font_size (Optional[CaptionFontSize]) – (experimental) Font size — CaptionFontSize.AUTO to scale with the output, or CaptionFontSize.of(points) for an exact size in points. Default: CaptionFontSize.AUTO

  • outline_color (Optional[CaptionOutlineColor]) – (experimental) The font outline color. Default: CaptionOutlineColor.BLACK

  • outline_size (Union[int, float, None]) – (experimental) The font outline size in pixels. Default: 2

  • shadow_color (Optional[CaptionShadowColor]) – (experimental) The color of the shadow cast by the captions. Default: CaptionShadowColor.NONE

  • shadow_opacity (Union[int, float, None]) – (experimental) The opacity of the shadow (0 transparent .. 255 opaque). Default: 0

  • shadow_x_offset (Union[int, float, None]) – (experimental) The horizontal offset of the shadow in pixels (negative shifts left). Default: - service default

  • shadow_y_offset (Union[int, float, None]) – (experimental) The vertical offset of the shadow in pixels (negative shifts up). Default: - service default

  • subtitle_rows (Optional[str]) – (experimental) For Teletext input, the number of lines for the captions bitmap. Default: - service default

  • teletext_grid_control (Optional[CaptionTeletextGridControl]) – (experimental) Whether a fixed grid is used to generate the subtitle bitmap (Teletext input). Default: CaptionTeletextGridControl.FIXED

  • x_position (Union[int, float, None]) – (experimental) The horizontal position of the captions in pixels from the left. Default: - determined by alignment

  • y_position (Union[int, float, None]) – (experimental) The vertical position of the captions in pixels from the top. Default: - positioned towards the bottom

Stability:

experimental

Return type:

CaptionDestination

classmethod ebu_tt_d(*, copyright_holder=None, default_font_size=None, default_line_height=None, fill_line_gap=None, font_family=None, style_control=None)

(experimental) EBU-TT-D sidecar captions.

Parameters:
  • copyright_holder (Optional[str]) – (experimental) The copyright holder included in the TTML copyright metadata tag. Default: - no copyright holder

  • default_font_size (Union[int, float, None]) – (experimental) The default font size. Default: - service default

  • default_line_height (Union[int, float, None]) – (experimental) The default line height. Default: - service default

  • fill_line_gap (Optional[EbuTtDFillLineGap]) – (experimental) How to handle the gap between multi-line captions. Default: - service default

  • font_family (Optional[str]) – (experimental) A comma-separated list of font families to include (valid only when styleControl is INCLUDE). Default: - ‘monospaced’

  • style_control (Optional[EbuTtDStyleControl]) – (experimental) Whether source style information is included in the EBU-TT-D font data. Default: - service default

Stability:

experimental

Return type:

CaptionDestination

classmethod embedded()

(experimental) Embedded (CEA-608/708) captions.

Stability:

experimental

Return type:

CaptionDestination

classmethod embedded_plus_scte20()

(experimental) Embedded plus SCTE-20 captions.

Stability:

experimental

Return type:

CaptionDestination

classmethod rtmp_caption_info()

(experimental) RTMP CaptionInfo captions.

Stability:

experimental

Return type:

CaptionDestination

classmethod scte20_plus_embedded()

(experimental) SCTE-20 plus embedded captions.

Stability:

experimental

Return type:

CaptionDestination

classmethod smpte_tt()

(experimental) SMPTE-TT sidecar captions.

Stability:

experimental

Return type:

CaptionDestination

classmethod teletext()

(experimental) Teletext captions.

Stability:

experimental

Return type:

CaptionDestination

classmethod ttml(*, style_control=None)

(experimental) TTML sidecar captions.

Parameters:

style_control (Optional[TtmlStyleControl]) – (experimental) Whether to pass through style and position from a TTML-like source. Default: TtmlStyleControl.PASSTHROUGH

Stability:

experimental

Return type:

CaptionDestination

classmethod webvtt(*, style_control=None)

(experimental) WebVTT sidecar captions.

Parameters:

style_control (Optional[WebvttStyleControl]) – (experimental) Whether to pass through source color and position to the WebVTT output. PASSTHROUGH is only valid for EMBEDDED or TELETEXT sources. Default: WebvttStyleControl.NO_STYLE_DATA

Stability:

experimental

Return type:

CaptionDestination