18 August 2016

Main/alternate source language settings for advanced_hls output

<?xml version="1.0"?>
<query>
    <userid><<id>></userid> <!-- required-->
    <userkey><<key>></userkey> <!-- required-->
    <action>[MediaAction]</action> <!-- required-->
    <format>
        <output>advanced_hls</output>
        <main_source>
            <language>[Language]</language>
        </main_source>
        <alternate_source>
            <language>[Language]</language>
        </alternate_source>
    </format>
</query>
{
    "query": {
        "userid": "<<id>>",
        "userkey": "<<key>>",
        "action": "[MediaAction]",
        "format": {
            "output": "advanced_hls",
            "main_source": {
                "language": "[Language]"
            },
            "alternate_source": {
                "language": "[Language]"
            }
        }
    }
}
Option NameDescriptionAllowed ValuesDefault Values
Main source params
LanguageMain source Language attribute.Valid language name 
Alternate source params
LanguageAlternate source Language attribute.Valid language name 

❗️

Note

This article acceptable only for Reserved Instances users!

To force failover media processing to Encoding.com Instances you can set high in the section.

<?xml version="1.0"?>
<query>
    <userid><<id>></userid> <!-- required-->
    <userkey><<key>></userkey> <!-- required-->
    <action>[MediaAction]</action> <!-- required-->
    <priority>high</priority>
</query>
{
    "query": {
        "userid": "<<id>>",
        "userkey": "<<key>>",
        "action": "[MediaAction]",
        "priority": "high"
    }
}

To force encoder process multiple source segments in parallel, add <multijob_workflow>yes</multijob_workflow> to the . By default media would be processed as standard multisource media. Also you can set specific part of source as program segment by setting start and end params in source URL. E.g. http://[SourcePath]/[SourceFile]?start=[SegmentStartSecond]&end=[SegmentEndSecond]

<?xml version="1.0"?>
<query>
    <userid><<id>></userid> <!-- required-->
    <userkey><<key>></userkey> <!-- required-->
    <action>[Action]</action> <!-- required-->
    <source>[SourceSegment][SegmentDuration]</source>
    <!-- Multiple source segments -->
    <source>[SourceSegment][SegmentDuration]</source>
    <multijob_workflow>[yes|no]</multijob_workflow>
    <format>
        <output>advanced_hls</output> <!-- required-->
    </format>
</query>
{
    "query": {
        "userid": "<<id>>",
        "userkey": "<<key>>",
        "action": "[Action]",
        "source": [
            "[SourceSegment][SegmentDuration]",
            "[SourceSegment][SegmentDuration]"
        ],
        "multijob_workflow": "[yes|no]",
        "format": {
            "output": "advanced_hls"
        }
    }
}

Constant framerate for H.264 codec

<?xml version="1.0"?>
<query>
    <userid><<id>></userid> <!-- required-->
    <userkey><<key>></userkey> <!-- required-->
    <action>[Action]</action> <!-- required-->
    <format>
        <output>[Output]</output> <!-- required-->
        <video_codec_parameters>
            <force-cfr>[yes|no]</force-cfr>
        </video_codec_parameters>
    </format>
</query>
{
    "query": {
        "userid": "<<id>>",
        "userkey": "<<key>>",
        "action": "[Action]",
        "format": {
            "output": "[Output]",
            "video_codec_parameters": {
                "force-cfr": "[yes|no]"
            }
        }
    }
}
Option NameDescriptionAllowed ValuesDefault Values
force-cfrForce keep constant framerateyes,nono

Encryption method and encryption initialization vector for advanced_hls output

<?xml version="1.0"?>
<query>
    <userid><<id>></userid> <!-- required-->
    <userkey><<key>></userkey> <!-- required-->
    <action>[Action]</action> <!-- required-->
    <format>
        <output>advanced_hls</output>
        <encryption_method>[aes-128-cbc|sample-aes]</encryption_method>
        <encryption_iv>[Hexidecimal string]</encryption_iv>
    </format>
</query>
{
    "query": {
        "userid": "<<id>>",
        "userkey": "<<key>>",
        "action": "[Action]",
        "format": {
            "output": "advanced_hls",
            "encryption_method": "[aes-128-cbc|sample-aes]",
            "encryption_iv": "[Hexidecimal string]"
        }
    }
}
Field NameDescriptionAllowed ValuesDefault Values
Format params
encryption_methodEncryption methodaes-128-cbc, sample-aesaes-128-cbc
encryption_ivEncryption initialization vector32 hexidecimal characters ([0-9a-f])aes-128-cbc - sequence number of the segment file,
sample-aes - randomly generated value

Manifest settings for advanced_hls output

