CaptionSelector

class aws_cdk.aws_medialive_alpha.CaptionSelector(name)

Bases: object

(experimental) A caption selector that identifies which captions to extract from the input.

Create with the static factory methods — one per caption source format.

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
    )
)
Parameters:

name (str)

Stability:

experimental

Attributes

name

(experimental) The name of this caption selector, used to associate it with caption outputs.

Unique within a channel.

Stability:

experimental

Static Methods

classmethod ancillary(name, *, source_channel_number=None)

(experimental) Select ancillary captions.

Parameters:
  • name (str)

  • source_channel_number (Union[int, float, None]) – (experimental) The captions channel (1-4) to extract from the ancillary captions. Required when converting to another caption format; ignored when passing through as embedded. Default: - MediaLive ignores the channel (passthrough)

Stability:

experimental

Return type:

CaptionSelector

classmethod arib(name)

(experimental) Select ARIB captions.

Parameters:

name (str)

Stability:

experimental

Return type:

CaptionSelector

classmethod by_language(name, language_code)

(experimental) Select captions by language code (no specific source format).

Parameters:
  • name (str)

  • language_code (str)

Stability:

experimental

Return type:

CaptionSelector

classmethod dvb_sub(name, *, ocr_language=None, pid=None)

(experimental) Select DVB-Sub (image-based) captions.

Parameters:
  • name (str)

  • ocr_language (Optional[OcrLanguage]) – (experimental) The OCR language to use when converting this image-based source to text. Default: - MediaLive service default

  • pid (Union[int, float, None]) – (experimental) The PID of the source content. Unused for DVB-Sub passthrough. Default: - MediaLive service default

Stability:

experimental

Return type:

CaptionSelector

classmethod embedded(name, *, convert608_to708=None, scte20_detection=None, source608_channel_number=None)

(experimental) Select embedded (CEA-608/708) captions.

Parameters:
  • name (str)

  • convert608_to708 (Optional[Convert608To708]) – (experimental) Whether to upconvert 608 captions to 708. Default: Convert608To708.DISABLED

  • scte20_detection (Optional[Scte20Detection]) – (experimental) SCTE-20 detection mode. Default: Scte20Detection.OFF

  • source608_channel_number (Union[int, float, None]) – (experimental) The 608/708 channel number within the video track to extract captions from. Default: - MediaLive service default

Stability:

experimental

Return type:

CaptionSelector

classmethod scte20(name, *, convert608_to708=None, source608_channel_number=None)

(experimental) Select SCTE-20 captions.

Parameters:
  • name (str)

  • convert608_to708 (Optional[Convert608To708]) – (experimental) Whether to upconvert 608 captions to 708. Default: Convert608To708.DISABLED

  • source608_channel_number (Union[int, float, None]) – (experimental) The 608/708 channel number within the video track to extract captions from. Default: - MediaLive service default

Stability:

experimental

Return type:

CaptionSelector

classmethod scte27(name, *, ocr_language=None, pid=None)

(experimental) Select SCTE-27 (image-based) captions.

Parameters:
  • name (str)

  • ocr_language (Optional[OcrLanguage]) – (experimental) The OCR language to use when converting this image-based source to text. Default: - MediaLive service default

  • pid (Union[int, float, None]) – (experimental) The PID to extract captions from. See the MediaLive docs for how PID and languageCode interact. Default: - MediaLive service default

Stability:

experimental

Return type:

CaptionSelector

classmethod smart_subtitle(name, *, caption_synchronization_mode=None, inference_feed_output=None)

(experimental) Select smart subtitles generated by Elemental Inference.

Parameters:
  • name (str)

  • caption_synchronization_mode (Optional[CaptionSynchronizationMode]) – (experimental) Controls whether MediaLive delays video to synchronize captions with audio and video output. Default: - service default

  • inference_feed_output (Optional[str]) – (experimental) The name of the Elemental Inference feed output that provides the subtitles. Default: - service default

Stability:

experimental

Return type:

CaptionSelector

classmethod teletext(name, *, output_rectangle=None, page_number=None)

(experimental) Select Teletext captions.

Parameters:
  • name (str)

  • output_rectangle (Union[CaptionRectangle, Dict[str, Any], None]) – (experimental) The caption rectangle to use when converting this source to EBU-TT-D or TTML. Default: - no rectangle (service default)

  • page_number (Optional[str]) – (experimental) The Teletext page number to extract captions from, as a hexadecimal string with no 0x prefix (range 1008FF). Unused for passthrough. Default: - MediaLive service default

Stability:

experimental

Return type:

CaptionSelector