

# Static graphic overlay
Graphic overlay: Static overlay

You can insert a static overlay into the event so that it appears on the video in one or more of the video outputs. You can configure the static overlay with a start time and duration. You can insert the static overlay at any position on the video frame, as specified by x/y coordinates. You can configure with an opacity and with fade-in and/or fade- out. 

You can insert any number of static overlays in the event. 

**Topics**
+ [

# Insertion options and the effect on outputs
](insertion-options-and-the-effect-on-outputs.md)
+ [

# Multiple overlays and layers
](multiple-overlays-and-layers.md)
+ [

# Combining overlays and insertion options
](combining-overlays-and-insertion-options.md)
+ [

# Procedure
](inserting-a-static-graphic-overlay.md)
+ [

# Using the REST API for static overlays
](using-the-rest-api-for-static-overlays.md)
+ [

# Static overlay plus dynamic content switching
](graphic-overlay-plus-dynamic-content-switching.md)
+ [

# XML structure
](xml-structure-static.md)

# Insertion options and the effect on outputs
Insertion options

## In the input section: Insert in portion of all outputs


The static overlay can be inserted in the input section in a specific input. 

Result: the portion of the output that is sourced from the given input includes the static overlay. 

A typical use case for inserting in this section is if some of the inputs already have a static overlay in the desired location; you do not want to insert another static overlay over this existing static overlay. Therefore, you would insert the static overlay into the inputs that do not have an existing static overlay and omit it from inputs that do have an existing static overlay.

The static overlay will be burned into the video in this input after the input is decoded and before any global processors. This means that the static overlay “sticks” to its input; if the specified start time and duration extend beyond the end of the input, the static overlay will end when the input ends. 

If you insert at the Input stage, be very careful with the start time and durations of the static overlays to avoid the static overlay ending abruptly. 

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


## In the Global Processors section: Insert in all outputs


The static overlay can be inserted in the Global Processors section. Result: The static overlay will be inserted in all outputs. 

The static overlay is burned into the video after decoding and input-specific processing and before encoding and creation of individual streams and outputs. 

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


## In the Output section: Insert in one stream


The static overlay can be inserted in individual streams. 

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


Result: The static overlay is inserted only in the outputs that are associated with those streams. The static overlay will be burned into the video only in the specified streams. 

## Overlay scaling for each insertion option


The following lists the overlay scaling for each insertion option:
+  If you insert the overlay in an input, then when (and if) the underlying video in each output is scaled up or down, the overlay is similarly scaled. The underlying video and overlay maintain their relative ratios. For example, if the overlay covers one quarter of the underlying video in the input, it will cover one quarter of the underlying video in every output. 
+ If you insert the overlay in the global processors section, then when (and if) the underlying video in each stream assembly is scaled up or down, the overlay is similarly scaled. 
+ If you insert the overlay in a stream assembly section, then when (and if) the underlying video in each stream assembly is scaled up or down, the overlay is not scaled. The overlay is added only after scaling. Therefore, if the event has two stream assemblies, the final effect of the overlay may be different. The overlay in one stream assembly may take up more room on the underlying video than the overlay in a stream assembly with a different resolution. But the advantage of adding in the stream assembly section is that you can specify different overlays for each assembly, each sized appropriately for that stream’s resolution. 

# Multiple overlays and layers
Multiple Overlays

You can set up the event to insert more than one static overlay. Overlays are stored in the event in a queue that has a maximum of 8 layers. 

This means that you can display up to: 
+ 8 static overlays if you are using only the web interface to set up the event. 
+ As many static overlays as you want over the duration of the event if you are using the REST API. See [Step C: Manage overlays on a running event](step-c-manage-overlays-on-a-running-event.md). A maximum of 8 static overlays can be “queued” at one time (one in each layer). 

# Combining overlays and insertion options


You can set up the event to insert a static overlay in more than one way. For example, you can insert a static overlay in one layer in the Input section and insert a static overlay in another layer in the Global Processors section.

**Examples**
+ Example 1 – You want to insert a static overlay at a specific time and run it for 10 seconds. You want the static overlay to be placed in the lower right corner of the video frame. You want the static overlay to be 50% opaque and to fade in from nothing to full 50% opacity over 2 seconds, then to fade out to nothing starting 2 seconds before the end of the insertion. 

  You can implement this use case via the web interface or the REST API. 
+ Example 2 – You want to insert 2 static overlays so that they both appear on the video frame either at the same time, or with some overlap. You want the display of the static overlays to slightly overlap, so that one static overlay appears in a location and then while that static overlay is still showing, another static overlay appears in a specified location. If the locations overlap either partially or completely, you want to be able to specify which static overlay appears on top.

  When you want to insert between 1 and 8 static overlays, you can implement this use case via the web interface or the REST API. 
