# Configure subtitle encoding

Before you start: ensure you have configured a [subtitle input stream](https://docs.mediakind.com/beam/live-encoder/configure/input/subtitle).

1. From the **Encoding** tab, go to the **Subtitle encoding** section.

2. Click **Add** to create a new subtitle processing configuration or click  to edit an existing one. The **Subtitles encoding** window displays.

3. Select the **Codec** to define how metadata is processed:
   - **Pass-through**
   - **DVB-Subtitles**
   - **DVB-Teletext**
   - **Closed caption CEA 608** (only valid with both IP TV export type and 25i/50p to 29.97i/59.94p frame rate conversion)
   - **DVB-TTML** (only valid with Internet TV export type)
   - **DASHIF-TTML** (only valid with Internet TV export type)

Possible values depend on [subtitle type](https://docs.mediakind.com/beam/live-encoder/parameters/input/subtitle).

4. Depending on the selected codec, [specific parameters](https://docs.mediakind.com/beam/live-encoder/parameters/encoding/subtitle) must be configured.

5. Click **Save and continue** or **Save and exit** to save your changes.

6. Add the conditioned metadata to the output stream (see [Define the output stream composition](https://docs.mediakind.com/beam/live-encoder/configure/output/configure-output#define-the-output-stream-composition)).

## Convert Teletext to Closed Caption

To convert Teletext to Closed Caption, follow these steps:

### Add input subtile

From the **Input** tab, go to the **Sources** > **Input streams selection** > **Subtitle ID** section then [Configure input subtitle selection](https://docs.mediakind.com/beam/live-encoder/configure/input/subtitle) by setting the **Type** to **Teletext**.

### Check Video adjustment

Go to the **Media processing** tab then go to the **Video processing** > **Video adjustment** section and check that **Frame rate conversion** is set to **25i/50p to 29.97i/59.94p**.

### Check export type

Go to the **Encoding** tab then check that **Export type** is set to **IPTV**.

### Configure subtitle encoding

Go to the **Metadata encoding** section to add and configure the subtitle encoding:

1. Click the **Add** button then set the **Codec** to **Closed caption CEA 608**.

2. Click the **Add** button then specify the input teletext **Magazine**, the **Page** and the destination CEA 608 **Field**.

3. Click **OK** to validate.

### Configure video encoding

Go to the **Video encoding** section to configure the video encoding.

1. Go to the **Video encoding** > **Stream metadata setting** section.

2. Tick the **Closed caption** checkbox then in the **Closed caption stream**, select the stream created in Step #5.

3. Click **OK** to validate.

### Add the video stream related to the output

1. Go to the **Output** tab.

2. Go to the **Output streams** section, then click either the **Add** button (if no stream has been selected) or  in the **Actions** column.

3. Select the video stream that you configured in Step #6 that includes the closed caption.

4. Click **OK** to validate. You should see the selected streams in the list of output streams.

## Convert Teletext to TTML

To convert Teletext to TTML, follow these steps:

### Add input subtile

1. From the **Input** tab, go to the **Sources** > **Input streams selection** > **Subtitle ID** section and [Configure input subtitle selection](https://docs.mediakind.com/beam/live-encoder/parameters/input/subtitle) by setting the **Type** to **Teletext**.

### Check export type

2. Check that **Export type** is set to **Internet TV**.

### Configure the subtitle encoding

1. Click the **Encoding** tab then go to the **Subtitle encoding** section. Teletext subtitle has been added to the **Encoding** tab. By default **Codec** is set to **Pass-through**.

2. Click  to edit the subtitle encoding.

3. Select the codec used to convert the subtitles, **DVB-TTML**. A new window let you configure the [TTML parameters](https://docs.mediakind.com/beam/live-encoder/parameters/encoding/subtitle#dvb-ttml).

4. Click **Ok** once done.

### Add the subtitle stream to the output

1. Click the **Output** tab.

2. Go to the **Output streams** section, then click either the **Add** button (if no stream has been selected) or the edit button,  in the **Actions** column.

3. Tick the subtitle stream that you configured in the previous step.

4. Click **OK** to validate. You should see the selected streams in the list of output streams.

## Convert ARIB B24 to DVB-Teletext

Only available with MPEG-2 TS/UDP input type (or MediaComposer with MPEG-2 TS/UDP source only).

To convert ARIB B24 subtitles to Teletext, follow these steps:

### Add an ARIB B24 subtitle at the input

1. From the **Input** tab, go to the **Sources** > **Input streams selection** > **Subtitle ID** section.

2. Click **Add** then set the **Type** to **ARIB B24** and enter either the **PID** or **Language** of the subtitle.

### Configure the subtitle encoding

1. Click the **Encoding** tab then go to the **Subtitle encoding** section. ARIB B24 subtitle has been added to the **Encoding** tab. By default **Codec** is set to **Pass-through**.

2. Click  to edit the subtitle encoding.

3. Select the codec used to convert the subtitles, **DVB-Teletext**.

### Add the subtitle stream to the output

1. Click the **Output** tab.

2. Go to the **Output streams** section, then click either the **Add** button (if no stream has been selected) or the edit button,  in the **Actions** column.

3. Tick the subtitle stream that you configured in the previous step.

4. Click **OK** to validate. You should see the selected streams in the list of output streams.

### Check that ARIB B24 subtitles are present

You can check that ARIB B24 subtitles are present in the input by displaying statistics.

You can check that ARIB B24 subtitles are present in the output by opening the output stream in a player.

## Convert CEA-608/708 Closed Captions to TTML for DASH output

To convert CEA-608/708 Closed Captions to TTML, follow these steps:

### Add input subtile

1. From the **Input** tab, go to the **Sources** > **Input streams selection** > **Subtitle ID** section and [Configure input subtitle selection](https://docs.mediakind.com/beam/live-encoder/parameters/input/subtitle) by setting the **Type** to **CEA-608/CEA-708 Closed Captions**.

### Check export type

2. Check that **Export type** is set to **Internet TV**.

### Configure the subtitle encoding

1. Click the **Encoding** tab then go to the **Subtitle encoding** section.

2. Click **Add**. A new window let you configure the subtitle parameters.

3. Select the codec used to convert the subtitles, **DVB-TTML** or **DASHIF-TTML** then configure the [DVB-TTML](https://docs.mediakind.com/beam/live-encoder/parameters/encoding/subtitle#dvb-ttml-with-cea-608cea-708-closed-captions-input) or [DASHIF-TTML](https://docs.mediakind.com/beam/live-encoder/parameters/encoding/subtitle#dash-if-ttml-with-cea-608cea-708-closed-captions-input).

4. Click **Ok** once done.

### Add the subtitle stream to the output

1. Click the **Output** tab.

2. Go to the **Output streams** section, then click either the **Add** button (if no stream has been selected) or the edit button,  in the **Actions** column.

3. Tick the subtitle stream that you configured in the previous step.

4. Click **OK** to validate. You should see the selected streams in the list of output streams.
