Convert captions files between formats.
<?xml version="1.0"?>
<query>
<userid>[UserID]</userid> <!-- required-->
<userkey>[UserKey]</userkey> <!-- required-->
<action>AddMedia</action> <!-- required-->
<source>[ClosedCaptionsSourceFile]</source> <!-- required-->
<format>
<output>closed_captions</output> <!-- required-->
<destination>[DestinationURL]</destination> <!-- required-->
<type>[srt|scc|webvtt|dfxp|ttml|mcc|stl]</type>
<strip_formatting>[yes|no]</strip_formatting>
<time_offset>[TIME_OFFSET]</time_offset>
<cea_data_field>[0|1]</cea_data_field>
<transparent_background>[yes|no]</transparent_background>
<cea_stream>[video|text|auto]</cea_stream>
<teletext_page_id>[PageID]</teletext_page_id>
<ttml_profile>[TTMLProfile]</ttml_profile>
<make_preconvert>[no|scc]</make_preconvert>
<emulate_rollup>[yes|no]</emulate_rollup>
<charset>[utf8|cp1252]</charset>
<stl_dsc>[0|1|2]</stl_dsc>
</format>
</query>
{
"query": {
"userid": "[UserID]", // required
"userkey": "[UserKey]", // required
"action": "AddMedia", // required
"source": ["[ClosedCaptionsSourceFile]"], // required
"format": {
"output": "closed_captions", // required
"destination": "[DestinationURL]", // required
"type": "[srt|scc|webvtt|dfxp|ttml|mcc|stl]",
"strip_formatting": "[yes|no]",
"time_offset": "[TIME_OFFSET]",
"cea_data_field": "[0|1]",
"transparent_background": "[yes|no]",
"cea_stream": "[video|text|auto]",
"teletext_page_id": "[PageID]",
"ttml_profile": "[TTMLProfile]",
"make_preconvert": "[no|scc]",
"emulate_rollup": "[yes|no]",
"charset": "[utf8|cp1252]",
"stl_dsc": "[0|1|2]"
}
}
}
Parameter | Description | Allowed Values | Default Value |
---|---|---|---|
source | Specify the URL to Closed Captions file or video with muxed closed captions. | Valid URL to Closed Captions file (in one of the following formats: SCC, SubRip, DFXP (TTML), SAMI, WebvTT, PAC, STL) or video with muxed closed captions (in cea-6/708 or timed-text format). | none |
type | Convert closed captions to specified type | srt, scc, webvtt, dfxp, ttml, mcc, stl | srt |
strip_formatting | Remove all formatting tags (available only for TTML (DFXP) output and TTML to WebVTT conversion). | yes, no | no |
time_offset | Specify the time offset for time in CC file. | Positive or negative integer. | 0 |
cea_data_field | CEA-608 data field id (data type) to be extracted from cea-608 CC data. | 0 – NTSCCC_FIELD_1 _1 – NTSC_CC_FIELD_2 | 0 |
transparent_background | Add transparent background for DFXP Closed Captions | yes, no | no |
cea_stream | Stream type for closed captions extraction | video, text, auto | auto |
teletext_page_id | Teletext page id to copy or extract | Non-negative integer number | none |
ttml_profile | TTML profile | basic, smpte_st2052, smpte_ismc1, smpte_ismc1_1, smpte_itt | basic |
make_preconvert | Perform a pre-conversion of the source file to another format. For example, you may pre-convert TTML to SCC before converting to MCC to remove paint-on emulation in the original source file. | no, scc | no |
emulate_rollup | Perform RollUp emulation when converting an SCC file to other formats | yes, no | yes |
charset | Specify character set for SRT output | utf8, cp1252 | none |
stl_dsc | Output STL Display Standard Code 0 — Open Subtitling 1 — Level 1 Teletext 2 — Level 2 Teletext | 0, 1, 2 | 1 |
For transparent_background
The <transparent_background /> parameter applied only if set to dfxp.
For ttml_profile
The <ttml_profile /> parameter applied only if set to ttml.
For type=mcc
If multiple source files (up to 4) are specified in the source array, these files will be merged into a single MCC file.
For type=scc
If 2 source files are specified in the source array, these files will be merged into a single SCC file, sources will be mapped to CC1 and CC2 channels respectively.