+ Example 3 – You want to insert 20 static overlays over the duration of the video. Some of the static overlays repeat, while some are unique. Some of them appear at the same time as others – up to 8 static overlays can appear at the same time. 

  When you want to insert more than 8 static overlays, you must use the REST API. 
+ Example 4 – You want the same static overlay to appear repeatedly over the duration of the video, either in the same location each time or in different locations. This use case is simply a variation of use cases 2 or 3 with the same static overlay being used each time. 

# Procedure
Procedure


|   | Step | Methods available | 
| --- | --- | --- | 
| 1.  | Create the event with the desired static overlays. | Use the REST API or the web interface. | 
| 2. | Start the event. | Use the REST API or the web interface. | 
| 3. | While the event is running, set up more static overlays as desired. | Use the REST API. | 

You can implement all features described in this section via REST as well as the web interface. This section describes how to use the web interface to insert a graphic overlay. For instructions on doing so via REST, see [Using the REST API for static overlays](using-the-rest-api-for-static-overlays.md). 

The following are valid web interface and REST API combinations: 
+ Initial setup via web interface and run-time changes via the REST API. 
+ Initial setup and run-time changes via the REST API. 

If you use the web interface to perform the initial setup, note the following restrictions: 
+ You cannot specify more than 8 static overlays in the event. 
+ You must set up all the static overlays before the event starts to run; there is no mechanism for changing static overlays at runtime via the web interface. 

**Topics**
+ [

# Step A: Prepare the overlay asset
](step-a-prepare-the-overlay-asset.md)
+ [

# Step B: Initial setup
](step-b-initial-setup.md)
+ [

# Step C: Manage overlays on a running event
](step-c-manage-overlays-on-a-running-event.md)

# Step A: Prepare the overlay asset
Step A

1. Create a file with the following characteristics: 
   + File type: A BMP, PNG, or TGA file. 
   + Aspect ratio: The overlay can have any aspect ratio. It does not have to match the aspect ratio of the underlying video.
   + Size, in pixels: The overlay can be any size up to the same size as the underlying video. The overlay cannot be positioned so that part of the overlay runs beyond the right edge or bottom edge of the underlying video.
     + If you set up an overlay so that it is too big or it overruns an edge, if Elemental Live can identify this error at event creation time, an error message will appear then.
     + If Elemental Live cannot identify the error in advance, an error message will appear while the event is running. The event will not stop but the insertion request will fail.

1. Place the prepared file in a location accessible to the Elemental Live node. You can specify the location in one of the following ways:
   + Local to the Elemental Live appliance. E.g. `/data/assets/overlay.mov`
   + A remote server via a mount point. E.g. `/data/mnt/assets/overlay.mov`
   + An S3 bucket, using SSL. E.g. `s3ssl://company.test/sample_bucket/overlay.mov`
   + An S3 bucket, without SSL. E.g. `s3://company.test/sample_bucket/overlay.mov`

   Use sse=true to enable S3 Server Side Encryption (SSE) and rrs=true to enable Reduced Redundancy Storage (RRS). Default values for RRS and SSE are false.

   Example: `s3://<hostname>/sample_bucket/ encrypted?rrs=true&sse=true`

1. Make a note of the location. 

# Step B: Initial setup
Step B

Create or modify the event as follows: 

1. Determine the location or locations in the event where the static overlay should be inserted, then display the appropriate section:
   + Input section: In the desired input or inputs, click Advanced. More fields appear. In the Image Inserter section, click On. More fields appear; see the table in the next step. 
   + Global Processors section: In the Global Processors section, go to the Image Inserter field and click On. More fields appear; see the table in the next step. 
   + Output section: In the desired output or outputs, determine the stream this output is associated with. In the corresponding Stream section, click Advanced. More fields appear; see the table in the next step. 

   For all locations, the following fields appear. (Note that the following image is from the Global Processors section, but the fields are the same in all sections.)   
