26 November 2013

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 NameDescriptionAllowed ValuesDefault Values
typeConvert closed captions to specified typesrt, scc, webvtt or dfxpsrt
strip_formattingRemove all formatting tags (available only for DFXP)yes, nono