Configuring a Live encoding service is a 3-step procedure:

1. [Step #1: Create a Live encoding service](/traditional-products-and-appliances/how-to/alternate-content/switch-to-ts-playlist/live-encoder-configuration#step-1-create-a-live-encoding-service).
2. [Step #2: Configure the Live Encoding service](/traditional-products-and-appliances/how-to/alternate-content/switch-to-ts-playlist/live-encoder-configuration#step-2-configure-the-live-encoding-service).
3. [Step #3: Assign a server to run the service](/traditional-products-and-appliances/how-to/alternate-content/switch-to-ts-playlist/live-encoder-configuration#step-3-assign-a-server-to-run-the-service).

## Step #1: Create a Live encoding service

Select **Services** > **Add service** > **Live encoding**. The service **General** tab is displayed.

## Step #2: Configure the Live Encoding service

To configure Live Encoder, follow these steps:

1. [Configure service general parameters](/traditional-products-and-appliances/how-to/alternate-content/switch-to-ts-playlist/live-encoder-configuration#configure-service-general-parameters).
2. [Configure input parameters](/traditional-products-and-appliances/how-to/alternate-content/switch-to-ts-playlist/live-encoder-configuration#configure-input-parameters).
3. [Configure encoding parameters](/traditional-products-and-appliances/how-to/alternate-content/switch-to-ts-playlist/live-encoder-configuration#configure-encoding-parameters).
4. [Configure output parameters](/traditional-products-and-appliances/how-to/alternate-content/switch-to-ts-playlist/live-encoder-configuration#configure-output-parameters).

### Configure service general parameters

1. From the **General** tab, enter a service name.

2. Enter the **ESAM network interface**. This example uses the management interface.

3. Select the **Activate** checkbox to enable the **Automation** features then configure the parameters:

   <table>
     <thead>
       <tr>
         <th style="text-align: left">Parameter</th>
         <th style="text-align: left">Value</th>
         <th style="text-align: left">Description</th>
       </tr>
     </thead>
     <tbody>
       <tr>
         <td style="text-align: left">Interface Type</td>
         <td style="text-align: left">ESAM</td>
         <td style="text-align: left">Protocol used with automation system.</td>
       </tr>
       <tr>
         <td style="text-align: left">POIS URL</td>
         <td style="text-align: left"><code>http://controller.example:8080/api/esam/streamConditionings/SwitchToTS_Zone1</code></td>
         <td style="text-align: left">URL on which Live Encoder will return status to Prisma.<br> <code>http://&lt;controllerVIP&gt;:&lt;prisma.controller.port&gt;/api/esam/streamConditionings/&lt;endPointID&gt;</code><br><strong>Note:</strong> <code>&lt;endPointID&gt;</code> corresponds to the ID of the Stream Conditioning service that you previously created on Prisma.</td>
       </tr>
       <tr>
         <td style="text-align: left">POIS network name</td>
         <td style="text-align: left">SwitchToTS</td>
         <td style="text-align: left">ID shared with the POIS for the current channel.<br>Same as the <strong>Network name</strong> in <a href="/traditional-products-and-appliances/how-to/alternate-content/switch-to-ts-playlist/stream-conditioning-configuration"><strong>Stream Conditioning</strong> &gt; <strong>Connections</strong></a>.</td>
       </tr>
       <tr>
         <td style="text-align: left">POIS zone identity</td>
         <td style="text-align: left">Zone1</td>
         <td style="text-align: left">The area ID for this channel distribution. Commonly used for regionalization.<br>Same as the <strong>Zone identity</strong> in <a href="/traditional-products-and-appliances/how-to/alternate-content/switch-to-ts-playlist/stream-conditioning-configuration"><strong>Stream Conditioning</strong> &gt; <strong>Connections</strong></a>.</td>
       </tr>
       <tr>
         <td style="text-align: left">Assets directory</td>
         <td style="text-align: left">Your configured asset directory</td>
         <td style="text-align: left">You can specify the directory where assets are stored. Must be an absolute directory path (starting by "/"). For logo and blackout files, an http url is also possible.</td>
       </tr>
     </tbody>
   </table>

### Configure input parameters

1. Open the **Input** tab to configure input according to your network configuration.

2. Configure **General parameters**: Select **MediaComposer** for **Type**.

3. Configure the **Live source management** parameters:

   <table>
     <thead>
       <tr>
         <th style="text-align: left">Parameter</th>
         <th style="text-align: left">Value</th>
         <th style="text-align: left">Description</th>
       </tr>
     </thead>
     <tbody>
       <tr>
         <td style="text-align: left">Default service ID</td>
         <td style="text-align: left">MainChannel</td>
         <td style="text-align: left">ID of the live content that will be used at the start of the service. You can either:<br> - select an existing ID. If required, this ID can be directly modified via the <code>Edit</code> icon button.<br> - or create a new ID: either immediately by clicking the <strong>+</strong> button, or later from the <strong>Settings</strong> &gt; <strong>Live service lineup</strong> left-side menu panel.<br><strong>Note:</strong> IDs are defined in the <a href="/traditional-products-and-appliances/how-to/alternate-content/switch-to-ts-playlist/lineup">lineup configuration file</a>.</td>
       </tr>
       <tr>
         <td style="text-align: left">Default frame rate</td>
         <td style="text-align: left">24p</td>
         <td style="text-align: left">Default frame rate used when live input is not yet detected.</td>
       </tr>
     </tbody>
   </table>

4. Configure the **File source management** parameters:

   <table>
     <thead>
       <tr>
         <th style="text-align: left">Parameter</th>
         <th style="text-align: left">Value</th>
         <th style="text-align: left">Description</th>
       </tr>
     </thead>
     <tbody>
       <tr>
         <td style="text-align: left">Auto Return to Live</td>
         <td style="text-align: left">Select this checkbox.</td>
         <td style="text-align: left">If checked, returns to live at end of the offline source playlist.<br><strong>Note:</strong> Unused in Switch to TS use case.</td>
       </tr>
       <tr>
         <td style="text-align: left">Return to Live on error</td>
         <td style="text-align: left">Select this checkbox.</td>
         <td style="text-align: left">If checked, returns to live if offline source playlist cannot be loaded.<br><strong>Note:</strong> Unused in Switch to TS use case.</td>
       </tr>
     </tbody>
   </table>

5. Configure the **Sources**.

   1. Configure the **MPEG62 TS/UDP** parameters:

      <table>
        <thead>
          <tr>
            <th style="text-align: left">Parameter</th>
            <th style="text-align: left">Value</th>
            <th style="text-align: left">Description</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td style="text-align: left">Input redundancy</td>
            <td style="text-align: left">Active/Passive</td>
            <td style="text-align: left">Choose the redundancy settings. Two modes can be set when two multicast sources (primary and secondary) are available:<br> - In active/passive mode, the passive source is idle and does not even join the multicast address or capture UDP packets.<br> - In active/active mode, both sources capture in parallel, provide statistics on transport and demux layers, but only one source is fully decoded at any given time.</td>
          </tr>
          <tr>
            <td style="text-align: left">Primary interface</td>
            <td style="text-align: left">Your management interface</td>
            <td style="text-align: left">Name of the input interface used to capture the input stream.<br><strong>Note:</strong> In our example, we are using the management interface.</td>
          </tr>
          <tr>
            <td style="text-align: left">Secondary interface</td>
            <td style="text-align: left">Leave empty.</td>
            <td style="text-align: left">Name of the input interface used to capture the input stream (secondary source).<br><strong>Note:</strong> Only necessary in case of Active/Active redundancy.</td>
          </tr>
        </tbody>
      </table>

   2. Configure **Audio and Video inputs**.

   3. Configure the **Out of band stream** to receive information from Prisma:

      <table>
        <thead>
          <tr>
            <th style="text-align: left">Parameter</th>
            <th style="text-align: left">Value</th>
            <th style="text-align: left">Description</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td style="text-align: left">Type</td>
            <td style="text-align: left">SCTE-35 OOB</td>
            <td style="text-align: left">Select the type of metadata.</td>
          </tr>
          <tr>
            <td style="text-align: left">Network name</td>
            <td style="text-align: left">SwitchToTS</td>
            <td style="text-align: left">Corresponds to the Acquisition Point Identity defined in the ESAM specification.</td>
          </tr>
          <tr>
            <td style="text-align: left">Zone identity</td>
            <td style="text-align: left">Zone1</td>
            <td style="text-align: left">Corresponds to the Zone Identity defined in the ESAM specification.</td>
          </tr>
          <tr>
            <td style="text-align: left">Recover conditioning state if failover</td>
            <td style="text-align: left">Leave to <strong>No</strong></td>
            <td style="text-align: left">Selecting <strong>POIS</strong> enables to keep the conditioning status after an encoder failover by asking to an external system. It requires entering the POIS URL and network interface name.</td>
          </tr>
          <tr>
            <td style="text-align: left">Automation stream</td>
            <td style="text-align: left">Select this checkbox.</td>
            <td style="text-align: left">Activates Live Encoder out-of band interface to communicate with Prisma.</td>
          </tr>
        </tbody>
      </table>

6. Select **OK**. Review the **Input** tab.

7. Select **Save and continue** to save your changes.

8. Leave the **Media processing** parameters unchanged.

### Configure encoding parameters

1. From the **Encoding** tab, create the following streams:

   - ABR video stream
   - Audio stream
   - Metadata stream

2. Select **Save and continue** to save your changes.

### Configure output parameters

1. Open the **Output** tab then select **Add an output**.

2. Configure the **General parameters** according to your network configuration, especially check that **GOP signaling** is set to **EBP based** to be compliant with Live Packaging.

3. Leave the **Common MPEG-2 TS parameters** unchanged.

4. Configure the **Output stream** for this service:

   1. Scroll to **Output streams**, then select **Add**.

   2. Configure the output stream:

      - **IP Address**: address to output the stream
      - **Port**: port number to stream on

   3. Select the encodings to include in the output stream:

      - Video encoding for this output stream
      - At least one audio encoding
      - Metadata encoding

   4. Select **OK**.

5. Select **Save and exit** to save the configuration and return to **Services**.

## Step #3: Assign a server to run the service

Services require a server to run. Select a server for each service before starting the service.

1. Display services.

2. Select the field in the **Mandatory** column to display available servers.

3. Enter a server name or select a server from the list.

4. Select `Play` icon to start the service.

5. Select `Pie chart` icon to display service details and to monitor the service.

6. Continue to [Create an alternate content operation](/traditional-products-and-appliances/how-to/alternate-content/switch-to-ts-playlist/create-alternate-content-operation).