![\[images/screenshot_StaticImgInst.png\]](http://docs.aws.amazon.com/elemental-live/latest/ug/images/screenshot_StaticImgInst.png)

1.  Complete the fields as follows:    
<a name="step-b-initial-setup-table"></a>[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/elemental-live/latest/ug/step-b-initial-setup.html)

1. If desired, click Add Image and enter the information for another static overlay, up to a maximum of 8 static overlays. 
   + Assign a unique Layer number to each static overlay. The layers do not have to appear in any particular order on the screen, but each number must be used once only.
   + The static overlay Start Time and Duration can be set so that any static overlay overlaps the display time of any other static overlay. 
   +  The Left/Top fields can be set so that any static overlay physically overlaps any other static overlay, as much as you want; the static overlays are displayed according to their Layer value.

Note: If you are using input switching to provide input redundancy (with or without the hot-hot backup mode), then make sure you insert the static overlay in both input pairs. 

## Start time formats


**Option 1**: Timecode format (HH:MM:SS:FF). The overlay start is determined by comparing the specified start to the appropriate timecode. 
+ If the overlay is specified in the Input section: The start time for the static overlay will be compared to the input timecode (the timecode for a given input). The source for the input timecode is specified separately for each input (Input > Timecode Source field). The input timecode is calculated as follows: 
  + If Timecode Source is Embedded: The timecode associated with each frame is extracted from the timecode carried with the input media. Note that each input will have its own timecode and the timecode may not align well from one input to another. 
  + If Timecode Source field is Start at 0: The timecode of the first frame of the input is 00:00:00:00 and the timecode counts up with each successive frame. The timecode starts over with each input. 
  + If Timecode Source field is System Clock or Local System Clock (AWS Elemental Live only): The timecode of each frame in the input is the system time at which the frame is decoded. 
+ If the overlay is specified in the Global Processor section: The overlay start is compared to the output timecode (which is shared by all outputs). The source for the output timecode is specified for the entire event, in the Timecode Config > Source field. The output timecode is calculated as follows: 
  + If Source is Embedded: The timecode is extracted from the timecode carried with the input media. That timecode becomes the output timecode for the first transcoded frame. Then the output timecode counts up with each successive frame in the entire output. 
  + If Source is Start at 0: The output timecode for the first frame is 00:00:00:00 and then the output timecode counts up with each successive frame in the entire output. 
  + If Source is System Clock or Local System Clock (AWS Elemental Live only): The output timecode for the first frame is the system time at which the frame is decoded. Then the output timecode counts up with each successive frame in the entire output. 
  + If Source is Specified Start: The output timecode for the first frame is the time you specified when you selected this option as the timecode source. Then the output timecode counts up with each successive frame in the entire output. 
  + If Source is External Reference Connector (AWS Elemental Live only): The timecode is extracted from external LTC source. That timecode becomes the output timecode for the first transcoded frame. Then the output timecode counts up with each successive frame in the entire output. 
+ If the static overlay is specified in the Output section: The start time for the static overlay is calculated in the same way as a static overlay in the Global Processor section. 

**Option 2**: ISO 8601 UTC time with no dashes or colons. For example, 20160102T030405.678Z. In this case, the start time for every overlay (regardless of whether it is defined in the input, the global processor or the output) will be the UTC time. 

**Option 3**: Only when adding or modifying an overlay in a running event (not when creating an event or modifying a non-running event), set this tag to an empty string to set the start time to “now”. With this option, the start time is never exact. 

# Step C: Manage overlays on a running event
Step C

Once the event has started, you can work with static overlays only via the REST API. You cannot work with static overlays on a running event via the web interface. 

Change the static overlay or overlays on a running event: 

1.  If you did not set the `<enable_rest>` element to `true` when you created the event, modify the event (PUT Event) and set this value. For the location of this element, see [Modify static overlay on a running event](modify-static-overlay-on-a-running-event.md). 

1.  Send the Modify Static Overlay command (see [Using the REST API for static overlays](using-the-rest-api-for-static-overlays.md)) to make the desired change to the static overlays in the event. 

**Runtime REST commands change the event XML**  
When you send REST commands during an event, the event XML is permanently changed. Any data sent via the REST call goes into the XML. 

For example, you might put a scoreboard overlay on your event during a sporting event. If you do not send a REST call to deactivate the overlay once the game has ended, the scoreboard will appear again at the same time the next day. 

Therefore, make sure to do one of the following: 
+  If you plan to run the event (event A) again with different video content but with the same graphic overlays, make sure to export your XML for re-use before starting the event. Then create a new event (event B) using the exported XML. Do not start event A again. 
+ If you are running a 24/7 channel and you do not want your overlay to recur, remember to send a REST command to set <activate> to false once the overlay has run. This will delete the entire <insertable\$1images> element from the event XML. 

  You could also specify an absolute start time for each overlay by using the ISO 8601 UTC time format to specify an absolute time and date for the overlay. The overlays will not run again the next day.

## Options for insertion - which outputs are affected
Affected outputs

You can insert static overlays in one of the following places in the running event. These places are the same as the places when inserting in a new event or modifying a non-running event.
+ In an individual input. The input must be currently running or be in the future.

  If you include a start time in the XML body, that start time must fall within the scope of the specified input. It must correspond to a time that is valid for that input. For example, if the input runs from 1:00 p.m. to 2:00 p.m. by the clock, the start time must correspond to a clock time between 1:00 p.m. and 2:00 p.m., otherwise the insertion will be ignored. The start time can be in the past, so long as it is within the scope of the input; in this case, the overlay will be inserted immediately.
+ In all outputs.

  If you include a start time in the XML body, the overlay will be inserted at that at start time. If that start time is in the past, the overlay will be inserted immediately. 
+ n the outputs associated with one stream assembly.

  If you include a start time in the XML body, the overlay will be inserted at that at start time. If that start time is in the past, the overlay will be inserted immediately. 

## Types of changes


**Add an overlay in a layer**  
You can add an overlay in a layer. For example, if you did not fill all 8 layers when creating the event, you can add more static overlays, up to a total of 8 for the event. Or if you already deleted a layer (as described below), you can fill it with a new static overlay. 

You must enter a Modify Static Overlay command ([Create or modify a non-running event with static graphic overlay](create-or-modify-a-non-running-event-with-static-graphic-overlay.md)) and include the following tags in the XML body: 
+ layer: The (unused) layer where you want to add the static overlay. 
+ activate: Set to true. Note that this tag is not part of the XML body for creating the event. 
+ Other tags: Set all other tags as desired to specify the content and its characteristics, start time and duration.

**Modify an existing overlay**  
You can modify the existing content in a layer. You can do the following:
+ Change a static overlay that has not yet run.
+ Change a static overlay that is currently running. The static overlay will change in mid-stream.
+ Change a static overlay that has run in order to re-use the layer.

You can change the static overlay’s start time or duration. Or you can change its position. Or you can change the actual overlay that runs.

You must enter a Modify Static Overlay command ([Create or modify a non-running event with static graphic overlay](create-or-modify-a-non-running-event-with-static-graphic-overlay.md)) and include the following tags in the XML body:
+ layer: The layer whose static overlay you want to modify. 
+ activate: Set to true. Note that this tag is not part of the XML body for creating the event. 
+ Other tags: Set all other tags as desired to specify the content and its characteristics, start time and duration. Only the tags you specify will be changed.

**Delete an overlay**  
You can delete the existing content in a layer. If the static overlay has not yet run, it will not run. If the static overlay is currently running, it will be removed. If the static overlay has already run, there is not really any need to delete the content.

You must enter a Modify Static Overlay command ([Create or modify a non-running event with static graphic overlay](create-or-modify-a-non-running-event-with-static-graphic-overlay.md)) and include the following tags in the XML body:
+ layer: The layer to delete. 
+ activate: Set to false. Note that this tag is not part of the XML body for creating the event. 

# Using the REST API for static overlays
Static overlays with REST API

**Topics**
+ [

# Static graphic overlay commands
](static-graphic-overlay-commands.md)
+ [

# Create or modify a non-running event with static graphic overlay
](create-or-modify-a-non-running-event-with-static-graphic-overlay.md)
+ [

# Modify static overlay on a running event
](modify-static-overlay-on-a-running-event.md)

# Static graphic overlay commands
Commands


| Nickname | Action | Signature | Description | 
| --- | --- | --- | --- | 
| Create Event | POST | <Live IP address>/live\$1events | Create an event that includes static overlay information. | 
| Modify Event | PUT | <Live IP address>/live\$1events/live\$1event/<event ID> | Modify an event (that is not running) and add, modify or delete static overlay information. | 
| Modify Static Overlay, Running Event | POST | /live\$1event/<event ID>/image\$1inserter | All outputs: add, modify or delete static information in a running event. | 
| Modify Static Overlay, Running Event | POST |  `<Live IP Address>/live_events/<event ID>/ image_inserter/output/<output id>` Where `<output id>` is the unique ID automatically assigned to this output when the event is created.  | Specific output: add, modify or delete static information in a running event. | 
| Modify Static Overlay, Running Event | POST |  `<Live IP Address>/live_events/<event ID>/ image_inserter/output/by_stream/<stream id>` Where `<stream id>` is the unique ID automatically assigned to this stream when the event is created. The ID can change while the event is running (for example, if another stream is deleted), so you may need to obtain the current ID before sending this command.  | All outputs associated with a specific stream: add, modify or delete static information in a running event. | 
| Modify Static Overlay, Running Event | POST |  `<Live IP Address>/live_events/<event ID>/ image_inserter/input/<input id>` Where `<input id>` is the unique ID automatically assigned to this input when the event is created or when the input is added to the event.  | Specific input, all outputs associated with it: add, modify or delete static information in a running event. | 
| Modify Static Overlay, Running Event | POST |  `<Live IP Address>/live_events/<event ID>/ image_inserter/input/by_label/<input label>` Where `<input label>` is the input label you assigned when you created this event or created this input. Input labels are always optional.  | Specific input, all outputs associated with it: add, modify or delete static information in a running event. | 

# Create or modify a non-running event with static graphic overlay
Create or modify a non-running event

Create or modify an Elemental Live event and include one or more static graphic overlays. This description assumes that you are familiar with the XML body for a live\$1event aside from the data for the graphic overlay.

## HTTP request and response


**HTTP URL** 

```
POST http://<Live IP Address>/live_events
```

or: 

```
PUT http://<Live IP Address>/live_events/<event ID> 
```

**Body of request – one input** 

To insert the static overlay in one input element: 

XML content consisting of one live\$1event element that contains: 
+ All the usual elements and tags. 
+ One input element that contains: 
  + All the usual elements and tags. 
  + One image\$1inserter element that contains: 
    + One enable\$1rest tag. 
    + One insertable\$1images element that contains: 
      + 1 to 8 insertable\$1image elements that contain the tags listed in the following table.

For a representation of the XML structure, see [XML structure](xml-structure-static.md). 

**Body of request – all outputs **

To insert the static overlay in all outputs: 

XML content consisting of one live\$1event element that contains:
+ All the usual elements and tags. 
+ One image\$1inserter element that contains: 
  + One enable\$1rest tag. 
  + One insertable\$1images element that contains: 
    + 1 to 8 insertable\$1image elements that contain the tags listed in the table on the following page. 

For a representation of the XML structure, see [XML structure](xml-structure-static.md). 

**Body of request – outputs for one stream assembly **

To insert the static overlay in the outputs associated with a given stream. XML content consisting of one live\$1event element that contains: 
+ All the usual elements and tags. 
+ One stream\$1assembly element that contains: 
  + All the usual elements and tags. 
  + One image\$1inserter element that contains: 
    + One enable\$1rest tag. 
    + One insertable\$1images element that contains: 
      + 1 to 8 insertable\$1image elements that contain the tags listed in the following table. 

For a representation of the XML structure, see [XML structure](xml-structure-static.md). 

**Child elements of <insertable\$1image> and <image>**


| Element | Type | Required | Description for creating | 
| --- | --- | --- | --- | 
| activate | Boolean | Required |  Required when adding or modifying an overlay in a running event (not when creating an event or modifying a non-running event). This tag has no effect when creating or modifying a non-running event. [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/elemental-live/latest/ug/create-or-modify-a-non-running-event-with-static-graphic-overlay.html) **Note: **<activate> is distinct from <active>, which is used with motion image inserter.  | 
| duration | Integer | Optional Default: until end of event |  The time in milliseconds for the overlay to remain on the video. When creating an event, if this field is left blank, the overlay will remain on the video as follows: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/elemental-live/latest/ug/create-or-modify-a-non-running-event-with-static-graphic-overlay.html) The total running time of the overlay is fade\$1in \$1 duration \$1 fade\$1out.  | 
| fade\$1in | Integer | Optional | The duration, in milliseconds, for the overlay fade-in. This time is inserted before the start time of the overlay. | 
| fade\$1out | Integer | Optional |  This field is valid only if the Duration field is completed. The duration, in milliseconds, for the overlay fade-out. This time is added to the overlay duration.  | 
| height | Integer |  Optional Default: native height of overlay  |  The height of the overlay when inserted in the video, in pixels. When creating an event, leave blank to use the native height of the overlay. The original overlay will be scaled up or down, to the specified height.  | 
| width | Integer |  Optional Default: native width of overlay  |  The width of the overlay when inserted in the video, in pixels. When creating an event, leave blank to use the native height of the overlay. The original overlay will be scaled up or down, to the specified width.  | 
| image\$1inserter\$1input | Location | Required |  Overlay PNG or BMP file to insert. For file requirement details, information about where to store this file, and how to specify its location, see [Step A: Prepare the overlay asset](step-a-prepare-the-overlay-asset.md).  | 
| image\$1x | Integer | Required |  Placement of the left edge of the overlay relative to the horizontal axis for the video frame, in pixels. 0 is the left edge of the frame. When creating an event, cannot be omitted. Take note of the width of the overlay and make sure that the position of the left edge of the overlay does not cause the right edge to be cropped.  | 
| image\$1y | Integer | Required |  Placement of the top edge of the overlay relative to the vertical axis for the video frame, in pixels. 0 is the top edge of the frame. When creating an event, cannot be omitted. Take note of the height of the overlay and make sure that the position of the top edge of the overlay does not cause the bottom edge to be cropped.  | 
| layer | Integer | Required |  A number from 0 to 7 to specify the Z order of the inserted overlay. “Z order” means that overlays with higher values of layer will be inserted on top of overlays with lower values of layer. Must always be specified. In the XML for modifying a static overlay at runtime, if the XML has more than one image container, then each layer tag must have a different value. So each overlay must be in its own layer.  | 
| opacity | Integer | Optional Default: 50 | The opacity of the overlay, as a number from 0 to 100. 0 is transparent. 100 is fully opaque. When creating an event, cannot be omitted. | 
| start\$1time | String |  Optional Default: beginning of the event  | The start time for the overlay. Specify the start time in one of the formats discussed below this table. | 

