26 November 2013
about 11 years ago by Encoding.com Product Team
JSON API
Encoding.com API endpoint now supports requests in JSON format. Response will be in JSON format as well. Also notifications now support JSON result format as well, all you need to do is specify <notify_format>json</notify_format> in format section. And we updated source code blocks in the API documentation for convenience - look for json/xml toggle.
DFXP closed captions output format
You can extract DFXP closed captions from video:
<?xml version="1.0"?>
<query>
<userid><<id>></userid> <!-- required-->
<userkey><<key>></userkey> <!-- required-->
<action>[Action]</action> <!-- required-->
<format>
<!-- Format fields -->
<closed_captions>
<source>[CCSource]</source>
<copy>[yes|no]</copy>
<extract>[srt|scc|**dfxp**]</extract>
<mux_type>[cea-608|timed-text|webvtt]</mux_type>
<language>[LanguageCode]</language>
<time_offset>[TimeOffset]</time_offset>
</closed_captions>
</format>
</query>
{
"query": {
"userid": "<<id>>",
"userkey": "<<key>>",
"action": "[Action]",
"format": {
"closed_captions": {
"source": "[CCSource]",
"copy": "[yes|no]",
"extract": "[srt|scc|**dfxp**]",
"mux_type": "[cea-608|timed-text|webvtt]",
"language": "[LanguageCode]",
"time_offset": "[TimeOffset]"
}
}
}
}
… or convert to DXFP from another closed captions format:
<?xml version="1.0"?>
<query>
<userid><<id>></userid> <!-- required-->
<userkey><<key>></userkey> <!-- required-->
<action>AddMedia</action>
<source>[CLOSED_CAPTIONS_SOURCE]</source>
<format>
<output>closed_captions</output>
<type>[srt|scc|webvtt|**dfxp**]</type>
**<strip_formatting>[yes|no]</strip_formatting>**
<time_offset>[TIME_OFFSET]</time_offset>
</format>
</query>
{
"query": {
"userid": "<<id>>",
"userkey": "<<key>>",
"action": "AddMedia",
"source": "[CLOSED_CAPTIONS_SOURCE]",
"format": {
"_": "****",
"output": "closed_captions",
"type": "[srt|scc|webvtt|**dfxp**]",
"strip_formatting": "[yes|no]",
"time_offset": "[TIME_OFFSET]"
}
}
}
Field Name | Description | Allowed Values | Default Values |
---|---|---|---|
type | Convert closed captions to specified type | srt, scc, webvtt or dfxp | srt |
strip_formatting | Remove all formatting tags (available only for DFXP) | yes, no | no |