Cinegy Capture 21.4 REST API Manual
Reading time ~5 minutes
General Information
-
Capture REST API allows you to use both data types: JSON and XML. The data format sent should be indicated with the appropriate 'Content-Type' HTTP header, while the data format requested should be indicated with an appropriate 'Accept' HTTP header.
-
The base URL to access Capture Engine via REST API has the following format:
http://<engine_host>:<8000+n>/REST
where 'n' is the Capture Engine number [1…9].
POST Methods
Capture Session Start
Name |
Start |
Method |
POST |
URL |
Description
Start the capture session with the pre-loaded template.
Usage
function Start() {
$.ajax({
url: "http://localhost:8001/REST/Start",
type: "POST",
});
}
Capture Session Stop
Name |
Stop |
Method |
POST |
URL |
Description
Stop the current capture session.
Capture Session Split
Name |
Split |
Method |
POST |
URL |
Description
Split the target file(s) and create a new Roll in Cinegy Archive.
Capture Session Configuration
Name |
LoadJob |
Method |
POST |
URL |
|
Message Body |
String: Capture profile XML |
Description
Set up the capture session by passing the job profile as the XML.
Capture Session Configuration by Template ID
Name |
LoadJobById |
Method |
POST |
URL |
|
Message Body |
String: Template ID (GUID) |
Description
Set up the capture session by using the template with the specified ID.
Usage
function LoadTemplate(id) {
$.ajax({
url: "http://localhost:8001/REST/LoadJobById",
type: "POST",
contentType: "application/json",
data: JSON.stringify(id),
});
}
Capture Session Start by Template ID
Name |
StartByJobTemplateId |
Method |
POST |
URL |
|
Message Body |
String: Template ID (GUID) |
Caution
|
If Template ID is not specified in parameters, the StartByJobTemplateId method will use default template, set in Cinegy Capture Control.
|
Description
Start the capture session by using the template with the specified ID.
Capture Session Start by Template ID and Custom Metadata
Name |
StartByJobTemplateIdEx |
Method |
POST |
URL |
|
Message Body |
|
Note
|
All parameters in the CustomMetadata group are optional and may be omitted.
|
Caution
|
If Template ID is not specified in parameters, the StartByJobTemplateIdEx method will use default template, set in Cinegy Capture Control.
|
Description
Start the capture session by using the template with the specified ID and defined custom metadata.
GET Methods
Get Info
Name |
Info |
Method |
GET |
URL |
|
Response |
API version |
Response Example
Response example (application/json)
{
"EngineVersion": "14.1.3252.1495",
"APIVersion": 2,
}
Get Capture Engine Status
Name |
Status |
Method |
GET |
URL |
|
Response |
Engine status as serialized object (CaptureStatus) |
Description
Return the detailed Capture Engine status (see Table 1.1).
Table 1.1: CaptureStatus Type Members
CaptureStatus | Types |
---|---|
ErrorDescription |
String |
HasLicense |
Bool |
JobShortState |
JobShortState (see Table 1.2) |
RtpPreviewsForWS |
Enumerable of RtpPreviewForWS (see Table 1.3) |
JobStatus |
String |
PreviewState |
String |
Status |
String |
Timecode |
String |
TVFormatInfo |
TVFormatInfo (see Table 1.4) |
Table 1.2: JobShortState Type Members
JobShortState | Types |
---|---|
ErrorDescription |
String |
Id |
Guid |
Status |
JobStatusType enum (see Table 1.5) |
DroppedFramesCount |
Uint |
RepairedFramesCount |
Uint |
ProcessedFramesCount |
Uint |
TimecodeBreaksCount |
Uint |
StartTimecode |
String |
CurrentTimecode |
String |
StopTimecode |
String |
CreatedTime |
DateTime |
StartedTime |
Nullable DateTime |
CompletedTime |
Nullable DateTime |
PercentageCompleted |
Uint |
ElapsedDuration |
TimeSpan |
Table 1.3: RtpPreviewForWS Type Members
RtpPreviewForWS | Types |
---|---|
RTPPreviewURL |
String |
MulticastSourceIP |
Bool |
WebSocketPort |
Int |
Table 1.4: TVFormatInfo Type Members
TVFormatInfo | Types |
---|---|
AspectRatio |
Size (see Table 1.6) |
FrameRate |
Double |
Table 1.5: JobStatusType Enum Type Members
Pending |
Ready |
Started |
Completed |
Failed |
Table 1.6: Size Type Members
Measurement | Types |
---|---|
Width |
Int |
Height |
Int |
Usage
function getStatus() {
$.ajax(
{
url: "http://localhost:8001/REST/Status",
type: "GET",
dataType: ‘json’,
contentType: ‘application/json’,
success: onGetStatusSuccess,
cache: false,
});
}
function onGetStatusSuccess(response) {
if(response.responseJSON != null) {
console.log(response.responseJSON.JobShortState);
}
}
Response Example
{
ErrorDescription: ""
HasLicense: true
JobShortState: {
CompletedTime: "/Date(1445488435000)/"
CreatedTime: "/Date(1445499234927)/"
CurrentTimecode: "00:02:10:08"
DroppedFramesCount: 0
ElapsedDuration: "PT0S"
ErrorDescription: "SSCR_ProcessingError"
Id: "0f31487c-c807-4482-a3e7-d6c41e480a56"
PercentageCompleted: 0
ProcessedFramesCount: 2
RepairedFramesCount: 0
StartTimecode: "00:02:10:07"
StartedTime: "/Date(1445488435000)/"
Status: 4
StopTimecode: "00:02:10:09"
TimecodeBreaksCount: 0
}
JobStatus: "Failed"
PreviewState: "Started"
RtpPreviewsForWS: [1]
{
MulticastSourceIP: "192.168.10.107"
RTPPreviewURL: "rtp://239.1.1.182:1234"
WebSocketPort: 10010
}
Status: "Ready"
TVFormatInfo:
{
AspectRatio:
{
height: 9
width: 16
}
FrameRate: 29.97
}
Timecode: "04:10:46:27"
}
Get Capture Engine Preview
Name |
Preview |
Method |
GET |
URL |
|
Response |
Image: Engine real-time feedback preview |
Description
Return the real-time preview from Capture Engine.
Usage
<img id="preview" />
...
function updateImagePreview() {
‘http://localhost:8001/REST/Preview?cacheHack=’ + new Date().getTime();
$(‘#preview’).attr(‘src’, imageSrc);
}
Get Templates List
Name |
JobTemplates |
Method |
GET |
URL |
|
Response |
Capture templates list |
Description
Return the enumerated list of available capture templates as "Id" / "Name" pairs on the server.
Usage
function getTemplates() {
var templates = $.ajax(
{
url: "http://localhost:8001/REST/JobTemplates",
type: "GET",
dataType: ‘json’,
success: onGetJobTemplatesSuccess,
cache: false,
crossDomain: true,
});
return templates;
}
function onGetJobTemplatesSuccess(response) {
if (response.responseJSON != null) {
var templates = response.responseJSON;
console.log(templates);
}
}
Response Example
{
Id: "84dc0061-ff61-466f-8487-cf39928b9162"
Name: "UHD MPEG-2 Long 80Mb"
}
{
Id: "8d421e4f-6621.4-400a-a414-19876b3d9781"
Name: "MP4 4k"
}
{
Id: "87bd3b9d-e0d5-44cd-8ff4-ffc9e779ce58"
Name: "MP4"
}
{
Id: "60f7c410-ae4c-46de-904b-d9674c9a2eb9"
Name: "Stand"
}
{
Id: "c6a691ef-c7e2-4f63-b0dd-67c173972a92"
Name: "XDCAM HD 50"
}
{
Id: "57206284-296a-41d2-afb8-f99f31030226"
Name: "OPAtom"
}
{
Id: "ceadfa16-bd3d-4f5b-bbad-db3918134db6"
Name: "MAM Rushes"
}
{
Id: "81600477-de5f-420c-b87d-b9c5aff21eb9"
Name: "S"
}
{
Id: "0fba421.49-2a00-483c-9fa9-8e71662bf6d1"
Name: "UHD MPEG-2 Long + Mpeg Audio"
}
Get Template Details
Name |
JobTemplate |
Method |
GET |
URL |
|
Response |
Capture template details |
Description
Return the capture template details as an XML text.
Usage
function getTemplate(id) {
var template = $.ajax(
{
url: "http://localhost:8001/REST/JobTemplate?id=" + id,
type: "GET",
dataType: ‘json’,
success: onGetJobTemplateSuccess,
cache: false,
crossDomain: true,
});
return template;
}
function onGetJobTemplateSuccess(response) {
if (response.responseJSON != null) {
var templateContent = response.responseJSON;
console.log(templateContent);
}
}
Response Example
{
<JobConfiguration>
<AudioMapping i:nil="true"/>
<BreakType i:nil="true"/>
<EncodeTasks>
<EncodeTask>
....
</EncodeTask>
</EncodeTasks>
<EncoderWrapperMap>
<MapItem>
<DestinationId>f5d3a090-fdec-407a-b9b2-1f7d1cdc14c1</DestinationId>
<SourceId>896c643e-593a-4785-b76c-bdc698a41d47</SourceId>
</MapItem>
</EncoderWrapperMap>
<FileName i:nil="true"/>
<FilterEncoderMap i:nil="true"/>
<FilterTasks i:nil="true"/>
<Id>383bdabe-a114-4f23-8817-d1e911121.4851</Id>
<Metadata>
....
</Metadata>
<StartType i:nil="true"/>
<StopType i:nil="true"/>
<TimecodeAnalyzer>
<MaxTCInconsistency>3</MaxTCInconsistency>
<MinTCConsistent>2</MinTCConsistent>
</TimecodeAnalyzer>
<WrapTasks>
....
</WrapTasks>
</JobConfiguration>
}
----