**Start time formats******

**Option 1**: Timecode format (HH:MM:SS:FF). The overlay start is determined by comparing the specified start to the appropriate timecode. 
+ If the overlay is specified in the Input section: The start time for the static overlay will be compared to the input timecode (the timecode for a given input). The source for the input timecode is specified separately for each input (Input > Timecode Source field). The input timecode is calculated as follows: 
  + If Timecode Source is Embedded: The timecode associated with each frame is extracted from the timecode carried with the input media. Note that each input will have its own timecode and the timecode may not align well from one input to another. 
  + If Timecode Source field is Start at 0: The timecode of the first frame of the input is 00:00:00:00 and the timecode counts up with each successive frame. The timecode starts over with each input. 
  + If Timecode Source field is System Clock or Local System Clock (AWS Elemental Live only): The timecode of each frame in the input is the system time at which the frame is decoded. 
+ If the overlay is specified in the Global Processor section: The overlay start is compared to the output timecode (which is shared by all outputs). The source for the output timecode is specified for the entire event, in the Timecode Config > Source field. The output timecode is calculated as follows: 
  + If Source is Embedded: The timecode is extracted from the timecode carried with the input media. That timecode becomes the output timecode for the first transcoded frame. Then the output timecode counts up with each successive frame in the entire output. 
  + If Source is Start at 0: The output timecode for the first frame is 00:00:00:00 and then the output timecode counts up with each successive frame in the entire output. 
  + If Source is System Clock or Local System Clock (AWS Elemental Live only): The output timecode for the first frame is the system time at which the frame is decoded. Then the output timecode counts up with each successive frame in the entire output. 
  + If Source is Specified Start: The output timecode for the first frame is the time you specified when you selected this option as the timecode source. Then the output timecode counts up with each successive frame in the entire output. 
  + If Source is External Reference Connector (AWS Elemental Live only): The timecode is extracted from external LTC source. That timecode becomes the output timecode for the first transcoded frame. Then the output timecode counts up with each successive frame in the entire output. 
