# Configure subtitle encoding

Before you start: ensure you have configured a [subtitle input stream](/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 `Edit` 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)

> **Info:** Possible values depend on [subtitle type](/beam/live-encoder/parameters/input/subtitle).

4. Depending on the selected codec, [specific parameters](/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](/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](/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**.

   ![EL encoding video subtitle CC CEA608](/_machine-assets/c7132aa21557047e99ea3c9c37335aed5610ae167b44e9aeadcc6d56e6d1051d.png)

3. Click **OK** to validate.

### Configure subtitle 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.

   ![EL encoding video metadata settings CC](/_machine-assets/0390aa33a33720f6ca0be31b1261b243e825724aabd260a27d91c14acae164cd.png)

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 `Edit` in the **Actions** column.

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

   ![EL output stream video CC](/_machine-assets/13600b253ee55f256702c70b78ca03bbace8db2be7c8817b8a40b17e4a51bf14.png)

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](/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 `Edit` 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](/beam/live-encoder/parameters/encoding/subtitle#dvb-ttml).

4. Click **Ok** once done. You should get the following:

   ![el ttml encoding](/_machine-assets/82fbd4cac8519ceb34a01f4b762ea4c2073b50bc3074a236eb6a75203777811a.png)

### 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, `Edit` 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.

   ![el ttml output](/_machine-assets/484c53060abca88cb99758cade436239bdf7a36e9f3322fdc918eda8e43674a4.png)

## Convert ARIB B24 to DVB-Teletext

> **Info:** 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. You should get the following:

   ![el arib input](/_machine-assets/66778c1184cfb0d31f941c8efb539f12850963cfdaefc7dfa1c14541761a86d9.png)

### 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 `Edit` to edit the subtitle encoding.

3. Select the codec used to convert the subtitles, **DVB-Teletext**. You should get the following:

   ![el arib encoding](/_machine-assets/e9c87b65a07a716293b3f2d5032b2c774ea0e822ff735fea4b517313b4951c04.png)

### 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, `Edit` 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.

   ![el arib output](/_machine-assets/dac776d74d22fbea26c5abd876893fed24399ece6480db8edfb306b89c8a759d.png)

### Check that ARIB B24 subtitles are present

.  You can check that ARIB B24 subtitles are present in the input by displaying statistics.
![el arib stats](/_machine-assets/0d0872953b02858c605ae948d5207d0c782ee1ebcf9713f411bd29cb49d183af.png)

.  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](/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](/beam/live-encoder/parameters/encoding/subtitle#dvb-ttml-with-cea-608cea-708-closed-captions-input) or [DASHIF-TTML](/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, `Edit` 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

> **Info:** 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. You should get the following:

   ![el arib input](/_machine-assets/66778c1184cfb0d31f941c8efb539f12850963cfdaefc7dfa1c14541761a86d9.png)

### 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 `Edit` to edit the subtitle encoding.

3. Select the codec used to convert the subtitles, **DVB-Teletext**. You should get the following:

   ![el arib encoding](/_machine-assets/e9c87b65a07a716293b3f2d5032b2c774ea0e822ff735fea4b517313b4951c04.png)

### 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, `Edit` 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.

   ![el arib output](/_machine-assets/dac776d74d22fbea26c5abd876893fed24399ece6480db8edfb306b89c8a759d.png)

### Check that ARIB B24 subtitles are present

.  You can check that ARIB B24 subtitles are present in the input by displaying statistics.
![el arib stats](/_machine-assets/0d0872953b02858c605ae948d5207d0c782ee1ebcf9713f411bd29cb49d183af.png)

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

## Convert DVB-Sub to DVB-Teletext using OCR

> **Info:** This feature relies on an open-source OCR (Optical Character Recognition) engine that extracts printed or written text from images. Once converted to Text, the subtitles are converted to DVB-Teletext.

To convert DVB-Subtitles to DVB-Teletext, follow these steps:

### Add a DVB 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 **DVB-Subtitles** and enter either the **PID** or **Language** of the subtitle. You should get the following:

   ![el dvbsub input](/_machine-assets/8e2aab64285052a0b4979be6329550b5d9fc2d506eee1f9bcd0d4bee405391c9.png)

### Configure the subtitle encoding

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

2. Click `Edit` to edit the subtitle encoding.

> **Info:** Usually, there is no need to set the Forced language field because the language is directly retrieved from the input DVB Subtitles. If the language is not set or is wrong in the input DVB subtitle descriptor, it can be set by the "Forced language" field.

3. Select the codec used to convert the subtitles, **DVB-Teletext**. You should get the following:

   ![el dvbsub encoding](/_machine-assets/8894c2171dec0411bcf21797b7c4f5ef8cb696a2d35c719fce8971f94dbc00c3.png)

### 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, `Edit` 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.

   ![el dvbsub output](/_machine-assets/cb6604c66fbcc2f49119914b52d2a0b2a00c63b71e7a13f4799bc3395fc6d59d.png)

### Check the average OCR confidence

You can display statistics to check the average OCR confidence (in the range 0-100) on the last converted subtitle.

### Check that DVB subtitles are present

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