Templates
In the Transform service a template accepts one or more media input files and produces one or more output files. When you submit a job you specify a template and a factory. The template determines the inputs you must provide with the job and the factory determines where the outputs are delivered.
Each template has a name and a composition. The composition determines how the video, audio and subtitle streams from the inputs are combined and converted to the output formats.
To create a template go to the Transform dashboard, select the Templates
view and click New Template
.
Give the template a name and choose the type of composition you want to create. There are three starting points to choose from:
Simple
transcoding and repackaging typically from a single input.Sequential
combines multiple input segments e.g. adding a pre-roll to the main content.Layered
combines sequences with overlays than span the entire composition.
In this tutorial you'll create a simple composition with one input and one output.
In the New Template
view you add input and output containers to the composition. Click +Media
to add an input media container (an MXF file for example).
In the Media Input
drawer you configure the settings for this input. Each input in the composition has a unique name. When a job is submitted using this template you'll be prompted to provide a media file for each input name.
For each input you also select the video, audio and subtitle streams that will be used in the composition. Click the +
camera icon in the upper right corner to add a video stream to this input.
Each input stream has a unique name for example V1, V2 etc. The name is used to route the input stream to an output.
For most input containers there is only one video stream so you can leave the Stream Selector
at the default setting.
It's very common for an input to contain multiple audio streams. In this case you can select a specific stream using a track number, PID or language. In this example we use the track number (starting at track 1).
Select the Output
tab to add outputs to the composition. You can add several different types of outputs:
- single file containers
- sidecar subtitle and metadata files
- adaptive bitrate (ABR) packages
Click +Single Container
to add an output.
In the Single Container
drawer you configure the settings for this output. Each output in the composition has a unique name. When a job is submitted using this template you'll provide a media file path for each output name.
Alternatively you can enter the path in the output settings. Output paths allow you to deliver files to a specific folder in the storage bucket. Output paths can include tokens that are replaced for each job, for example the $original$
token will be replaced with the input file name.
See the Path Templates reference for more details.
Select the output Container Type
. In this example we will create an MP4 output file.
Click the +
camera icon in the upper right corner to add a video stream to the output. Select the video Input Stream
that will be routed to this output (Video Stream 1
in this example).
Select a Video Format
for this output and configure the codec properties (resolution, bit rate, etc.). In this example the stream will be transcoded to H.264.
Follow the same steps to add an audio stream to this output. In this example the audio stream will be transcoded to AAC.
Close the drawer and click Save Template
.
Updated about 1 year ago