+ If the static overlay is specified in the Output section: The start time for the static overlay is calculated in the same way as a static overlay in the Global Processor section. 

**Option 2**: ISO 8601 UTC time with no dashes or colons. For example, 20160102T030405.678Z. In this case, the start time for every overlay (regardless of whether it is defined in the input, the global processor or the output) will be the UTC time. 

**Option 3**: Only when adding or modifying an overlay in a running event (not when creating an event or modifying a non-running event), set this tag to an empty string to set the start time to “now”. With this option, the start time is never exact. 

## Example


The following request creates an event with the name myLiveEvent and includes one static overlay to insert the file logo.bmp. The overlay is inserted directly inside the live\$1event, which means it will appear in all outputs.

```
POST http://198.51.100.22/live_events
```

```
<?xml version="1.0" encoding="UTF-8"?>
  <live_event>
    <name>myLiveEvent</name>
    ...
      <image_inserter>
        <enable_rest>true</enable_rest>
        <insertable_images>
          <insertable_image>
            <duration>30000</duration>
            <fade_in>10</fade_in>
            <fade_out>10</fade_out>
            <height>900</height>
            <left>300</left>
            <top>400</top>
            <layer>0</layer>
            <start_time>16:09:09:10</start_time>
            <width>800</width>
            <image_inserter_input>
              <uri>mnt/storage/logo.bmp</uri>
            </image_inserter_input>
          </insertable_image>
        </insertable_images>
      </image_inserter>
     ...
  </live_event>
```

