

# Specifying input files and input clips
<a name="specifying-inputs"></a>

You can use MediaConvert for *assembly workflows*. An assembly workflow is a MediaConvert job that performs basic input clipping and stitching to assemble output assets from different sources without requiring separate editing software. For example, an assembly workflow can put together a bumper followed by feature content that is interleaved with advertisements. The feature content might have a logo graphic overlay at the beginning of each feature segment.

With these kinds of jobs, you assemble your outputs from multiple inputs by using *input stitching*, or portions of inputs by using *input clipping*. MediaConvert creates all of a job's outputs from this assembly. If you want outputs with different clips of the input files or with different arrangements of the inputs, you must create a separate job for each assembly.

**Topics**
+ [How MediaConvert uses timelines to assemble jobs](#how-mediaconvert-uses-timelines-to-assemble-jobs)
+ [Setting up an assembly workflow job](#setting-up-an-assembly-workflow-job)
+ [Setting up audio tracks and audio selectors](more-about-audio-tracks-selectors.md)
+ [Setting up input captions](including-captions.md)

## How MediaConvert uses timelines to assemble jobs
<a name="how-mediaconvert-uses-timelines-to-assemble-jobs"></a>

MediaConvert assembles inputs and input clips according to *input timelines* and the *output timeline*. The service constructs these timelines based on your settings, and then assembles your inputs into outputs based on them. The following illustration shows three independent input timelines and an output timeline.

![\[Three separate input files are represented with three rectangles. Each is marked with a number line that represents an input timeline. One timeline starts at zero. One timeline shows embedded timecodes. One timeline reflects a specified start setting that starts at one hour. Two of these rectangles have clips inside them, represented with color fill in only parts of the rectangle. One of the rectangles is filled entirely, representing that the entire input file is used in the output. Below the input rectangles is a wider rectangle that represents all the clips and inputs assembled together. This rectangle is marked with a number line that represents the output timeline, which starts at 00:00:00:00.\]](http://docs.aws.amazon.com/mediaconvert/latest/ug/images/assembly.png)


### Input timelines
<a name="input-timelines"></a>

Each input has its own *input timeline*. An input timeline is a series of timecodes that MediaConvert generates to represent each frame of the input file.

By default, the input timeline is the same as any timecodes embedded in the input video. You can specify a different starting timecode in the input setting **Timecode source**. If you use the API or an SDK, you can find this setting in the JSON file of your job. The setting name is `TimecodeSource`, located in `Settings`, `Inputs`. For more information, see [Adjusting the input timeline with the input timecode source](timecode-input.md).

MediaConvert uses the input timeline for the following:
+ Determining when input graphic overlays (inserted images) appear in the video. For more information about the difference between input and output overlays, see [Choosing between input and output overlays](choosing-between-input-overlay-and-output-overlay.md).
+ Determining when motion graphic overlays (inserted images) appear in the video. For more information about the different types of graphic overlays, see [Image insertion](graphic-overlay.md).
+ Synchronizing your video with *sidecar captions* that are in a timecode-based format. Sidecar captions are captions that you provide as input files that are separate from the video.
+ Interpreting the timecodes that you provide when you specify input clips.

### Output timeline
<a name="output-timeline"></a>

The *output timeline* is the series of timecodes that MediaConvert generates to embed in the outputs. MediaConvert also uses the timecodes of the output timeline for features that apply to every output in the job.

By default, the output timeline is the same as any timecodes embedded in the video of your first input file. You can specify a different starting timecode in the job-wide **Timecode configuration** settings under **Job settings**. If you use the API or an SDK, you can find these settings in the JSON file of your job. These settings are under `Settings`, `TimecodeConfig`. For more information, see [Adjusting the output timeline with the job-wide timecode configuration](timecode-jobconfig.md).

MediaConvert uses the output timeline for the following:
+ Determining which timecodes to embed in the output video, when you enable **Timecode insertion** in your output timecode settings.
+ Determining when output overlays (inserted images) appear in the video. For more information about the different types of graphic overlays, see [Image insertion](graphic-overlay.md).
+ Determining how your HLS variant playlists show time.
+ Interpreting the timecode that you provide when you specify a value for **Anchor timecode**.

## Setting up an assembly workflow job
<a name="setting-up-an-assembly-workflow-job"></a>

Follow these steps to set up a job that combines assembly workflow features such as input clipping, input stitching, graphic overlay, and sidecar captions sync. Doing these tasks in this order can make setup easier. In particular, we recommend that you specify your input clips last. This is because each input timeline counts frames from the entire input, not from each individual clip.

This procedure relies on the concept of input and output timelines. For more information, see [How MediaConvert uses timelines to assemble jobs](#how-mediaconvert-uses-timelines-to-assemble-jobs).

**To set up an assembly workflow job (console)**

1. **Specify your video input files.**

   You can have up to 150 inputs in a job. MediaConvert stitches together the inputs in the order that you add them. To use multiple clips from the same input file in chronological order without other inputs in between them, specify the input file only once.

   For full instructions, see [Step 1: Specify input files](setting-up-a-job.md#specify-input-settings).

1. **Set up your audio selectors.**

   In each input, you create audio selectors to map your input audio to your outputs. For instructions, see [Step 2: Create input selectors for video, audio, and captions](setting-up-a-job.md#create-selectors).

   With sidecar audio files, MediaConvert synchronizes audio and video without regard to timecodes. MediaConvert lines up the start of the audio file with the start of the video file.

   Whether your audio is in a sidecar file or embedded in the video, you can adjust its sync using the **Offset** setting in the input audio selector. Use a positive number for **Offset** to move the audio later in the input timeline; use a negative number to move it earlier.

1. **Synchronize any sidecar captions.**

   How you set up your sidecar captions sync depends on the input captions format:
   + If your input captions format is timecode-based (for example, SCC or STL), the service synchronizes the timecode in the captions file with the input timeline.
   + If your input captions format is timestamp-based (for example, SRT, SMI, or TTML), the service synchronizes the captions with the video without regard to timecodes.

**Related information**
   + [About input timecode source and captions alignment](about-input-timecode-source-and-captions-alignment.md)
   + [Adjusting the input timeline with the input timecode source](timecode-input.md)
   + [Captions and captions selectors](including-captions.md) 

1. **Set up when you want any graphic overlays or motion graphic overlays to appear.**

   How you specify the time that the overlay appears depends on what kind of overlay you specify:
   + For input still graphic overlays, specify the overlay in the input where you want the overlay to appear. Specify the start and end times with timecodes that match with that input's timeline.
   + For output still graphic overlays, specify when you want the overlay to appear based on the output timeline.
   + For motion graphic overlays, specify when you want the overlay to appear based on the inputs' timelines.

**Related information**
   + [Adjusting the input timeline with the input timecode source](timecode-input.md)
   + [Adjusting the output timeline with the job-wide timecode configuration](timecode-jobconfig.md)
   + [Image insertion](graphic-overlay.md)

1. **Specify input clips.**

   Unless you want MediaConvert to include the full duration of the input, specify input clips for each input. Specify the start and end times with timecodes that match with that input's timeline.

   Set up input clips as follows:

   1. On the **Create job** page, in the **Job** pane on the left, choose an input.

   1. In the **Input clips** section, choose **Add input clip**.

   1. Enter the starting and ending timecodes for the first clip that you want to include. Use the following 24-hour format with a frame number: HH:MM:SS:FF.

      When you specify an input clip for an audio-only input, the last numbers in the timecode that you enter correspond to hundredths of a second. For example, 00:00:30:75 is the same as 30.75 seconds.

      Make sure that you provide timecodes that align with your input timeline. By default, MediaConvert bases input clipping on timecodes that are embedded in your input video. How you align your timecodes depends on whether your input video has embedded timecodes:
      + If your input doesn't have embedded timecodes, set **Timecode source** to **Start at 0** or **Specified start**.
      + If your input *does* have embedded timecodes and you want MediaConvert to use them, for **Timecode source**, keep the default value, **Embedded**. Specify your clip start and end times accordingly.

        For example, if an input **Timecode source** is set to **Embedded** with video embedded timecodes that start at 01:00:00:00, define the start timecode for a clip 30 seconds in 01:00:30:00 (not 00:00:30:00). By default, the input timeline is the same as the timecodes that are embedded in the video. You can change what determines the input timeline by adjusting the input **Timecode source** setting.
      + Specify an input clip duration that is less than 12 hours long.

      For more information, see [Adjusting the input timeline with the input timecode source](timecode-input.md).

   1. Specify any additional clips. Multiple clips must be in chronological order and can't overlap; each **Start timecode** must come after the previous clip's **End timecode**.

      If you specify more than one input clip, they all appear in the output, one after the other, in the order that you specify them.

# Setting up audio tracks and audio selectors
<a name="more-about-audio-tracks-selectors"></a>

You use audio selectors to associate input audio with output audio. You can set up a single audio selector to represent one or more tracks from the input. After that, you create audio tracks in the output and associate a single audio selector with each output track.

Associations between input audio tracks, audio selectors, and output audio tracks follow these rules:
+  Each input track can be associated with one or more audio selectors 
+  Each audio selector has one or more input tracks 
+  Each output track has one audio selector 

The following illustration shows these relationships. In the illustration, the input file contains three audio tracks. Audio selector 1 selects input track 1. Audio selector 1 is associated with output audio track 1, so track 1 of the output has the same content as track 1 of the input. The second input audio track is not selected by an audio selector, so it isn't used in the output. Audio selector 2 selects input tracks 1 and 3. Audio selector 2 is associated with output audio track 2, so output track 2 contains the channels from input tracks 1 and 3.

![\[Use audio selectors to associate input tracks with output tracks.\]](http://docs.aws.amazon.com/mediaconvert/latest/ug/images/audio-selectors-shared-vsd.png)


For workflows that require channel-level control, use the audio channel remix feature, which supports the following workflows:
+ Changing the order of channels in an audio track
+ Moving audio channels from one or more input tracks to different output tracks
+ Combining the audio from multiple channels into a single channel
+ Splitting the audio from a single channel into multiple channels
+ Adjusting the loudness level of audio channels

# Setting up input captions
<a name="including-captions"></a>

To include captions in your job, follow these steps in the order listed:

1. If your input captions are a timecode-based sidecar captions format, such as SCC or STL, [set the timecode source settings.](#set-the-timecode-source-settings)

1. [Gather required captions information.](#gather-required-captions-information)

1. [Create input captions selectors.](#create-input-caption-selectors)

1. [Set up captions in outputs.](set-up-captions-in-outputs.md)

For a full list of supported input and output captions, see [Captions reference tables](captions-support-tables.md).

For information about how to set up captions in your output, see [Setting up captions in outputs](set-up-captions-in-outputs.md).

**Tip**  
You can use Amazon Transcribe with MediaConvert to generate captions and include them in your output. For more information, see [AWS VOD captioning using Amazon Transcribe](https://github.com/aws-samples/aws-transcribe-captioning-tools) in *AWS Samples* on GitHub.

## Specifying the timecode source
<a name="set-the-timecode-source-settings"></a>

For your captions to correctly synchronize with your video, you must set up your input timeline to match the timecodes embedded in your captions file. MediaConvert establishes the input timeline based on the value you choose for the input **Timecode source** setting. For more information, see [Input timecode source and captions alignment](about-input-timecode-source-and-captions-alignment.md).

For instructions on adjusting the **Timecode source** setting, see [Adjusting the input timeline with the input timecode source](timecode-input.md).

## Gathering required captions information
<a name="gather-required-captions-information"></a>

Before you set up captions in your job, note the following information:
+ The *input captions format*. You must have this information ahead of time; MediaConvert does not read this from your input files.
+ The *tracks* from the input captions that you intend to use in any of your outputs.
+ The *output packages and files* that you intend to create with the job. For information about specifying the output package or file type, see [Creating outputs](output-settings.md).
+ The *output captions format* that you intend to use in each output.

  For supported output captions based on your input container, input captions format, and output container, see [Supported input captions, within video containers](captions-support-tables-by-container-type.md). 
+ The *output captions tracks* that you intend to include for each output. If you pass through teletext-to-teletext, all tracks in the input are available in the output. Otherwise, the tracks that you include in an output might be a subset of the tracks that are available in the input.

## Creating input captions selectors
<a name="create-input-caption-selectors"></a>

When you set up captions, you begin by creating captions selectors. Captions selectors identify a particular captions asset on the input and associate a label with it. The captions asset is either a single track or the set of all tracks contained in the input file, depending on your input captions format. For example, you might add **Captions selector 1** and associate the French captions with it. When you [set up an output to include captions](set-up-captions-in-outputs.md), you do so by specifying captions selectors. 

**To create input captions selectors**

1. On the **Create job** page, in the **Job** pane on the left, choose an input. 
**Note**  
In jobs with multiple inputs, each input must have the same number of captions selectors. For inputs that don't have captions, create empty captions selectors. For these selectors, for **Source**, choose **Null source**. Remove all captions selectors if no inputs have captions.

1. In the **Captions selectors** section, near the bottom of the page, choose **Add captions selector**. 

1. Under **Source**, choose the input captions format. 

1. For most formats, more fields appear. Specify the values for these fields as described in the topic that relates to your input captions format. Choose the appropriate topic from the list that follows this procedure.

1. Create more captions selectors as necessary. The number of captions selectors that you need depends on your input captions format. Choose the appropriate topic from the list that follows this procedure.

# QuickTime captions track or captions in MXF VANC data (ancillary) input captions
<a name="ancillary"></a>

If your input captions are in either of the following formats, the service handles them as "ancillary" data:
+ QuickTime captions track (format QTCC)
+ MXF VANC data

MediaConvert does not create output captions in these formats, but you can convert them to a [supported output format](captions-support-tables-by-container-type.md).

**For ancillary captions**
+ Create one captions selector per track that you will use in your outputs.
+ In each captions selector, for **Source**, choose **Ancillary**.
+ In each captions selector, for **CC channel**, choose the channel number for the track that is associated with the selector.

  For example, the input captions have English in CC channel 1 and Spanish in CC channel 2. To use these captions, create Captions selector 1, and then choose 1 in the **CC channel** dropdown list. Next, create Captions selector 2, and then choose 2 in the **CC channel** dropdown list.

# Embedded (CEA/EIA-608, CEA/EIA-708), embedded\$1SCTE-20, and SCTE-20\$1embedded input captions
<a name="embedded"></a>

If your input captions are in any of the following formats, the service handles them as "embedded":
+ CEA-608
+ EIA-608
+ CEA-708
+ EIA-708

If your input captions have both embedded captions and SCTE-20 captions, and you want both types in your outputs, set up separate input captions selectors for the SCTE-20 and the embedded captions tracks. Set up the SCTE-20 captions selectors the same way that you set up the embedded selectors.

**Note**  
For MXF inputs, your captions are most likely on the ancillary track. Some third-party media analysis tools incorrectly report these captions as 608/708 embedded. For information on setting up ancillary captions, see [QuickTime captions track or captions in MXF VANC data (ancillary) input captions](ancillary.md).

## Number of captions selectors for embedded captions
<a name="embedded-how-many-caption-selectors"></a>
+ If all of your output captions are also an embedded format, create only one captions selector, even if you want to include multiple tracks in the output. With this setup, MediaConvert automatically extracts all tracks and includes them in the output.
+ If all of your outputs are in a format that is not embedded, create one captions selector for each track that you want to include in the output.
+ If some of your outputs have captions in an embedded format and some of your outputs have captions in a different format, create one captions selector for the outputs with embedded captions. Also create individual selectors for the outputs with other captions that aren't embedded, one for each track that you want in your outputs.

## Captions selector fields for embedded captions
<a name="embedded-caption-selector-fields"></a>

**Source**: Choose **Embedded**

**CC channel number**: This field specifies the track to extract. Complete as follows: 
+ If you are doing embedded-to-embedded captions (that is, you create only one captions selector for the input embedded captions), MediaConvert ignores this field, so keep the default value for **CC channel number**.
+ If you are converting embedded captions to another format, (that is, you create several captions selectors, one for each track), specify the captions channel number from the input that holds the track that you want. To do that, select the channel number from the dropdown list. For example, select **1** to choose CC1.

**Note**  
MediaConvert doesn't automatically detect which language is in each channel. You can specify that when you set up the output captions, so that MediaConvert passes the language code metadata for the captions channel into the output for downstream use.



# DVB-Sub input captions
<a name="dvb-sub-or-scte-27"></a>

MediaConvert supports DVB-Sub only in TS inputs.

In most cases, create one captions selector per track. In each selector, specify which track you want by providing the PID or language code.

**Note**  
Don't specify the captions in both the **PID** field and the **Language** dropdown list. Specify one or the other. 

If you are doing DVB-sub-to-DVB-sub and you want to pass through all the captions tracks from the input to the output, create one captions selector for all tracks. In this case, keep the **PID** field blank and don't choose any language from the **Language** dropdown list.

# Teletext input captions
<a name="teletext"></a>

How you set up your Teletext input captions selectors depends on how you plan to use the captions in your output. You can use Teletext captions in one of the following ways:
+ [Teletext to Teletext passthrough](#input-teletext-to-output-teletext-passthrough)

  With Teletext passthrough, MediaConvert passes through your input captions unchanged from the input to the output. Captions styling, Teletext page numbers, and non-caption Teletext data appear in your outputs exactly the same as in the input.

  Teletext passthrough is the only way to include Teletext data that isn't captions in your output.
+ [Teletext to Teletext, page remapping](#input-teletext-to-output-teletext-with-page-remapping)

  If you want the Teletext page numbers on your output to differ from the page numbers on the input, you can remap the content. When you do this, your output captions have plain styling and you lose any Teletext data that isn't captions.
+ [Teletext to other captions formats](#input-teletext-to-other-format-output-captions)

  You can use Teletext input captions to generate output captions in some other formats. To look up which captions you can generate from Teletext inputs, see [Captions reference tables](captions-support-tables.md).

For information on setting up captions for each of these workflows, see the following topics.

## Teletext to Teletext passthrough
<a name="input-teletext-to-output-teletext-passthrough"></a>

When you're doing Teletext to Teletext passthrough, create one input captions selector for the whole set of input captions. Don't specify a value for **Page number**.

For information about setting up the output of this captions workflow, see [Teletext to Teletext passthrough](teletext-output-captions.md#teletext-to-teletext-passthrough).

## Teletext to Teletext, page remapping
<a name="input-teletext-to-output-teletext-with-page-remapping"></a>

When the captions format for both your input and output captions is Teletext, and you want your output Teletext page numbers to be different from the input page numbers, create a separate input captions selector for each Teletext page of your input. Specify the input Teletext page number for **Page number**.

For information about setting up the output of this captions workflow, see [Teletext to Teletext, page remapping](teletext-output-captions.md#teletext-to-teletext-page-remapping).

## Teletext to other captions formats
<a name="input-teletext-to-other-format-output-captions"></a>

When your input captions are Teletext and your output captions are another format, set up one input captions selector for each input Teletext page. Specify the input Teletext page number for **Page number**.

For information about setting up the output of this captions workflow, see the section on your output format in [Setting up captions in outputs](set-up-captions-in-outputs.md).

# IMSC, SCC, SMPTE-TT, SRT, STL, TTML (sidecar) input captions
<a name="sidecar-input"></a>

IMSC, SCC, SMPTE-TT, SRT, STL, and TTML are sidecar captions formats. With these formats, you provide input captions as a separate file. Depending on your output captions settings, AWS Elemental MediaConvert passes them through to the output in the same format or converts them into another sidecar format.

**All sidecar captions**  
In all cases, create one captions selector for each input captions file.

In **Source file**, enter the URI to the captions input file that is stored in Amazon S3 or on an HTTP(S) server. For Amazon S3 inputs, you can specify the URI directly or choose **Browse** to select from your Amazon S3 buckets. For HTTP(S) inputs, provide the URL to your input video file. For more information, see [HTTP input requirements](http-input-requirements.md). 

**IMSC captions**  
MediaConvert supports IMSC as an input captions format either as a sidecar file or as part of an IMF source. If your input IMSC captions are part of an IMF package, see [IMSC input captions (as part of an IMF source)](IMSC-in-MXF.md). For restrictions on IMSC support, see [IMSC requirements](imsc-captions-support.md).

**SMPTE-TT captions**  
You can use SMPTE-TT input captions that are text-only, that have captions images included in the captions file with base64 encoding (`smpte:image encoding="Base64"`), and that use external references to captions images (`smpte:backgroundImage`).

When your captions use external references to images, those images must be located in the same Amazon S3 bucket and folder as your captions file. For example, say this is the Amazon S3 path to your SMPTE\$1TT file: `amzn-s3-demo-bucket/mediaconvert-input/captions/my-captions-spanish.ttml`. Then you must store the image files that the captions file references here: `s3://amzn-s3-demo-bucket/mediaconvert-input/captions/`.

**SRT captions**  
MediaConvert supports SRT input captions with UTF-8 character encoding.

**Synchronizing sidecar captions and video**  
To make sure that your captions are properly synchronized with your video, check that the value for **Timecode source** in the **Video selector** section matches the timecodes in your captions file. For example, if your video has embedded timecodes starting at 01:00:00:00, but the timecodes in your captions file start at zero, change the default value for the video selector **Timecode source** from **Embedded** to **Start at 0**. If other aspects of your job prevent that, use the **Time delta** setting to adjust your captions, as described in [Use cases for time delta](time-delta-use-cases.md).

**Note**  
MediaConvert handles the alignment of captions with video differently depending on whether the caption format is timecode-based or timestamp-based. For more information, see [Input timecode source and captions alignment](about-input-timecode-source-and-captions-alignment.md).

Enter a positive or negative number in **Time delta** to modify the time values in the captions file. By default, time delta is measured in seconds. For example, enter **15** to add 15 seconds to all the time values in the captions file. Or, enter **-5** to subtract 5 seconds from the time values in the captions file. To specify in milliseconds instead, set **Time delta units** to **Milliseconds**.

If the value you enter for **Time delta** would result in captions before or after your video, those captions will not be present in your output.

**Note**  
When converting from SCC to SRT, MediaConvert first rounds the value you set for **Time delta** to the nearest input frame. MediaConvert uses this rounded value when calculating output SRT timings.

**Topics**
+ [Input timecode source and captions alignment](about-input-timecode-source-and-captions-alignment.md)
+ [Use cases for time delta](time-delta-use-cases.md)
+ [Converting dual SCC input files to embedded captions](converting-dual-scc-input-files-to-embedded-captions.md)
+ [TTML style formatting](ttml-style-formatting.md)

# Input timecode source and captions alignment
<a name="about-input-timecode-source-and-captions-alignment"></a>

When you adjust your input timeline by setting the input **Timecode source** to **Start at 0** or **Specified start**, MediaConvert behaves as though your input has embedded timecodes that start when you specify. But MediaConvert doesn't change the timecodes or timestamps in your sidecar captions files. Therefore, the way that you align your captions depends on your captions format.

**Timecode-based sidecar formats (SCC, STL)**  
Some captions formats, including SCC and STL, define where captions are placed in the video by timecode. With these formats, MediaConvert places each caption on the frames specified in the captions file, according to each frame's timecode in the input timeline. To adjust your captions to start at a different time than that, use the **Time delta** setting. For more information, see [Use cases for time delta](time-delta-use-cases.md).

MediaConvert establishes the input timeline based on the value you choose for the input **Timecode source** setting.

For example, if your SCC file specifies that the first caption should appear at 00:05:23:00 and you set **Timecode source** to **Specified start** and **Start timecode** to 00:04:00:00, the first caption will appear in your output one minute and twenty-three seconds into the video. If you set **Timecode source** to **Specified start** and **Start timecode** to 01:00:00:00, you won't see captions when you expect, because 00:05:23:00 occurs before the start of your video, according to the input timeline.

**Timestamp-based sidecar formats (SRT, SMI, TTML)**  
Some captions formats, including SRT, SMI, and TTML, allow for definition of where captions are placed in the video by timestamp. With these, MediaConvert measures the placement of the captions by the distance, in time, from the start of the video. This is true regardless of whether the captions file specifies placement with timecode or timestamp.

Therefore, your captions appear at the time specified in the captions file without regard to the video timecodes. For example, if your SRT file specifies that the first caption should appear at 00:05:23:00 or at 00:05:23,000 and you set **Timecode source** to **Specified start** and **Start timecode** to 00:04:00:00, the first caption will still appear in your output five minutes and twenty-three seconds into the video.

To adjust your captions to start at a different time than that, use the **Time delta** setting. For more information, see [Use cases for time delta](time-delta-use-cases.md).

**Formats that embed captions in the video stream (CEA/EIA-608, CEA/EIA-708)**  
Some captions formats embed the captions directly in the video frame or the video frame metadata. With these, MediaConvert keeps the captions with the frames that they are embedded in, regardless of the timecode settings.

# Use cases for time delta
<a name="time-delta-use-cases"></a>

How you use **Time delta (TimeDelta)** depends on the problem you're trying to solve and the captions format that you're working with.

 By default, you specify the time delta in seconds. If you want to specify it in milliseconds instead, set **Time delta units (TimeDeltaUnits)** to **Milliseconds (MILLISECONDS)**.

## Adjusting for different timecodes between video and captions files
<a name="adjusting-for-different-timecodes-between-video-and-captions-files"></a>

With timecode-based captions formats, such as SCC and STL, the timecodes in the captions might be relative to a starting timecode that is different from the starting timecode embedded in the video. You use **Time delta** to adjust for the difference.

**Example problem:** Your video file might have embedded timecodes that start at 00:05:00:00. The first instance of dialogue that requires captions might be one minute into the video, at timecode 00:06:00:00. Your captions file might be written on the assumption that your video timecodes start at 00:00:00:00, with the first caption starting at 00:01:00:00. If you don't use **Time delta**, MediaConvert would not include this first caption because it occurs before the start of the video. 

**Solution:** Add five minutes to the captions. Enter **300** for **Time delta**.

## Adjusting captions after synchronizing video and audio
<a name="adjusting-captions-after-sychronizing-video-and-audio"></a>

Your timecode-based (SCC or STL) captions might be aligned with the timecodes that are embedded in your video, but you might need to use the input **Timecode source** setting to align your audio. This creates a difference between the video and captions, which you need to adjust for. You don't need to make this adjustment with timestamp-based captions formats, such as SRT, SMI, and TTML.

For more information about aligning captions when you use input **Timecode source**, see [Input timecode source and captions alignment](about-input-timecode-source-and-captions-alignment.md).

**Example problem:** Your video file might have embedded timecodes that start at 00:05:00:00 and the first instance of dialogue that requires captions might be one minute into the video, at timecode 00:06:00:00. Your captions file is written to sync correctly, with the first caption starting at 00:06:00:00. But you need to change your embedded captions in your input to sync correctly with your audio file. So you set the input **Timecode source** to **Start at Zero**. If you don't use **Time delta**, MediaConvert would put the first caption in your output at six minutes into the video.

**Solution:** Subtract five minutes from the captions. Enter **-300** for **Time delta**.

## Correcting slight errors in captions sync
<a name="correcting-slight-errors-in-captions-sync"></a>

With any type of sidecar format, there might be a small error in your input captions file, so that the captions are consistently a little late or a little early.

**Example problem:** Your video has embedded captions that start at zero. The first instance of dialogue that requires captions is at 00:06:15:00, but the captions appear on the screen three seconds late, at 00:06:18:00.

**Solution:** Subtract three seconds from the captions. Enter **-3** for **Time delta**.

# Converting dual SCC input files to embedded captions
<a name="converting-dual-scc-input-files-to-embedded-captions"></a>

If you want to use two SCC files as your captions input and embed the captions as two output captions channels embedded in your output video stream, set up your captions according to this procedure.

**To convert dual SCC to embedded captions**

1. Set up two input captions selectors. Follow the procedure in [Creating input captions selectors](including-captions.md#create-input-caption-selectors). Specify values as follows:
   + In each captions selector, choose **SCC** for **Source**.
   + For **Source file**, choose one of your input SCC files in each selector.
   + If you want both 608 and 708 captions embedded in your outputs, choose **Upconvert** for **Force 608 to 708 upconvert** in both captions selectors.

1. Set up captions in your outputs. Follow the procedure in [Setting up captions in outputs](set-up-captions-in-outputs.md). Follow these specific choices:
   + Specify the captions in the same output as the video that you want the captions embedded in.
   + Choose **Add captions** twice, to create **Captions 1** and **Captions 2** tabs in the **Encoding settings** section.
   + For **Captions source**, in each of the captions tabs, choose one of the captions selectors that you created in the preceding step of this procedure.
   + For **CC channel number**, choose a number for each of the captions tabs that don't share a field. For example, in **Captions 1**, choose **1** for **CC channel number** and in **Captions 2**, choose **3** for **CC channel number**.

     Don't choose the combinations 1 and 2 or 3 and 4, because those pairs of channels share the same field.
   + If you chose **Upconvert** in the preceding step of this procedure, optionally specify a service number for **708 service number**. Within an output, each captions tab must specify a different service number.

     If you upconvert and don't specify a value for **708 service number**, the service uses the value that you specify for **CC channel number** as your 708 service number.

# TTML style formatting
<a name="ttml-style-formatting"></a>

AWS Elemental MediaConvert reads the style formatting of your input captions when your job runs. If you notice issues with the style formatting of your output, we recommend checking the formatting of your input captions or setting **Style passthrough** to Enabled. The following topics provide guidance for using fonts, heritable and non-heritable attributes, and right to left languages in your TTML input captions.

**Specifying fonts** 

MediaConvert supports the following generic font families listed in the [TTML2 W3C recommendation](https://www.w3.org/TR/ttml2/#style-value-generic-family-name): 
+ default
+ monospace
+ sansSerif
+ serif
+ monospaceSansSerif
+ monospaceSerif
+ proportionalSansSerif
+ proportionalSerif

For the best results, specify a generic font family within your TTML input captions. If you specify an individual font instead, MediaConvert will map the font to one of the generic font families listed above.

**Heritable and non-heritable attributes** 

Style attributes are either heritable or non-heritable. The [TTML 2 W3C recommendation](https://www.w3.org/TR/ttml2/#styling-attribute-vocabulary) lists these under *inherited* for each style attribute.

Include non-heritable style attributes in every element that you want them to apply to.

For example, `tts:backgroundColor` is a non-heritable style attribute. The following results in *hello* with a red background color and *world* with no background color: 

`<span tts:backgroundColor="red">hello<br/>world</span>` 

You can fix the above formatting so that *hello world* both have a red background color by using individual spans, each with their own style attributes, like in this example: 

`<span><span tts:backgroundColor="red">hello</span> <br/> <span tts:backgroundColor="red">world</span></span>` 

**Right to left languages** 

MediaConvert supports both left to right and right to left text directions within TTML. 

When you don’t specify text direction, MediaConvert uses left to right. 

To specify right to left, include a `tts:direction="rtl"` attribute. If your text has a mix of bidirectional characters, also include a `tts:unicodeBidi="embed"` attribute as described in the [TTML2 W3C recommendation](https://www.w3.org/TR/ttml2/#style-attribute-direction). Note that `tts:unicodeBidi` is a non-heritable attribute.

# IMSC input captions (as part of an IMF source)
<a name="IMSC-in-MXF"></a>

AWS Elemental MediaConvert supports IMSC as an input captions format either as a sidecar file or as part of an IMF source. If your input IMSC captions are in a sidecar file, see [IMSC, SCC, SMPTE-TT, SRT, STL, TTML (sidecar) input captions](sidecar-input.md).

When your input IMSC captions are part of an IMF source, you don't specify the source file for IMSC captions. That information is in the CPL file that you specify for your job input. For restrictions on IMSC support, see [IMSC requirements](imsc-captions-support.md).

**Number of captions selectors for IMSC**  
Create one captions selector per track.

**Track number**  
Specify which captions you want by providing a track number. The track numbers correspond to the order that the tracks appear in the CPL file. For example, if your CPL file lists your French captions first, set **Track number** to **1** to specify the French captions.

**In your JSON job specification**  
If you use the API or an SDK, you can find these settings in the JSON file of your job. These settings are under `Inputs`, as in the following example:

```
"Inputs": [

 
      {
        ...
        		
        "CaptionSelectors": {
          "Captions Selector 1": {
            "SourceSettings": {
              "SourceType": "IMSC",
              "TrackSourceSettings": {
                "TrackNumber": 1
              }
            }
          },

          "Captions Selector 2": {
            "SourceSettings": {
              "SourceType": "IMSC",
              "TrackSourceSettings": {
                "TrackNumber": 4
              }
            }
          },
          ...
```

# WebVTT input captions (as part of an HLS source)
<a name="WebVTT-in-HLS"></a>

AWS Elemental MediaConvert supports WebVTT as an input captions format either as a sidecar file or as part of an HLS source. If your input WebVTT captions are in a sidecar file, see [IMSC, SCC, SMPTE-TT, SRT, STL, TTML (sidecar) input captions](sidecar-input.md).

When your input WebVTT captions are part of a HLS source, you don't need to specify the source WebVTT manifest file for the WebVTT captions. That information is in the main HLS input file that you specify in your job input. You will need to enable the **Use HLS Rendition Group** and use the following settings.

**Number of captions selectors for WebVTT**  
Create one captions selector per WebVTT source.

**Rendition Group Id**  
Specify which captions group you want by providing a group id. The group id corresponds to EXT-X-MEDIA, GROUP-ID tag in your HLS manifest. For example, if your HLS manifest file lists your French captions in a specific group "subs", set **Rendition Group ID** to **subs** to specify the French captions group id.

**Rendition Name**  
Specify which captions group you want by providing a rendition name. The rendition name corresponds to EXT-X-MEDIA, NAME tag in your HLS manifest. For example, if your HLS manifest file lists your French captions in a rendition name called "French", set **Rendition Name** to **French** to specify the French captions rendition name.

**Rendition Language Code**  
Specify which captions group you want by providing an ISO 639-3 language code. The language corresponds to EXT-X-MEDIA, LANGUAGE tag in your HLS manifest. For example, if your HLS manifest file lists your French captions in a language code of "FRA", set **Rendition Language Code** to **FRA** to specify the French captions rendition language code.

**In your JSON job specification**  
If you use the API or an SDK, you can find these settings in the JSON file of your job. These settings are under `Inputs`, as in the following example:

```
"Inputs": [

 
      {
        ...
        		
"CaptionSelectors": {
  "Caption Selector 1": {
    "SourceSettings": {
      "SourceType": "WebVTT",
      "WebvttHlsSourceSettings": {
        "RenditionGroupId": "subs",
        "RenditionName": "French",
        "RenditionLanguageCode": "FRA"
      }
    }
  }
}
          ...
```