

# Dynamic input switching
<a name="dynamic-content-switching"></a>

The dynamic input switching feature lets you use REST API commands to switch inputs in an AWS Elemental Live event. This method of input switching has two key features:
+ The switching control (the REST API) is built into Elemental Live. You don't need an external server to control switching.
+ You can modify the *playlist* of inputs without stopping the event. This ability to dynamically change the playlist is useful when you can't identify all of the inputs that you want to use in advance (before starting the event).

You can also switch inputs by using virtual input switching with an ESAM server. For more information, see [Virtual input switching](feature-vips.md).

**Note**  
Use only one mechanism to control input switching. Don't give control of the input switching logic to both an ESAM server and a REST-based application. We strongly recommend against implementing a combination of these input switching features.

**How dynamic input switching works**

The dynamic input switching feature works as follows. When you create the event, you set up only the first input that you plan to process.

After you start the event, use the Elemental Live REST API to add more inputs to the event. You can create a playlist consisting of any number of live inputs, or file inputs, or both. This gives you a playlist consisting of the first input (which is currently being processed) and the inputs that you added using the REST API. 

An input switch can occur in one of these ways:
+ REST API-triggered switch. You switch to a different input by entering a REST API command to activate that input. This input can be any input in the playlist. You can set it up so that an input becomes active immediately or at a specific time. 
+ Automatic switch. If Elemental Live gets to the end of a file input that is not set up to loop, then Elemental Live switches to the next input in the list of inputs in the event.

  This method works well when you have a series of file inputs such as ad content. In this case, you let Elemental Live go through the inputs one by one. Before the series ends, enter a REST API command to activate a different input (perhaps a live input). This is to break out of the event order.

You can modify the playlist to add and remove inputs. If your event runs on a 24/7 basis, you will typically remove old inputs and add a fresh set of inputs on a regular basis.

# Typical use cases
<a name="typical-use-cases"></a>

## Use case 1
<a name="use-case-1"></a>

An event is designed to process live feed from a specific source. The input does not include ad markers. 

You create a dynamic playlist in the event to process the live input. Then, at a given time, process one or more file inputs (the ad content). After that, switch back to the live input, either at a given time or when the last ad content has been processed. The dynamic playlist consists of the single live input “interrupted” periodically by ad content. 

## Use case 2
<a name="use-case-2"></a>

 An event is designed to process live feed from a specific source. Periodically, the live feed should be replaced by file content (perhaps a movie). Then the same live feed should be resumed. 

## Use case 3
<a name="use-case-3"></a>

 An event is designed to process live feed from a specific source. However, you may need to cut away from the live feed to process a file input. This cutaway file may be planned: For example, you may have a “broadcasting will resume shortly” message already prepared). Alternatively, the cutaway file may be something that is created on the spot to convey an unanticipated public announcement. 

You create an event to process the live input. You then either create a dynamic playlist ahead of time to switch to a special file input, if necessary. Or at the last minute you create the entire dynamic playlist and its input, and then switch to it immediately. 

## Use case 4
<a name="use-case-4"></a>

 An event is designed to process live feed from a specific source. Another event is designed to process live feed from a different source. 

Before the dynamic playlist feature was introduced, you could only switch to the other live feed by stopping one event and starting the other. Now, you can merge these two events into one event, with each live feed in the dynamic playlist. You can set up the dynamic playlist to switch from one feed to another either at a scheduled time, or when the operator interrupts. 

## Use case 5
<a name="use-case-5"></a>

 An event is designed to process file inputs, one after the other, without the event ending. 

Before the dynamic playlist feature was introduced, you could add inputs to the event, but only one at a time. Now, you can add as many inputs as you want in one command. 

In a variation of this use case, the event may contain only two files. The event can be set up so that as soon as one input ends, the next one starts over again, but with different content specified inside that input. 

## Use case 6
<a name="use-case-6"></a>

 An event is designed to process file content (perhaps a movie). Periodically, the file content should be replaced by different file content that contains ad content. Then the original file content should be resumed. 

You create a dynamic playlist in the event that interleaves sections of the movie with ad content, so: movie, ad content, movie, ad content, movie, and so on. All the inputs are file inputs. 

Each time you add the movie file as an input, you include the input clipping tags to create a clip out of a different segment of the movie: 0 to 20 minutes, 20 to 25 minutes, 25 to 40 minutes, and so on. Each time that the movie resumes, it will resume at the desired point. 

# The procedures
<a name="content-switching-procedure"></a>

**Topics**
+ [

# General procedure
](general-procedure.md)
+ [

# Sample implementations
](sample-implementations.md)
+ [

# Details on preparing inputs
](details-on-preparing-inputs.md)
+ [

# Details on activating inputs
](details-on-activating-inputs.md)
+ [

# Monitoring activity through the web interface
](monitoring-activity-via-web.md)
+ [

# Monitoring activity through the API
](monitoring-activity-via-api.md)

# General procedure
<a name="general-procedure"></a>