# Modify static overlay on a running event
Modify static overlay

In a running event, you can use the REST API to add more static overlays, modify the behavior of an existing static overlay, or delete an existing static overlay.

**Note**  
Commands sent during an event change the event XML. Therefore, if you export the XML and create a new event with it, the new event will have any overlays set up as they were set during the course of the event, not as they were when the event was created. 

## HTTP request and response


**HTTP URL - one input** 

To add, modify, or delete the static overlay in one input element.

```
POST http://<Live IP Address>/live_events/<id>/image_inserter/input/<input id> 
```

Where `<input id>` is the unique ID automatically assigned to this input when the event is created or when the input is added to the event. 

or: 

```
POST http://<Live IP Address>/live_events/<id>/image_inserter/input/by_label/<input label> 
```

Where `<input label>` is the input label you assigned when you created this event or created this input. Input labels are always optional.

**HTTP URL - all outputs** 

To add, modify, or delete the static overlay in all outputs.

```
POST http://<Live IP Address>/live_events/<id>/image_inserter 
```

**HTTP URL - one output** 

To add, modify, or delete the static overlay in one output.

```
POST http://<Live IP Address>/live_events/<id>/image_inserter/output/<output id>
```

Where `<output id>` is the unique ID automatically assigned to this output when the event is created.

