

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