**Topics**
+ [

## Step A: Design the dynamic playlist
](#step-design)
+ [

## Step B: Create and start the event
](#step-create)
+ [

## Step C: Add more inputs
](#step-add-more-inputs)
+ [

## Step D: Prepare inputs
](#step-prepare)
+ [

## Step E: Activate inputs
](#step-active)
+ [

## Step F: Continue adding to the dynamic playlist
](#step-add-more)
+ [

## Step G: Interrupt the currently active input
](#step-interrupt)
+ [

## Step H: Clean up the playlist
](#step-clean)
+ [

## Step I: Troubleshoot
](#step-troubleshoot)

## Step A: Design the dynamic playlist
<a name="step-design"></a>

### Identify inputs
<a name="identify-inputs"></a>

1. Identify the inputs and the order in which they are to play. 
+ The first input can be a live asset or a file asset.
+ The inputs can be all live assets, all file assets, or a mix of live and file assets.
+ The same input can be repeated as many times as you want in the dynamic playlist. 

Generally, it is a good idea to add the inputs to the event in the order in which they will be played. You should do this even if you plan to specify a start time for some or all inputs (below). 

### Identify inputs to prepare manually
<a name="identify-inputs-to-prepare-manually"></a>

2. Identify inputs that must first be prepared:
+ Live streaming inputs: You must manually prepare each live input before it is due to be played. 
+ File inputs: There is no need to manually prepare file inputs, but you may do so if you prefer. Perhaps a reason to prepare is that you know you have to prepare live inputs and you want to follow the same steps for both live and file inputs.

### Identify inputs to activate manually
<a name="identify-inputs-to-activate-manually"></a>

3. Identify inputs that must start at a specific time, rather than simply starting after the previous input ends.

If you follow the recommended procedure (Step E: below), you will need a placeholder input. Read the procedure in Step E: so that you can prepare this input now.

## Step B: Create and start the event
<a name="step-create"></a>

4. Create the event with only the first input. (If the event contains more than one input, the others will be deleted when you create the dynamic playlist.)

Use the REST API Create Event command or use the web interface. See below for tips on setting up the event for the different use cases.

5. Start the event. Use the REST API or the web interface. Processing starts on that single input.

## Step C: Add more inputs
<a name="step-add-more-inputs"></a>

6. Once the event has been started, you can create the dynamic playlist in order to add more inputs to the event. 

There are two ways to add inputs to the dynamic playlist:
+ Use the Add Dynamic Playlist Inputs command to create an array of inputs that are appended to the inputs currently in the event. Up to 29 inputs can be added in this way. For more information, see [Add dynamic playlist inputs](add-dynamic-playlist-inputs.md).
+ Use the Replace Dynamic List command to create an array of inputs that replaces the existing dynamic playlist (except for the currently running input). You can add any number of inputs this way. For more information, see [Replace dynamic playlist](replace-dynamic-playlist.md).

## Step D: Prepare inputs
<a name="step-prepare"></a>

7. If you have identified inputs that must be manually prepared, then as soon as one of those inputs becomes “next in line”, you prepare it by calling [Prepare dynamic playlist input](prepare-dynamic-playlist-input.md). 
+ Time the preparation correctly: For a live input, you must prepare enough time in advance to allow Elemental Live to inspect the entire next-in-line input and decode at least one frame. But you should not prepare it too far in advance because once preparation starts, this is what happens: 

  Elemental Live inspects the entire input then decodes the first frame in the pipeline. If this input is still not due to run, it discards that frame and decodes the frame that is now first in the pipeline. It discards that frame and decodes the frame that is now first in the pipeline, on and on until the input is due to run. This decoding obviously uses processing resources. 
+ This timing rule does not apply to file inputs. 
+ You can optionally specify a prepare time. The input will transition to the Prepare state but no preparing will actually occur until the specified time.
+ Keep in mind that you can only manually prepare one input at a time: if you prepare input A, do not prepare the next input until input A is active. If you do, input A may not start as expected. 

For more information about the rules around preparation, see [Details on preparing inputs](details-on-preparing-inputs.md).

## Step E: Activate inputs
<a name="step-active"></a>

8. For each input that must start at a specific time, set the activate time when the input is next in line.

### Activating using placeholders
<a name="activating-using-placeholders"></a>

Scheduling inputs is a bit tricky because an Elemental Live event must always be encoding: there is no concept of waiting for a frame to arrive. Therefore, if you do not time input B to start immediately after input A ends, then Elemental Live will move to the next input that does not have an activate time (perhaps the input that appears after input B in the XML). But it is very difficult to get this timing between inputs exact enough. 

The workaround is to use a “placeholder” input between inputs A and B, as follows:
+ Estimate the expected end time of input A. 
+ Assign an activate time for input B that is as close to the end time without being before it. (In this way, input A is not interrupted.)
+ Between input A and input B insert a “placeholder” file input (this input could be a blackout slate, for example). Do not assign a start to this placeholder but do set the loop\$1source tag to true for this input in order to play the content repeatedly until it is time to return to the live input.

This will be the result: if input A end time does not exactly match the activate time for input B, then the placeholder will play. When the activate time for input B arrives, the placeholder will be interrupted by input B. Input B will start at the scheduled time.

## Step F: Continue adding to the dynamic playlist
<a name="step-add-more"></a>

9. As inputs are run, add more inputs to the event. 
+ So long as the event is still running, you can continue to add inputs to it; the event will not end.
+ Add inputs using either the [Add Dynamic Playlist Inputs](add-dynamic-playlist-inputs.md) command or the [Replace Dynamic List](replace-dynamic-playlist.md) command.

## Step G: Interrupt the currently active input
<a name="step-interrupt"></a>

Occasionally, you may need to interrupt the current active input and start a different input (input B). See [Implementing use case 3](sample-implementations.md#implementing-use-case-3) for an example of an unanticipated interruption.
+ If necessary, add input B to the dynamic playlist. There are two ways to add:
  + Rebuild the entire playlist, with input B inserted at the top, using the Replace Dynamic Playlist command. The currently active input will not be removed when you do this. For more information, see [Replace dynamic playlist](replace-dynamic-playlist.md).
  + Append input B to the end of the playlist, using the Add Dynamic Playlist Inputs command. The drawback to this method is that the input appears at the end of the playlist on the web interface, but then gets activated, which may confuse your operators. For more information, see [Add dynamic playlist inputs](add-dynamic-playlist-inputs.md).
+ If input B is a live input, prepare it using the Prepare Dynamic Playlist command. For more information, see [Prepare dynamic playlist input](prepare-dynamic-playlist-input.md).
+ Use the Activate Dynamic List Input command (without an activate time) to immediately activate the input. For more information, see [Activate dynamic playlist input](activate-dynamic-playlist-input.md).

## Step H: Clean up the playlist
<a name="step-clean"></a>

10. The dynamic playlist is never automatically cleaned up; even after an input has been processed, it remains on the dynamic playlist. 
+ If you use the Replace Dynamic Playlist command, the entire playlist is replaced, which effectively cleans up old inputs. Fore more information, see [Replace dynamic playlist](replace-dynamic-playlist.md).
+ If you use the Add Dynamic Playlist Inputs command, then you may want to occasionally use the Delete Dynamic Playlist Input command. For more information, see [Delete dynamic playlist input](delete-dynamic-playlist-input.md).

## Step I: Troubleshoot
<a name="step-troubleshoot"></a>

If the dynamic playlist is not behaving as expected, see the information about preparation and activation, starting [here](details-on-preparing-inputs.md). You may have broken a preparation or activation rule.

# Sample implementations
<a name="sample-implementations"></a>

## Implementing use case 1
<a name="implementing-use-case-1"></a>

Use case 1 is described [here](typical-use-cases.md#use-case-1).

1. Create an event that has the live feed as the input. 

1. Once the event starts, create a dynamic playlist that consists of the following:
   + Second input – ad content – from file.
   + Third input – live input (identical to first input). 
   + Fourth input - ad content – from file.
   + And so on.

1. Immediately set an activate time for the second input. The first input will be interrupted by the second input at this time.

1. After the second input becomes Active, prepare the third input. 

   When the second input ends, the third input will immediately become Active.

1. After the third input becomes Active, set an activate time for the fourth input. The third input will be interrupted by the fourth input at this time.

## Implementing use case 2
<a name="implementing-use-case-2"></a>

Use case 2 is described [here](typical-use-cases.md#use-case-2).

1. Create an event that has the live feed as the input. 
   + Once the event starts, create a dynamic playlist that consists of the following:
     + Second input – ad content – from file. 
     + Fourth input and others – file input, as required. 
     + Finally, create an input to return to the live feed (same input source as the first input).

1. Immediately set an activate time for the second input in order to interrupt the live feed at the desired time.

   The third input and others will play one after the other, one starting when the previous has completed.

1. When the last file input becomes Active:
   + Optionally set an activate time to return to the live feed. Or omit an activate time and let the live feed resume when the last file has completed.
   + Prepare the live input you are returning to. 

## Implementing use case 3
<a name="implementing-use-case-3"></a>

Use case 3 is described [here](typical-use-cases.md#use-case-3).

1. Create an event that has the live feed as the input. 

1. Once the event starts, create a dynamic playlist that consists of the following:
   + Second input – a file that displays the desired content. Include the loop\$1source tag for this input in order to play the content repeatedly until it is time to return to the live input.
   + Third input – live input (identical to the first input). 

1. If an unanticipated event occurs, switch to the second input: either use the REST API (Activate Dynamic Playlist Input) or let the operator manually activate this input using the web interface control.

1. When you want to resume live input, prepare the third input and then switch to the third input.

1. If another unanticipated event occurs, you can switch again to the second input.

## Implementing use case 4
<a name="implementing-use-case-4"></a>

Use case 4 is described [here](typical-use-cases.md#use-case-4).

1. Create an event that has the live feed as the input. 

1. Once the event starts, create a dynamic playlist that consists of the following:
   + Second input – a live input from a different live source. 

1. Follow the desired action:
   + Optionally set an activate time to return to the live feed. Or omit an activate time and let the live feed resume when the last file has completed. Or omit the activate time and manually switch to the second input: either use the REST API (Activate Dynamic Playlist Input) or let the operator manually activate the second input using the web interface control.
   + Prepare the live input you are returning to. 

## Implementing use case 5
<a name="implementing-use-case-5"></a>

Use case 5 is described [here](typical-use-cases.md#use-case-5).

1. Create an event that has the first file as the input. In the event, set loop\$1all\$1inputs to true.

1. Once the event starts, create a dynamic playlist that consists of the following:
   + Second input – a file input. 

1. Once the second input has become Active:
   + Modify the first input to point to a different file source. Change other tags as required (for example, the audio selectors).
   + Optionally set an activate time for the first input.

   When the second input has ended, the first input will become Active again.

1. Once the first input has become Active again:
   + Modify the second input to point to a different file source. Change other tags as required (for example, the audio selectors).
   + Optionally set an activate time for the second input.

1. Repeat as required.

## Implementing use case 6
<a name="implementing-use-case-6"></a>

Use case 6 is described [here](typical-use-cases.md#use-case-6).

1. Create an event that has the live feed as the input. 

1. Once the event starts, create a dynamic playlist that consists of the following:
   + Second input – a file input such as a movie. Include the input\$1clipper tags to clip content. For example, clip it to run from the 0 mark to the 20 minute mark.
   + Third input – ad content – from file. 
   + Fourth input – file input identical to the second input. Include the input\$1clipper tags to clip content, for example, to clip it to run from the 20 minute mark to the 35 minute mark.
   + Fifth input – ad content – from file. 
   + Continue switching between the movie and ads.
   + Finally, create a dynamic playlist to return to the live feed. 

1. Let each input complete. The next input in the XML will automatically start. 

1. When the last file input becomes Active:
   + Optionally set an activate time to return to the live feed. Or omit an activate time and let the live feed resume when the last file has completed.
   + Prepare the live input you are returning to. 

# Details on preparing inputs
<a name="details-on-preparing-inputs"></a>

Read this section if your inputs are not being prepared as expected.

## File inputs vs live streaming inputs
<a name="file-inputs-vs-live-inputs"></a>
+ Preparing a live input involves a one-time inspection of the stream to determine what audio, video, and data tracks it holds and then continually decoding the frames. So: frame X gets decoded; the input does not become Active so frame X is discarded; frame Y gets decoded; the input does not become Active so frame Y is discarded; and so on decoding and discarding until finally the input does become Active. 

  As you can see, this preparation may be expensive in terms of processing power.
+ File inputs are automatically prepared just before they are Due-to-be-processed. Preparation of a file input involves decoding the first frame; after that, processing pauses until the input becomes Due-to-be-processed. Preparation of file inputs is not expensive.

## Rules for preparing
<a name="rules-for-preparing"></a>
+ The input must not be currently Active.
+ Only one input can be in the Prepared state at a time. If you manually prepare input A and then manually prepare input B before A becomes Active, input A will become unprepared.
+ An input is put in the Prepared state only when the Prepare command is called on that input. So if a file input that is unprepared is Due-to-be-processed, it transitions directly to the Active state, where it gets both prepared and Active. This means that you can safely prepare a live input several inputs ahead of time, if you want.
+ Timing of the manual prepare is important: 
  + You should probably prepare a live input only when it is the Next-in-line.
  + You must prepare enough time in advance to allow Elemental Live to inspect the entire third input and decode at least one frame. 
  + If the current input is quite long, you may want to wait until it is close to completion before preparing the Next-in-line input. 
+ If you prepare an input and specify a prepare time, note that the input will transition to the Prepare state but no preparing will occur until the specified time.
+ If you both manually prepare an input with a prepare time and manually activate it with an activate time, make sure the prepare time is before the activate time; Elemental Live does not check.
+ When you call Prepare Immediately on an input that has previously been set up to be prepared at a time that is still in the future, the input will prepare immediately and the future preparation will be cleared. It will not be prepared both immediately and in the future. 

  For example, you prepare with a prepare time of 2:00 p.m., then you prepare it immediately, then the input becomes Active and completes at 1:45 p.m. The input will not get prepared again at 2:00 p.m.
+ If you prepare input X with a prepare time, any previously prepared input will immediately become unprepared, even though the preparation of input x is still in the future. although input x is not being prepared, it is still considered to be in the Prepared state; only one input can be Prepared at a time, so the previous input becomes unprepared.

# Details on activating inputs
<a name="details-on-activating-inputs"></a>

## Dynamic playlist order rules
<a name="dynamic-playlist-order-rules"></a>

When an input starts to be processed (it is “playing”), that input becomes “active”. 

A file input typically moves through these stages:
+ Idle and not prepared.
+ Next-in-line and not prepared.
+ Due-to-be-processed and not prepared.
+ Active (prepared and processing).
+ Idle (completed)

A live input typically moves through these stages:
+ Idle and not prepared.
+ Next-in-line and prepared.
+ Due-to-be-processed and prepared.
+ Active (processing).
+ Idle (completed)

### Idle
<a name="idle"></a>

Any number of inputs can be idle.

The list of idle inputs includes inputs that have completed and those that have not been processed.

### Next-in-Line
<a name="next-in-line"></a>

Only one input can be Next-in-line. This is the input that is either:
+ The input that is after the currently active input, based on the order in which the inputs appear in the event XML and on the web interface.
+ The input that has an activate time that exactly aligns with the end time of the current input. 

Ideally, you should order the inputs in the XML so that an input that has an activate time also appears in its natural order. For example, it does not appear at the end of the list; this placement will cause confusion to your operators.

A next-in-line input may be prepared or unprepared. 

### Due-to-be-processed input
<a name="due-to-be-processed"></a>

The input that is currently Next-in-line becomes Due-to-be-processed at the moment that the currently Active input completes. 

This input then instantaneously transitions to Active.

### Active input
<a name="active-input"></a>

This is the input that is being processed. An input becomes active as follows: 
+ If the input is a live input has been prepared, it will be activated and processing will start seamlessly.
+ If the input is a live input has not yet been prepared, it will still be activated; it will not be skipped. Instead, it will first be prepared, then activated. There will be a noticeable delay while the input is prepared. 
+ If the input is a file input, it will be prepared and activated. 

## Rules for activating
<a name="rules-for-activating"></a>

The rules apply to activating an input.
+ When you call Activate Immediately on an input, the currently Activated input will immediately transition to Idle and processing of that input will stop.
+ When you call Activate Immediately on an input that has previously been set up to activate at a time that is still in the future, the input will activate immediately and the future activation will be cleared. It will not be activated both immediately and in the future.
+ When you call Activate with Specified Time and then call Prepare, the activate time is not cleared: the input will be prepared (either immediately or later, depending on what you set up), then the input will be activated at the specified time. 
+ If you call Activate with Specified Time on an input that has not been prepared, the input will first be prepared (at the specified time), then it will be activated. There will be a noticeable delay in activation. In other words, activating with a specified time does not automatically set up any prepare schedule.
+ If you both manually prepare an input with a prepare time and manually activate it with an activate time, make sure the prepare time is before the activate time; Elemental Live does not check.

# Monitoring activity through the web interface
<a name="monitoring-activity-via-web"></a>

The operator can monitor dynamic playlist activity through the Elemental Live web interface.

1. On the web interface, display the Event Control tab. 

1. If the blue button specifies Control Panel, then the Details panel is currently displayed. Click the Control Panel button.

1. On the Control Panel, click Input Controls (below the Preview panel) to expand that section. The dynamic playlist appears.

![\[GUI input controls.\]](http://docs.aws.amazon.com/elemental-live/latest/ug/images/playlist_GUI_input_controls.png)


## Status information
<a name="status-information"></a>


| Input background | Icon in control column | State | 
| --- | --- | --- | 
| Green | Spinner icon | Active | 
| Green | Arrow icon | Prepared | 
| Brown | Arrow icon | Being prepared | 
| Gray | Arrow icon | Idle | 

The orange numbers down the left side are on-screen numbers, for display purposes only. 

The numbers in the ID column are the REST IDs of the inputs.

## Controls
<a name="controls"></a>

The operator can click the triangle to switch to that input. The input will become Active. Processing will stop on the current Active input.

# Monitoring activity through the API
<a name="monitoring-activity-via-api"></a>

## Fine points and pitfalls
<a name="fine-points-and-pitfalls"></a>

You can obtain a list of inputs currently in the dynamic playlist by using the [Get event](get-event.md) command or the [Get event status](get-event-status.md) command.

You can get information about the status of each input in the dynamic playlist by using the Get Event Status command. for more information, see [Get event status](get-event-status.md).

# Using the REST API
<a name="content-switching-api"></a>

**Topics**
+ [

# List of commands
](list-of-commands.md)
+ [

# Add dynamic playlist inputs
](add-dynamic-playlist-inputs.md)
+ [

# Replace dynamic playlist
](replace-dynamic-playlist.md)
+ [

# Get event
](get-event.md)
+ [

# Modify one dynamic playlist input
](modify-one-dynamic-playlist-input.md)
+ [

# Delete dynamic playlist input
](delete-dynamic-playlist-input.md)
+ [

# Prepare dynamic playlist input
](prepare-dynamic-playlist-input.md)
+ [

# Activate dynamic playlist input
](activate-dynamic-playlist-input.md)
+ [

# Get event status
](get-event-status.md)

# List of commands
<a name="list-of-commands"></a>


|  Nickname  |  Action  |  Signature  |  Description  | 
| --- | --- | --- | --- | 
|  Add dynamic playlist inputs  |  POST  |  /live\$1events/<event ID>/inputs  |  In the specified event (which must be currently running), add the specified input or inputs to the end of the dynamic playlist.  | 
|  Replace dynamic playlist  |  POST  |  /live\$1events/<event ID>/playlist  |  In the specified event (which must be currently running), remove all non-Active inputs from the dynamic playlist and append the specified input or inputs. After this command, only the Active input remains from the original dynamic playlist.  | 
|  Get event  |  GET  |  /live\$1events/<event ID>  |  Gets the contents of the event, including the list of inputs.  | 
|  Modify dynamic playlist input  |  PUT  |  /live\$1events/<event ID>/inputs/ <input ID>   |  In the specified event (which must be currently running), modify the specified dynamic playlist input (which must be non-Active).  | 
|  |  PUT  |  /live\$1events/<event ID>/inputs/ by\$1label/<input\$1label>   |  In the specified event (which must be currently running), modify the specified input (which must be non-Active).  | 
|  Delete dynamic playlist input  |  DELETE  |  /live\$1events/<event ID>/inputs/ <input ID>   |  In the specified event (which must be currently running), delete the specified non-Active input from the dynamic playlist.   | 
|  |  DELETE  |  /live\$1events/<event ID>/inputs/ by\$1label/<input\$1label>   |  In the specified event (which must be currently running), delete the specified non-Active input from the dynamic playlist.   | 
|  Activate dynamic playlist input  |  POST  |  /live\$1events/<event ID>/ activate\$1input   |  In the specified event (which must be currently running), activate the specified dynamic playlist input either at the specified time or immediately.  | 
|  Prepare dynamic playlist input  |  POST  |  /live\$1events/<event ID>/ prepare\$1input   |  In the specified event (which must be currently running), prepare the specified dynamic playlist input and optionally activate encoding at the specified time or immediately.   | 
|  Get status  |  GET  |  /live\$1events/<event ID>status  |  Gets the status of the specified event, including information about the stage and state of each input.  | 

# Add dynamic playlist inputs
<a name="add-dynamic-playlist-inputs"></a>

In the specified event (which must be currently running), add the specified input or inputs (maximum 29 inputs for a total of 30, including the Active input) to the end of the dynamic playlist. 

## HTTP request and response
<a name="add-dynamic-playlist-http-request-and-response"></a>

### HTTP URL
<a name="add-dynamic-playlist-http-url"></a>

```
POST http://<Live IP address>/live_events/<event ID>/inputs
```

### Body of HTTP
<a name="add-dynamic-playlist-body-of-http"></a>

XML content consisting of one:
+ One inputs element that contains:
  + One or more input elements that each contains one or more of the regular input tags. See [Elements and tags in an event input XML](elements-and-tags.md).

### Tips for elements and tags
<a name="add-dynamic-playlist-tips-for-elements-and-tags"></a>

Here are some notes about tags of particular interest:
+ input\$1label: It is recommended that you include the input\$1label tag. If you include this tag, you can reference the input later on using this label (rather than using the input ID, which you first have to query for using Get Event).

  An input label must be unique among all the inputs in the event when you add inputs – the existing inputs and the new inputs. 

  If you add an input with label X and later remove the input, you can add another input with label X, even if the input actually has different content. Elemental Live does not track the content, it just enforces the rule for label uniqueness at a given time.
+ loop\$1source: This tag can be used to loop the dynamic playlist. If you set this tag to true for input X, it is a good idea to set an activate time for the next intended input, otherwise input X will process forever. See [Activating using placeholders](general-procedure.md#activating-using-placeholders) for a typical use case for loop\$1source. 

  When this tag is true and Elemental Live is at the last input listed in the event XML, the first input in the dynamic playlist may be considered as the Next-in-line input.
+ order: This tag is ignored in determining the dynamic playlist order.
+ For the input source, include one of: network\$1input or device\$1input or router\$1input or file\$1input. Different inputs can have a different source.
+ audio\$1selector, caption\$1selector: All inputs must have the same number of these elements: none or more than one. So if the first input has two audio\$1selector elements, all inputs must have two audio\$1selectors. This rule applies to the lifetime of the event: as soon as it starts, the count of audio\$1selector and caption\$1selectors is fixed and cannot vary.
+ input\$1clipping: Can be used to process only a specific section of a live or file input.

### Response
<a name="add-dynamic-playlist-response"></a>

200 OK for a successful request.

## Example
<a name="add-dynamic-playlist-example"></a>

This request adds two inputs to the event with the ID 31. The first input is a live input, the second is a file input.

```
POST http://10.4.136.92/live_events/31/inputs
---------------------------------------------
<inputs>
  <input>
    <input_label>movie08E45_section_1</input_label>
    <loop_source>false</loop_source>
    <network_input>
      <quad>false</quad>
      <uri>udp://10.0.0.1:5005</uri>
    </network_input>
    <audio_selector>
      <default_selection>true</default_selection>
      <track>1</track>
    </audio_selector>
  </input>
  <input>
    <input_label>enigmatic_car_ad</input_label>
    <loop_source></loop_source>
    <file_input>
      <uri>/data/server/ad13978.mp4</uri>
    </file_input>
    <audio_selector>
      <default_selection>true</default_selection>
      <track>1</track>
    </audio_selector>
  </input>
</inputs>
```

# Replace dynamic playlist
<a name="replace-dynamic-playlist"></a>

In the specified event (which must be currently running), remove all non-Active inputs from the dynamic playlist and append the specified file input or inputs. After this command, only the Active input remains from the original dynamic playlist; the rest of the dynamic playlist consists of new inputs.

The dynamic playlist can only consist of file inputs; if you want to add live inputs or live and file inputs, use Add Dynamic Playlist Inputs.

There is no maximum to the number of inputs that can be added using this command, and there is no maximum to the number inputs that result in the event. For example, you can replace the 15 inputs currently in the event with 900 new inputs. Compare this lack of restrictions to the restrictions that apply with Add Dynamic Playlist Inputs.

You can use Replace Dynamic Playlist to clear the dynamic playlist: create a Body consisting of an empty inputs element. 

## HTTP request and response
<a name="replace-dynamic-playlist-http-request-and-response"></a>

### HTTP URL
<a name="replace-dynamic-playlist-http-url"></a>

```
POST http://<Live IP address>/live_events/<event ID>/playlist
```

### Body of HTTP
<a name="replace-dynamic-playlist-body-of-http"></a>

XML content consisting of:
+ One inputs element that contains:
  + One or more input elements that each contains one or more of the regular input tags. See [Elements and tags in an event input XML](elements-and-tags.md).

### Response
<a name="replace-dynamic-playlist-response"></a>

200 OK for a successful request.

## Example
<a name="replace-dynamic-playlist-example"></a>

This request specifies two inputs to the event with the ID 31. The first input is a live input, the second is a file input. This list of inputs will replace the current dynamic playlist, not including the currently active input.

```
POST http://10.4.136.92/live_events/31/playlist
---------------------------------------------
<inputs>
  <input>
    <input_label>movie08E45_section_1</input_label>
    <loop_source>false</loop_source>
    <network_input>
      <quad>false</quad>
      <uri>udp://10.0.0.1:5005</uri>
    </network_input>
    <audio_selector>
      <default_selection>true</default_selection>
      <track>1</track>
    </audio_selector>
  </input>
  <input>
    <input_label>enigmatic_car_ad</input_label>
    <loop_source></loop_source>
    <file_input>
      <uri>/data/server/ad13978.mp4</uri>
    </file_input>
    <audio_selector>
      <default_selection>true</default_selection>
      <track>1</track>
    </audio_selector>
  </input>
</inputs>
```

# Get event
<a name="get-event"></a>

Get a list of the inputs in the specified event.

There is no explicit command to get the dynamic playlist. But you can get the event in order to get information about the dynamic playlist.

Get Event is useful for obtaining the IDs of the inputs in the dynamic playlist and for parsing for the order in which they are listed in the XML.

Get Event includes the status of each input in these tags:
+ active tag. Possible values are true and false.
+ status tag. Possible values are preprocessing, pending, running, postprocessing, complete.
+ active\$1input\$1id tag. Only the currently active input has this tag. For that input, the active tag and the input\$1ID specify the same value.

Get Event does not provide information about the prepare time or activate time on inputs on which you explicitly called Prepare with Specified Time or Activate with Specified Time. That information cannot be retrieved from Elemental Live; you must maintain the schedule outside of Elemental Live.

## HTTP Request and Response
<a name="get-event-http-request-and-response"></a>

### HTTP URL
<a name="get-event-http-url"></a>

```
GET http://<Live IP address>/live_events/<event ID>
```

### Response
<a name="get-event-response"></a>

XML content consisting of one event element that contains:
+ Various general tags.
+ One or more input elements that each contain:
  + A unique ID tag.
  + A unique input\$1label tag (optional).
  + A status tag.
  + An input element: complete network\$1input or device\$1input or router\$1input or file\$1input.
  + A video\$1selector element.
  + An optional audio\$1selector element.
  + An optional caption\$1selector element.
+ Other elements relating to input.
+ Other elements relating to outputs.

## Example
<a name="get-event-example"></a>

### Request
<a name="get-event-example-request"></a>

This request gets the event with the ID 31. 

```
GET http://10.4.136.92/live_events/31
```

### Response
<a name="get-event-example-response"></a>

The event contains three inputs, with IDs 64, 98, 99, and with input\$1label tags “movie08E45\$1section\$11”, “enigmatic\$1car\$1ad” and “best\$1trowel\$1ad”. 

```
<?xml version="1.0" encoding="UTF-8"?>
<live_event; href="/live_events/31" product="Elemental Live" version="2.25.0.12345">
  <id>31</id>
  .
  .
  .
  <input>
    <active>false</active>
    <id>64</id>
    <input_label>movie08E45_section_1</input_label>
    <loop_source>false</loop_source>
    <status>pending</status>
    .
    .
    .
    <network_input>
      <id>4</id>
      .
      .
      .
      <uri>udp://10.0.0.1:5005</uri>
    </network_input>
    <video_selector>
      <id>2</id>
      .
      .
      .
    </video_selector>
    <audio_selector>
      <id>2</id>
      .
      .
      .
    </audio_selector>
    <input_info>
      .
      .
      .
    </input_info>
  </input>
  <input>
    <active>true</active>
    <id>98</id>
    <input_label>enigmatic_car_ad</input_label>
    <loop_source>false</loop_source>
    <status>pending</status>
    .
    .
    .
  </input>
  <input>
    <active>false</active>
    <id>99</id>
    <input_label>best_trowel_ad</input_label>
    <loop_source>false</loop_source>
    <status>pending</status>
    .
    .
    .
  </input>
  <active_input_id>98</active_input_id>
  <loop_all_inputs>true</loop_all_inputs>
  <status>running</status>
  .
  .
  .
</live_event>
```

# Modify one dynamic playlist input
<a name="modify-one-dynamic-playlist-input"></a>

In the specified event (which must be currently running), modify the specified dynamic playlist input (which must be non-Active).

The input can be modified in any way, so long as it follows the rules for inputs in a dynamic playlist, as described in [Tips for elements and tags](add-dynamic-playlist-inputs.md#add-dynamic-playlist-tips-for-elements-and-tags).

## HTTP Request and Response
<a name="modify-one-dynamic-input-http-request-and-response"></a>

### HTTP URL
<a name="modify-one-dynamic-input-http-url"></a>

To specify the input by its REST ID:

```
PUT http://<Live IP address>/live_events/<event ID>/inputs/<input id>
```

To specify the input by the input label: 

```
POST http://<Live IP address>/live_events/<event ID>/inputs/by_label/<input_label>
```

The input label is the value in the <input\$1label>; you may have included this tag when you first created the input. If you did not specify an input label, you cannot use this signature to modify.

### Body of HTTP
<a name="modify-one-dynamic-input-body-of-http"></a>

XML content consisting of one input element that each contains only the tags to modify. 

### Response
<a name="modify-one-dynamic-input-response"></a>

200 OK for a successful request.

## Example
<a name="modify-one-dynamic-input-example"></a>

### Request
<a name="modify-one-dynamic-input-example-request"></a>

This request modifies the input with the ID 28 that is in the event with the ID 31. It modifies the input so to point to a different asset.

```
PUT http://10.4.136.92/live_events/31/inputs/28
-----------------------------------------------
<input>
  <network_input>
    <uri>udp://10.0.0.1:5005</uri>
  </network_input>
</input>
```

# Delete dynamic playlist input
<a name="delete-dynamic-playlist-input"></a>

In the specified event (which must be currently running), delete the specified non-Active input from the dynamic playlist. 

You can also delete the dynamic playlist using Replace Dynamic Playlist with an empty inputs in the Body. For more information, see [Replace dynamic playlist](replace-dynamic-playlist.md).

## HTTP Request and Response
<a name="delete-dynamic-playlist-http-request-and-response"></a>

### HTTP URL
<a name="delete-dynamic-playlist-http-url"></a>

To specify the input by its REST ID:

```
DELETE http://<Live IP address>/live_events/<event ID>/inputs/<input ID>
```

To specify the input by the input label: 

```
DELETE http://<Live IP address>/live_events/<event ID>/inputs/by_label/<input label>
```

The input label is the value in the <input\$1label>; you may have included this tag when you first created the input. If you did not specify an input label, you cannot use this signature to delete.

### Response
<a name="delete-dynamic-playlist-response"></a>

200 OK for a successful request.

## Example
<a name="delete-dynamic-playlist-example"></a>

### Request
<a name="delete-dynamic-playlist-example-request"></a>

This request deletes the input with the label “curling\$183399” that is in the event with the ID 31. 

```
DELETE http://10.4.136.92/live_events/31/inputs/by_label/83399
--------------------------------------------------------------
```

# Prepare dynamic playlist input
<a name="prepare-dynamic-playlist-input"></a>

In the specified event (which must be currently running), manually prepare the specified dynamic playlist input either at the specified time or immediately.

The input being prepared must not be already Active.

## HTTP Request and Response
<a name="prepare-dynamic-playlist-http-request-and-response"></a>

### HTTP URL
<a name="prepare-dynamic-playlist-http-url"></a>

```
POST http://<Live IP address>/live_events/<event ID>/prepare_input
```

### Body of HTTP
<a name="prepare-dynamic-playlist-body-of-http"></a>

XML content consisting of one of the following:
+ One input\$1id tag that contains the ID of the input to prepare.

Or
+ One input\$1label tag that contains the input\$1label of the input to prepare.

Or
+ One prepare\$1input element that contains:
  + One input\$1id tag that contains the ID of the input to prepare or one input\$1label tag that contains the input\$1label of the input to prepare.
  + One utc\$1time tag that contains the time at which to prepare the input, in UTC time, down to the seconds and (optionally) fractional seconds.

### Response
<a name="prepare-dynamic-playlist-response"></a>

The entire <input> element for the specified input.

## Example 1
<a name="prepare-dynamic-playlist-example"></a>

### Request
<a name="prepare-dynamic-playlist-example-request"></a>

In the event with the ID 31, prepare the input with the label “live\$1news\$1feed”.

```
POST http://10.4.136.92/live_events/31/prepare_input
----------------------------------------------------
<input_id>live_news_feed</input_id>
```

### Response
<a name="prepare-dynamic-playlist-response"></a>

The response returns the entire <input> element. In this example, this input has the ID 194.

```
<?xml version="1.0" encoding="UTF-8"?>
  <input>
    <active>true</active>
    <id>194</id>
    <input_label>live_news_feed</input_label>
    <loop_source>false</loop_source>
    <status>pending</status>
    .
    .
    .
    <network_input>
      <id>296</id>
      <uri>udp://10.255.10.41:5001</uri>
    </network_input>
    <video_selector>
      <id>2</id>
      .
      .
      .
    </video_selector>
    <audio_selector>
      <id>2</id>
      .
      .
      .
    </audio_selector>
    <input_info>
      .
      .
      .
    </input_info>
  </input>
```

## Example 2
<a name="prepare-dynamic-playlist-example-2"></a>

In the event with the ID 31, prepare the input with the ID 103 and activate the input at 2015123T235959.999:

```
<prepare_input>
  <input_id>103</input_id>
  <utc_time>2015123T235959.999</utc_time>
</prepare_input>
```

# Activate dynamic playlist input
<a name="activate-dynamic-playlist-input"></a>

In the specified event (which must be currently running), activate the specified dynamic playlist input either at the specified time or immediately.

The input being prepared must not be already Active.

## HTTP request and response
<a name="activate-dynamic-playlist-http-request-and-response"></a>

### HTTP URL
<a name="activate-dynamic-playlist-http-url"></a>

```
POST http://<Live IP address>/live_events/<event ID>/activate_input
```

### Body of HTTP
<a name="activate-dynamic-playlist-body-of-http"></a>

XML content consisting of one of the following:
+ One input\$1id tag that contains the ID of the input to activate.

Or
+ One input\$1label tag that contains the input\$1label of the input to activate.

Or
+ One activate\$1input element that contains:
  + One input\$1id tag that contains the ID of the input to prepare or one input\$1label tag that contains the input\$1label of the input to prepare.
  + One utc\$1time tag that contains the time at which to activate the input, in UTC time, down to the seconds and (optionally) fractional seconds.

### Response
<a name="activate-dynamic-playlist-response"></a>

The entire <input> element for the specified input.

## Example 1
<a name="activate-dynamic-playlist-example"></a>

### Request
<a name="activate-dynamic-playlist-example-request"></a>

In the event with the ID 31, activate the input with the input\$1label “syndicated\$1show\$1231”.

```
POST http://10.4.136.92/live_events/31/activate_input
----------------------------------------------------
<input_label>syndicated_show_231</input_label>
```

### Response
<a name="activate-dynamic-playlist-example-response"></a>

The response returns the entire <input> element. In this example, this input has the ID 64.

```
<?xml version="1.0" encoding="UTF-8"?>
  <input>
    <active>true</active>
    <id>64</id>
    <input_label>syndicated_show_231</input_label>
    <loop_source>false</loop_source>
    <status>pending</status>
    .
    .
    .
    <file_input>
      <id>206</id>
      <uri>/data/server/13978.mp4</uri>
    </file_input>
    <video_selector>
      <id>2</id>
      .
      .
      .
    </video_selector>
    <audio_selector>
      <id>2</id>
      .
      .
      .
    </audio_selector>
    <input_info>
      .
      .
      .
    </input_info>
  </input>
```

## Example 2
<a name="activate-dynamic-playlist-example-2"></a>

In the event with the ID 31, activate the input with the ID 103 and activate the input at 2015123T235959.999:

```
<activate_input>
  <input_id>103</input_id>
  <utc_time>2015123T235959.999</utc_time>
</activate_input>
```

# Get event status
<a name="get-event-status"></a>

Get the status of the inputs in the specified event.

There is no explicit command to get the status of the inputs in the dynamic playlist. But you can get the event status in order to get status information about the dynamic playlist.

Warning: Get Event Status only works with the JSON format. Therefore, the request header must include Accept: application/json and Content-type:application/json 

## HTTP request and response
<a name="get-event-status-http-request-and-response"></a>

### HTTP URL
<a name="get-event-status-http-url"></a>

```
GET http://<Live IP address>/live_events/<event ID>/status
```

### Response
<a name="get-event-status-response"></a>

JSON content consisting of one live\$1event element that contains:
+ One outputs element and one output\$1groups element that each includes various tags.
+ One active\$1input tag that contains the REST ID of the currently Active input.
+ One inputs element that lists the inputs. The inputs appear in the order in which they were originally listed when the dynamic playlist was created. The following information appears for each input:


|  Tag  |  Value  |  Description  | 
| --- | --- | --- | 
|  id  |  Integer  |  The unique REST ID for this input  | 
|  state  |  String  |  The state of the input: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/elemental-live/latest/ug/get-event-status.html)  | 
|  input\$1label  |  String  |  The input label, if one was created.  | 
|  uri  |  String  |  The URI for a file input.   | 

### Stage and state
<a name="get-event-status-stage-and-state"></a>

The state tag and active\$1input tag can provide some information about the stage and state of each input: 


|  State tag  |  active\$1input tag  |  Stage and state  | 
| --- | --- | --- | 
|  pending  |  Does not specify this input  |  The input is one of: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/elemental-live/latest/ug/get-event-status.html)  | 
|  clear  |  Does not specify this input  |  The input is one of: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/elemental-live/latest/ug/get-event-status.html)  | 
|  clear  |  Specifies this input  |  The input is: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/elemental-live/latest/ug/get-event-status.html)  | 
|  quarantined  |  Specifies this input  |  The input is: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/elemental-live/latest/ug/get-event-status.html)  | 
|  errored  |  Specifies this input  |  A failure condition (as defined by the failure\$1condition tag in the event XML) has been triggered.   | 

Note that you cannot determine whether the input is Next-in-line from the response to this Get. You must maintain that information outside of Elemental Live. 

## Example
<a name="get-event-status-example"></a>

```
GET http://10.4.136.92/live_events/47/status
{
  "live_event": {
    "id": "47",
    "status": "running",
    "outputs": [
      .
      .
      .
    ],
    "output_groups": [
      .
      .
      .
    ],
      .
      .
      .
    "active_input": "533761",
      .
      .
      .
    "inputs": [
      {
        "id": "29",
        "state": "pending",
        "input_label": "live_curling",
      },
      {
        "id": "30",
        "state": "clear",
      .
      .
      .

      },
      {
        "id": "30",
        "state": "pending",
        "input_label": null,
        "uri": "http://10.4.99.22/ads/best_trowel_ad.m3u8?_=0ap3000000580895"
      },
      {
        "id": "31",
        "state": "pending",
        "input_label": null,
        "uri": "http://10.4.99.22/ads/magic_scraper_ad/master.m3u8"
      },
      {
        "id": "32",
        "state": "pending",
        "input_label": null,
        "uri": "http://10.4.99.22/ads/enigmatic_car_ad/master.m3u8"
      },
      {
        "id": "33",
        "state": "pending",
        "input_label": null,
        "uri": "http://10.4.99.22/ads/chouette_toy_ad.m3u8"
      },
      .
      .
      .
    ],
    "alerts": [],
    "audio_level": "-7",
    "elapsed_time_in_words": "01:10:28"
  }
}
```

# Elements and tags in an event input XML
<a name="elements-and-tags"></a>

This section lists all the elements and tags that could appear in the input element of an event XML. This section does not include exhaustive information about rules for if and when an element or tag can be included. For tips on some tags, see [Add dynamic playlist inputs](add-dynamic-playlist-inputs.md).

```
<href></href>
<version></version>
<product></product>
<input>
  <deblock_enable></deblock_enable>
  <deblock_strength></deblock_strength>
  <error_clear_time></error_clear_time>
  <failback_rule></failback_rule>
  <hot_backup_pair></hot_backup_pair>
  <input_label></input_label>
  <loop_source></loop_source>
  <name></name>
  <no_psi></no_psi>
  <order></order>
  <program_id></program_id>
  <service_name></service_name>
  <service_provider_name></service_provider_name>
  <image_inserter>
    <image_x></image_x>
    <image_y></image_y>
    <opacity></opacity>
    <image_inserter_input>
      <uri></uri>
      <username></username>
      <password></password>
      <interface></interface>
    </image_inserter_input>
  </image_inserter>
  <network_input>
    <enable_fec_rx></enable_fec_rx>
    <interface ></interface >
    <password></password>
    <quad></quad>
    <udp_igmp_source></udp_igmp_source>
    <uri></uri>
    <username></username>
  </network_input>
  <device_input>
    <channel></channel>
    <channel_type></channel_type>
    <device_id></device_id>
    <device_name></device_name>
    <device_number></device_number>
    <device_type></device_type>
    <input_format></input_format>
    <fec_settings>
      <udp_igmp_source></udp_igmp_source>
      <uri></uri>
    </fec_settings>
    <hdmi_settings>
      <input_format></input_format>
    </hdmi_settings>
    <sdi_settings>
      <input_format></input_format>
      <scte104_offset></scte104_offset>
    </sdi_settings>
  </device_input>
  <router_input>
    <input_number></input_number>
    <input_number_end></input_number_end>
    <quad></quad>
    <router_ip></router_ip>
    <router_type></router_type>
  </router_input>
  <file_input>
    <certificate_file></certificate_file>
    <interface></interface>
    <password></password>
    <uri></uri>
    <username></username>
  </file_input>
  <failover_condition>
    <description></description>
    <duration></duration>
    <order></order>
  </failover_condition>
  <video_selector>
    <color_space></color_space>
    <default_afd></default_afd>
    <name></name>
    <order></order>
    <pid></pid>
    <program_id></program_id>
  </video_selector>
  <audio_selector>
    <default_selection></default_selection>
    <external_audio_file_input></external_audio_file_input>
    <infer_external_filename></infer_external_filename>
    <language_code></language_code>
    <name></name>
    <offset></offset>
    <order></order>
    <pid></pid>
    <program_selection></program_selection>
    <strict_language_selection></strict_language_selection>
    <strict_pid_option></strict_pid_option>
    <track></track>
    <unwrap_smpte337></unwrap_smpte337>
  </audio_selector>
  <audio_selector_group>
    <audio_selector_name></audio_selector_name>
    <name></name>
  </audio_selector_group>
  <caption_selector>
    <order></order>
    <source_type></source_type>
    <language_code></language_code>
    <embedded_source_settings>
      <autodetect_scte20></autodetect_scte20>
      <source_608_channel_number> </source_608_channel_number>
      <source_608_track_number ></source_608_track_number>
      <upconvert_608_to_708></upconvert_608_to_708>
    </embedded_source_settings>
    <file_source_settings>
      <time_delta></time_delta>
      <upconvert_608_to_708></upconvert_608_to_708>
      <source_file>
        <certificate_file></certificate_file>
        <interface></interface>
        <password></password>
        <uri></uri>
        <username></username>
      </source_file>
    </file_source_settings>
    <teletext_source_settings>
      <page_number></page_number>
    </teletext_source_settings>
    <dvb_sub_source_settings>
      <pid></pid>
    </dvb_sub_source_settings>
    <scte27_source_settings>
      <pid></pid>
    </scte27_source_settings>
  </caption_selector>
  <input_clipping>
    <end_timecode></end_timecode>
    <order></order>
    <start_timecode></start_timecode>
  </input_clipping>
```

Broken down into individual components, you can see:


|  Function of code excerpt  |  Example code excerpt  | 
| --- | --- | 
|  Various tags  |  <pre>    <href></href><br /><version></version><br /><product></product><br /><input><br />  <deblock_enable></deblock_enable><br />  <deblock_strength></deblock_strength><br />  <error_clear_time></error_clear_time><br />  <failback_rule></failback_rule><br />  <hot_backup_pair></hot_backup_pair><br />  <input_label></input_label><br />  <loop_source></loop_source><br />  <name></name><br />  <no_psi></no_psi><br />  <order></order><br />  <program_id></program_id><br />  <service_name></service_name><br />  <service_provider_name></service_provider_name></pre>  | 
|  Image inserter for this input  |  <pre>  <image_inserter><br />    <image_x></image_x><br />    <image_y></image_y><br />    <opacity></opacity><br />    <image_inserter_input><br />      <uri></uri><br />      <username></username><br />      <password></password><br />      <interface></interface><br />    </image_inserter_input><br />  </image_inserter></pre>  | 
|  Input source  |  <pre>  <network_input><br />    <enable_fec_rx></enable_fec_rx><br />    <interface ></interface ><br />    <password></password><br />    <quad></quad><br />    <udp_igmp_source></udp_igmp_source><br />    <uri></uri><br />    <username></username><br />  </network_input><br />  <device_input><br />    <channel></channel><br />    <channel_type></channel_type><br />    <device_id></device_id><br />    <device_name></device_name><br />    <device_number></device_number><br />    <device_type></device_type><br />    <input_format></input_format><br />    <fec_settings><br />      <udp_igmp_source></udp_igmp_source><br />      <uri></uri><br />    </fec_settings><br />    <hdmi_settings><br />      <input_format></input_format><br />    </hdmi_settings><br />    <sdi_settings><br />      <input_format></input_format><br />      <scte104_offset></scte104_offset><br />    </sdi_settings><br />  </device_input><br />  <router_input><br />    <input_number></input_number><br />    <input_number_end></input_number_end><br />    <quad></quad><br />    <router_ip></router_ip><br />    <router_type></router_type><br />  </router_input><br />  <file_input><br />    <certificate_file></certificate_file><br />    <interface></interface><br />    <password></password><br />    <uri></uri><br />    <username></username><br />  </file_input></pre>  | 
|  Failover  |  <pre>  <failover_condition><br />    <description></description><br />    <duration></duration><br />    <order></order><br />  </failover_condition></pre>  | 
|  Source video   |  <pre>  <video_selector><br />    <color_space></color_space><br />    <default_afd></default_afd><br />    <name></name><br />    <order></order><br />    <pid></pid><br />    <program_id></program_id><br />  </video_selector></pre>  | 
|  Source audio  |  <pre>  <audio_selector><br />    <default_selection></default_selection><br />    <external_audio_file_input></external_audio_file_input><br />    <infer_external_filename></infer_external_filename><br />    <language_code></language_code><br />    <name></name><br />    <offset></offset><br />    <order></order><br />    <pid></pid><br />    <program_selection></program_selection><br />    <strict_language_selection></strict_language_selection><br />    <strict_pid_option></strict_pid_option><br />    <track></track><br />    <unwrap_smpte337></unwrap_smpte337><br />  </audio_selector><br />  <audio_selector_group><br />    <audio_selector_name></audio_selector_name><br />    <name></name><br />  </audio_selector_group></pre>  | 
|  Source captions  |  <pre>  <caption_selector><br />    <order></order><br />    <source_type></source_type><br />    <language_code></language_code><br />    <embedded_source_settings><br />      <autodetect_scte20></autodetect_scte20><br />      <source_608_channel_number> </source_608_channel_number><br />      <source_608_track_number ></source_608_track_number><br />      <upconvert_608_to_708></upconvert_608_to_708><br />    </embedded_source_settings><br />    <file_source_settings><br />      <time_delta></time_delta><br />      <upconvert_608_to_708></upconvert_608_to_708><br />      <source_file><br />        <certificate_file></certificate_file><br />        <interface></interface><br />        <password></password><br />        <uri></uri><br />        <username></username><br />      </source_file><br />    </file_source_settings><br />    <teletext_source_settings><br />      <page_number></page_number><br />    </teletext_source_settings><br />    <dvb_sub_source_settings><br />      <pid></pid><br />    </dvb_sub_source_settings><br />    <scte27_source_settings><br />      <pid></pid><br />    </scte27_source_settings><br />  </caption_selector></pre>  | 
|  Input clipping  |  <pre>  <input_clipping><br />    <end_timecode></end_timecode><br />    <order></order><br />    <start_timecode></start_timecode><br />  </input_clipping></pre>  | 