**HTTP URL - outputs for one stream assembly** 

To add, modify, or delete the static overlay in the outputs associated with a given stream.

```
POST http://<Live IP Address>/live_events/<id>/image_inserter/output/by_stream/<stream id>
```

Where `<stream id>` is the `<ID>` automatically assigned to this stream when the event is created. The ID can change while the event is running (for example, if another stream is deleted), so you may need to obtain the current ID before sending this command.

**Body of request ** 

XML content consisting of: 
+ One or more image\$1inserter elements that each contains:
  + 1 to 8 <image> elements that each contains the tags in the table in the section [Create or modify a non-running event with static graphic overlay](create-or-modify-a-non-running-event-with-static-graphic-overlay.md).

For information about the tags to include for different actions, see [Types of changes](step-c-manage-overlays-on-a-running-event.md#static-overlay-types-of-changes).

**Response** 

The response repeats back the data that you posted with `<ID>` tags for `image_inserter` and each overlay. If the event is not running, the message “Event <ID> is not running” is returned.

## Example


The following request modifies the overlays in the event with the ID 16. It modifies the start time on the existing overlay in layer 3.

It also adds one overlay (in layer 4); if an overlay already exists in layer 4, that overlay is replaced with the new overlay (even if that overlay is currently running). If an overlay does not exist in layer 4, the overlay is added.

```
POST http://198.51.100.22/live_events/16/image_inserter
```

```
<?xml version="1.0" encoding="UTF-8"?>
  <image_inserter>
    <image>
      <activate>true</activate>
      <layer>3</layer>
      <start_time>17:09:09:10</start_time>
    </image>
    <image>
      <activate>true</activate>
      <duration>30000</duration>
      <fade_in>10</fade_in>
      <fade_out>10</fade_out>
      <height>900</height>
      <left>300</left>
      <top>400</top>
      <layer>4</layer>
      <start_time>16:09:09:10</start_time>
      <width>800</width>
      <image_inserter_input>
        <uri>mnt/storage/logo.bmp</uri>
      </image_inserter_input>
    </image>
  </image_inserter>
```

# Static overlay plus dynamic content switching
Static overlay and content switching

You can combine the static overlays with the dynamic content switching feature. You can use dynamic content switching to continually add and modify inputs in an event that is running. As you add inputs, you can insert static or motion overlays, as desired. For information about dynamic content switching, see [Dynamic input switching](dynamic-content-switching.md).

## Scheduling inputs and overlays
Scheduling

The scheduling of the inputs and the overlays is completely decoupled. 

A given input X might be added several times to the dynamic playlist, for example, so that it plays at 2:00 p.m. and then plays again at 3:10 p.m. 

If you want an overlay to appear the first time that input X plays, you might set its start time for 2:10 p.m. The next time that input X plays, there is no logic to play the same overlay again because 2:10 p.m. has passed. Therefore, if you want the overlay to appear again on input X, you must send a Modify Overlay call again. 

## Behavior with different insertion options for static overlays
Tips

Following are points to remember when using static overlay with dynamic content switching:

**Playlist input plus overlay at the input stage**

You specify the overlay in the input section of the event. Therefore, whenever you include this input in the playlist, the overlay will be included. If you want to the image the first time the input appears in the playlist but you don't want to include it the next time the input appears, you must unless enter an action to remove it.
+ If you want to include the overlay in a given repetition of the input, you might need to change the start time of the overlay. See the information about the Start Time in the table under [Step B: Initial setup](step-b-initial-setup.md).
+ If you do not want to include the overlay in a given repetition of that input, you must use the REST interface to enter a Modify Static Overlay command and delete the overlay. See [Static graphic overlay commands](static-graphic-overlay-commands.md).

** Playlist input plus overlay at the global processing stage**

The scheduling of the inputs and the overlays is completely decoupled.

A given input X might be added several times to the dynamic playlist, for example, so that it plays at 2:00 p.m. and then plays again at 3:10 p.m.

If you want an overlay to appear the first time that input X plays, you might set its start time for 2:10 p.m. The next time that input X plays, there is no logic to play the same overlay again because 2:10 p.m. has passed. 

Therefore, if you want the overlay to appear again on input X, you must enter the Modify Static Overlay command again. 

**Playlist input plus overlay at the output stage**

The same comments as for global processing stage apply.

# XML structure


**Topics**
+ [

# Static overlay, creating and modifying a non-running event
](static-overlay-creating-and-modifying-a-non-running-event.md)
+ [

# Static overlay: Modifying overlay on a running event
](static-overlay-modifying-overlay-on-a-running-event.md)

# Static overlay, creating and modifying a non-running event
Static overlay – non-running event

## Overlays at top level



|  |  |  |  | 
| --- |--- |--- |--- |
| <image\$1inserter> |   |   |   | 
|   | enable\$1rest |   |   | 
|   | <insertable\$1image> |   |   | 
|   |   | duration |   | 
|   |   | fade\$1in |   | 
|   |   | fade\$1out |   | 
|   |   | height |   | 
|   |   | image\$1x |   | 
|   |   | image\$1y |   | 
|   |   | layer |   | 
|   |   | opacity |   | 
|   |   | start\$1time |   | 
|   |   | width |   | 
|   |   | <image\$1inserter\$1input> |   | 
|   |   |   | certificate\$1file | 
|   |   |   | interface | 
|   |   |   | password | 
|   |   |   | uri | 
|   |   |   | username | 
|   |   | </image\$1inserter\$1input> |   | 
|   | </insertable\$1image> |   |   | 
| </image\$1inserter> |   |   |   | 

## Overlays in input section


**Data in <input> element **


|  |  |  |  |  | 
| --- |--- |--- |--- |--- |
| <input> |   |   |   |   | 
|   | <image\$1inserter> |   |   |   | 
|   |   | enable\$1rest |   |   | 
|   |   | <insertable\$1image> |   |   | 
|   |   |   | duration |   | 
|   |   |   | fade\$1in |   | 
|   |   |   | fade\$1out |   | 
|   |   |   | height |   | 
|   |   |   | image\$1x |   | 
|   |   |   | image\$1y |   | 
|   |   |   | layer |   | 
|   |   |   | opacity |   | 
|   |   |   | start\$1time |   | 
|   |   |   | width |   | 
|   |   |   | <image\$1inserter\$1input> |   | 
|   |   |   |   | certificate\$1file | 
|   |   |   |   | interface | 
|   |   |   |   | password | 
|   |   |   |   | uri | 
|   |   |   |   | username | 
|   |   |   | </image\$1inserter\$1input> |   | 
|   |   | </insertable\$1image> |   |   | 

## Overlays in Ssream assembly section


**Data in <stream\$1assembly> **


|  |  |  |  |  |  |  | 
| --- |--- |--- |--- |--- |--- |--- |
| <stream\$1assembly> |   |   |   |   |   |   | 
|   | <video\$1description> |   |   |   |   |   | 
|   |   | <video\$1preprocessors> |   |   |   |   | 
|   |   |   | <image\$1inserter> |   |   |   | 
|   |   |   |   | enable\$1rest |   |   | 
|   |   |   |   | <insertable\$1image> |   |   | 
|   |   |   |   |   | duration |   | 
|   |   |   |   |   | fade\$1in |   | 
|   |   |   |   |   | fade\$1out |   | 
|   |   |   |   |   | height |   | 
|   |   |   |   |   | image\$1x |   | 
|   |   |   |   |   | image\$1y |   | 
|   |   |   |   |   | layer |   | 
|   |   |   |   |   | opacity |   | 
|   |   |   |   |   | start\$1time |   | 
|   |   |   |   |   | width |   | 
|   |   |   |   |   |  <image\$1inserter \$1input>  |   | 
|   |   |   |   |   |   | certificate\$1file | 
|   |   |   |   |   |   | interface | 
|   |   |   |   |   |   | password | 
|   |   |   |   |   |   | uri | 
|   |   |   |   |   |   | username | 
|   |   |   |   |   |  </image\$1inserter \$1input>  |   | 
|   |   |   |   | </insertable\$1image> |   |   | 
|   |   |   | <image\$1inserter> |   |   |   | 

# Static overlay: Modifying overlay on a running event
Static overlay – running event


|  |  |  |  | 
| --- |--- |--- |--- |
| <image\$1inserter> |   |   |   | 
|   | <image> |   |   | 
|   |   | activate |   | 
|   |   | duration |   | 
|   |   | fade\$1in |   | 
|   |   | fade\$1out |   | 
|   |   | height |   | 
|   |   | image\$1x |   | 
|   |   | image\$1y |   | 
|   |   | layer |   | 
|   |   | opacity |   | 
|   |   | start\$1time |   | 
|   |   | width |   | 
|   |   | <image\$1inserter\$1input> |   | 
|   |   |   | certificate\$1file | 
|   |   |   | interface | 
|   |   |   | password | 
|   |   |   | uri | 
|   |   |   | username | 
|   |   | </image\$1inserter\$1input> |   | 
|   | </image> |   |   | 
| </images\$1inserter> |   |   |   | 