<?xml version="1.0"?>
<query>
    <userid><<id>></userid> <!-- required-->
    <userkey><<key>></userkey> <!-- required-->
    <action>[Action]</action> <!-- required-->
    <format>
        <output>advanced_hls</output>
        <stream>
        <!-- Stream params -->
            <!-- Manifests fields -->
            <manifest>
                <basename>[BaseName]</basename> <!-- required-->
                <add_to_manifest>[ManifestName]:[Position],[ManifestName]:[Position]</add_to_manifest>
                <destination>[ManifestDestination]</destination>
            </manifest>
            <!-- Multiple manifests may be included -->
            <manifest>
               <!-- manifes tparams -->
            </manifest>
        </stream>
        <!-- Manifests fields -->
        <manifest>
            <basename>[BaseName]</basename> <!-- required-->
            <destination>[ManifestDestination]</destination>
            <add_audio_only>[yes|no]</add_audio_only>
        </manifest>
        <!-- Multiple manifests may be included -->
        <manifest>
           <!-- manifest params -->
        </manifest>
    </format>
</query>
{
    "query": {
        "userid": "<<id>>",
        "userkey": "<<key>>",
        "action": "[Action]",
        "format": {
            "output": "advanced_hls",
            "stream": {
                "manifest": [
                    {
                        "basename": "[BaseName]",
                        "add_to_manifest": "[ManifestName]:[Position],[ManifestName]:[Position]",
                        "destination": "[ManifestDestination]"
                    },
                    "  "
                ]
            },
            "manifest": [
                {
                    "basename": "[BaseName]",
                    "destination": "[ManifestDestination]",
                    "add_audio_only": "[yes|no]"
                },
                "  "
            ]
        }
    }
}
Field NameDescriptionAllowed ValuesDefault Values
Main manifests params
basenameMain manifest basenameString
destinationMain manifest destinationValid destination URL
add_audio_onlyAdd audio only stream to this manifestyes, noyes
Stream manifests params
basenameStream manifest basenameString
add_to_manifestAdd to one or several specified main manifestsComma sepparated list of manifests. Optionally manifest's position could be specified as [ManifestName]:[Position]
destinationStream manifest destinationValid destination URL

Direct copy for closed captions:

<?xml version="1.0"?>
<query>
    <userid><<id>></userid> <!-- required-->
    <userkey><<key>></userkey> <!-- required-->
    <action>[Action]</action> <!-- required-->
    <format>
        <!-- Format fields -->
        <closed_captions>
            <direct_copy>[yes|no]</direct_copy>
        </closed_captions>
    </format>
</query>
{
    "query": {
        "userid": "<<id>>",
        "userkey": "<<key>>",
        "action": "[Action]",
        "format": {
            "closed_captions": {
                "direct_copy": "[yes|no]"
            }
        }
    }
}
Field NameDescriptionAllowed ValuesDefault Values
direct_copyIf video has Closed Captions data stored in cea-608/cea-708 tracks, system will directly copy closed captions to the output.yes, nono

Added 3 new requests:

ActionDescription
GetQueueTimeGet current queue statistics.
GetQueueStatsGet queue statistics for selected date range.
SetHostKeyAdd SSH RSA key for host, that could be used as destination for your media.

SetHostKey

This request sets private SSH RSA key for specified host, that could be used as media destination.

Request:

<?xml version="1.0"?>
<query>
    <userid><<id>></userid> <!-- required-->
    <userkey><<key>></userkey> <!-- required-->
      <action_user_id>[ActionUserID]</action_user_id>
    <action>SetHostKey</action>
    <hostname>[HostName]</hostname>
    <username>[UserName]</username>
    <key_data>
<![CDATA[
-----BEGIN RSA PRIVATE KEY-----
<!--RSA Key Data-->
-----END RSA PRIVATE KEY-----
]]>
    </key_data>
</query>
{
    "query": {
        "userid": "<<id>>",
        "userkey": "<<key>>",
        "action_user_id": "[ActionUserID]",
        "action": "SetHostKey",
        "hostname": "[HostName]",
        "username": "[UserName]",
        "key_data": "-----BEGIN RSA PRIVATE KEY----------END RSA PRIVATE KEY-----"
    }
}
Field NameDescriptionAllowed ValuesDefault Values
hostnameHost nameValid hostname
usernameAuth user nameValid username
key_dataRSA keyValid RSA key

Response:

<?xml version="1.0"?>
<response>
    <action>sethostkey</action>
    <status>Success</status>
</response>
{
    "response": {
        "action": "sethostkey",
        "status": "Success"
    }
}

GetQueueTime

This request returns queue statistics for currently processing medias

Request:

<?xml version="1.0"?>
<query>
    <userid><<id>></userid> <!-- required-->
    <userkey><<key>></userkey> <!-- required-->
    <action>GetQueueTime</action>
    <mediaid>[MediaID]</mediaid> <!-- Optional -->
</query>
{
    "query": {
        "userid": "<<id>>",
        "userkey": "<<key>>",
        "action": "GetQueueTime",
        "mediaid": "[MediaID]"
    }
}
Field NameDescriptionAllowed ValuesDefault Values
mediaidMedia IDs lsitComma separated list

Response:

🚧

Note

If there are no medias that waiting for download or encode then request will respond with error 'The queue is empty!'

  • If not specified, all medias in queue will be returned
  • and
  • * 'download' – media sources are waiting for download * 'encode' – media sources downloaded, media tasks are waiting for encode
  • – 'yes' if processing limit exceeded
<?xml version="1.0"?>
<response>
    <average>[Average Queue Time]</average>
    <averageSeconds>[Average Queue Time in seconds]</averageSeconds>
    <media>
        <id>[Media ID]</id>
        <average>[Average Media Queue Time]</average>
        <averageSeconds>[Average Media Queue Time in seconds]</averageSeconds>
        <job>
            <id>[Task IDs]</id>
            <type>[Download|Encode]</type>
            <status>[Task Status]</status>
            <format>[Task Format]</format>
            <overlimit>[yes|no]</overlimit>
            <time>[Task Queue Time]</time>
            <timeSeconds>[Task Queue Time in seconds]</timeSeconds>
        </job>
    </media>
    <media>
        <!-- Media list -->
    </media>
</response>
{
    "response": {
        "average": "[Average Queue Time]",
        "averageseconds": "[Average Queue Time in seconds]",
        "media": [
            {
                "id": "[Media ID]",
                "average": "[Average Media Queue Time]",
                "averageseconds": "[Average Media Queue Time in seconds]",
                "job": {
                    "id": "[Task IDs]",
                    "type": "[Download|Encode]",
                    "status": "[Task Status]",
                    "format": "[Task Format]",
                    "overlimit": "[yes|no]",
                    "time": "[Task Queue Time]",
                    "timeseconds": "[Task Queue Time in seconds]"
                }
            }
        ]
    }
}

GetQueueStats

This request returns queue statistics for selected date range.

Request:

<?xml version="1.0"?>
<query>
    <userid><<id>></userid> <!-- required-->
    <userkey><<key>></userkey> <!-- required-->
    <action>GetQueueStats</action>
    <mediaid>[MediaID]</mediaid> <!-- Optional -->
    <date_from>[YYYY-MM-DD HH:MM:SS]</date_from> <!-- Optional -->
    <date_to>[YYYY-MM-DD HH:MM:SS]</date_to> <!-- Optional -->
</query>
{
    "query": {
        "userid": "<<id>>",
        "userkey": "<<key>>",
        "action": "GetQueueStats",
        "mediaid": "[MediaID]",
        "date_from": "[YYYY-MM-DD HH:MM:SS]",
        "date_to": "[YYYY-MM-DD HH:MM:SS]"
    }
}
Field NameDescriptionAllowed ValuesDefault Values
mediaidMedia IDs lsitComma separated list
date_fromDate Range start dateValid date in format 'YYYY-MM-DD HH:MM:SS'One month before <date_to>
date_toDate Range end dateValid date in format 'YYYY-MM-DD HH:MM:SS'Now

Response:

  1. If specified:
<?xml version="1.0"?>
<response>     
    <date_from>[Date Range Start]</date_from>
    <date_to>[Date Range End]</date_to>     
    <media>
        <id>[MediaID]</id>
        <average>[Average Queue Time]</average>
        <averageSeconds>[Average Queue Time in seconds]</averageSeconds>
    </media>
    <media>
        <!-- Media list -->
    </media>
</response>
{
    "response": {
        "date_from": "[Date Range Start]",
        "date_to": "[Date Range End]",
        "media": [
            {
                "id": "[MediaID]",
                "average": "[Average Queue Time]",
                "averageseconds": "[Average Queue Time in seconds]"
            }
        ]
    }
}
  1. If not specified:
<?xml version="1.0"?>
<response>
    <date_from>[Date Range Start]</date_from>
    <date_to>[Date Range End]</date_to>     
    <media>         
        <id>[MediaIDs comma separated list]</id>
        <average>[Average Queue Time]</average>
        <averageSeconds>[Average Queue Time in seconds]</averageSeconds>
    </media>
</response>
{
    "response": {
        "date_from": "[Date Range Start]",
        "date_to": "[Date Range End]",
        "media": {
            "id": "[MediaIDs comma separated list]",
            "average": "[Average Queue Time]",
            "averageseconds": "[Average Queue Time in seconds]"
        }
    }
}