5.7.1. TaskLastStates¶
Description¶
Current task states (or the latest states for stopped tasks), current PSI and VideoInformation / AudioInformation tables.
Request¶
{ "user_id":(number),
"methods":[{
"method":"TaskLastStates",
"params":{
"project_id":(number),
"task_ids":' id1 | [id1,id2] | "*" '
"metrics": [(string)]}}]}
user_id - an integer value, a user identifier;
project_id - an integer value, a user project identifier;
- task_ids - task identifiers, the field can be specified in one of the following formats:
id1
- an integer value, a task identifier;[id1,id2]
- an array of integer values, task identifiers;"*"
- a string, the “asterisk” symbol, information request for all active tasks of all running probes in the project. - metrics (optional field) - an array of strings, selection of required metrics. If no metrics are specified in the request, all metrics data will be returned in the reply. The detailed task states description is in the Trigger Description table:
ProgramSpecificInformation
- the description of programs (channels) and tables in a stream;VideoInformation
- video streams headers (coding format, resolution, frames per second (FPS), frame size (height-to-weight ratio), etc.);AudioInformation
- audio streams headers (format, number of channels and sample rate);BadSource
- the state when the probe cannot receive data for further analysis.
Reply¶
{"reply":[{
"method":"TaskLastStates",
"result":{
"BadSource":(boolean),
"AudioInformation":{
"PID1":{
"pid":(number),
"Format":(string),
...
}
},
"VideoInformation":{
"PID2":{
"pid":(number),
"Format":(string),
...
}
},
"ProgramSpecificInformation":{
"programs":[
{
"pid":(number),
"number":(number),
"name":(string),
"streams":[
{
"pid":(number),
"type":(number),
"detectedType":(number),
"pcr":(boolean)
}
]
},
],
"tables":[
{
"pid":(number),
"id":[(number)]}]}}}]}
task_id - an integer, a task identifier;
BadSource - a logical type,
true
indicates that the task is in the BadSource state;- AudioInformation - an object, consists of:
pid - an integer, a stream identifier;
Format - a string, an audio stream format:
MPEG Audio
,AAC
,AC-3
,PCM
, an empty string;DecoderProvider - a string, a decoder provider:
Elecard
,FFmpeg
;Version (optional field) - an integer, a MPEG version identifier;
Layer (optional field) - a string, description of the MPEG layer:
Reserved
,3
,2
,1
;Channels - an integer, number of channels;
SampleRate - an integer, a sample rate in kHz;
MuxingMode (optional field) - a string, the AAC format:
LATM
,ADTS
;Profile (optional field) - a string, the AAC profile:
Main
,LC
,SSR
,LTP
,HE-AAC
,HE-AACv2
;ChannelsPositions (optional field) - a string, channel positions;
ModeExtension (optional field) - a string, the type of AC-3 service:
CM (complete main)
,ME (music and effects)
,VI (visually impaired)
,HI (hearing impaired)
,D (dialogue)
,C (commentary)
,E (emergency)
,VO (voice over)
;Endianness (optional field) - a string, the order of bytes for AC-3:
Little
,Big
;- ChannelGrouping (optional field) - a string, the concept of sound grouping originates from the SMPTE ST 2110-30 specification, para. 6.2.2:
Mono
,Dual mono
,Standard stereo
,Matrix stereo
,5.1 Surround
,7.1 Surround
,22.2 Surround
,One SDI audio group
; - ChannelsOrder (optional field) - a string, channel positions in a group:
Mono
,M1, M2
,Left, Right
,Left Total, Right Total
,L, R, C, LFE, Ls, Rs
,L, R, C, LFE, Lss, Rss, Lrs, Rrs
,Order shall be per SMPTE ST 2036-2, Table 1
,1, 2, 3, 4
; Language (optional field) - a string, a two-letter or three-letter language code.
- VideoInformation - an object, consists of:
pid - an integer, a stream identifier;
Format - a string, a video stream format:
AVC
,HEVC
,MPEG-2
,YUV
;DecoderProvider - a string, a decoder provider:
Elecard
,FFmpeg
;Format profile - a string, a format and level of a profile;
Format settings, BVOP (optional field) - a string:
Yes
,No
;Format settings, Matrix (optional field) - a string:
Custom
,Default
;Format settings, CABAC (optional field) - a string:
Yes
,No
;Format settings, ReFrames (optional field) - a string, a number of reference frames;
Width - an integer, an image width;
Height - an integer, an image height;
PAR Width (optional field) - an integer, the aspect ratio width of a pixel;
PAR Height (optional field) - an integer, the aspect ratio height of a pixel;
Start vertical position (optional field) - for transferring partial video frames in a payload, this value specifies the y-axis value of the first line of video frame data (zero based);
Vertical size (optional field) - an integer, a number of video lines in the payload;
Start horizontal position (optional field) - for transferring partial video frames in a payload, this value specifies the x-axis value of the first line of video frame data (zero based);
Horizontal size (optional field) - an integer, a number of pixels per line in the payload;
Alpha Channel (optional field) - a logical type, true indicates the presence of an alpha channel;
Segmented (optional field) - a logical type, if
true
, it indicates PsF. Cannot be set if Scan type value differs from the Interlaced value;- Range (optional field) - a string, coding range:
Narrow
,Full Protect
,Full
; Display aspect ratio - a string, aspect ratio;
Frame rate - a string, a frame rate (
VFR
for variable frame rate);Standard - a string, a standard:
Component
,PAL
,NTSC
,SECAM
,MAC
;Color space - a string, a color space:
RGB
,YUV
;Chroma subsampling - a string, chroma subsampling:
monochrome
,4:2:0
,4:2:2
,4:4:4
, an empty string;Bit depth - a string, bit depth;
Scan type (optional field) - a string, a scan type:
Interlaced
,Progressive
,Variative
,Unknown
;Color primaries (optional field) - a string, indicates the chromaticity coordinates of the source primaries as specified in terms of the CIE 1931:
BT.709
,BT.470 System M
,BT.601 PAL
,BT.601 NTSC
,SMPTE 240M
,Generic film
,BT.2020
, an empty string;Transfer characteristics (optional field) - a string, indicates the reference opto-electronic transfer characteristic function of the source picture:
BT.709
,BT.470 System M
,BT.470 System B, BT.470 System G
,BT.601
,SMPTE 240M
,Linear
,Logarithmic (100:1)
,Logarithmic (316.22777:1)
,IEC 61966-2-4
,BT.1361 extended colour gamut system
,sYCC
,BT.2020
,BT.2020
, an empty string;Matrix coefficients (optional field) - a string, describes the matrix coefficients used in deriving luma and chroma signals:
RGB
,BT.709
,FCC 73.682
,BT.601
,BT.601
,SMPTE 240M
,YCgCo
,BT.2020 non-constant
,BT.2020 constant
, an empty string;- HDR info (optional field) - an object, consists of:
Type - a string, the HDR type:
HDR10
,HLG
,HDR10+
,Dolby Vision
;DV version (optional field) - a string, the Dolby Vision version;
DV profile (optional field) - a string, the Dolby Vision profile;
DV level (optional field) - a string, the Dolby Vision level;
DV flags (optional field) - a string, indicates the presence of base and enhanced layers, Dolby Vision metadata;
DV compatibility (optional field) - a string, indicates cross-compatibility of Dolby Vision layers with other HDR/SDR standards;
Display primaries[0..2] (optional field) - a string, contains (x, y) coordinates of the three primary chrominance components;
White point (optional field) - a string, contains (x, y) coordinates of the white point;
Max display mastering luminance (optional field) - an integer, the nominally maximum luminance of the mastering display in 0.0001 cd/m2;
Min display mastering luminance (optional field) - an integer, the nominally minimum luminance of the mastering display in 0.0001 cd/m2;
MaxCLL (optional field) - an integer, the maximum value of content luminance in cd/m2;
MaxFall (optional field) - an integer, the maximum average value of a frame luminance in cd/m2;
Preferred transfer characteristics (optional field) - an integer, the preferred alternative value of Transfer characteristics.
- ProgramSpecificInformation - an object, Program-specific information (PSI) - the description of programs (channels) and tables in a stream:
- programs - an array of arrays, programs description:
pid - an integer, PID PMT;
number - an integer, a program number;
name - a string, a program name;
- streams - an array of arrays, the description of elementary streams included in a program:
- tables - an array of objects, the description of tables:
pid - an integer, a table PID;
id - an array of integers, table identifiers.
Example¶
#Request of single task states
curl http://172.16.11.111/ctrl_api/v1/json \
-H "Content-Type: application/json" \
--data '{"user_id":4,"methods":[{"method":"TaskLastStates","params":{"project_id":23,"task_ids":[443445],"metrics":["AudioInformation","VideoInformation","BadSource","ProgramSpecificInformation"]}}]}'
{"reply":
[{"method": "TaskLastStates",
"project_id": 23,
"result":
[{"task_id": 443445,
"BadSource": false,
"AudioInformation":
{"1032":
{"pid": 1032,
"Format": "MPEG Audio",
"DecoderProvider": "Elecard",
"Version": 1,
"Layer": "2",
"Channels": 2,
"SampleRate": 48000}},
"VideoInformation":
{"1031":
{"pid": 1031,
"Format": "AVC",
"DecoderProvider": "Elecard",
"Format profile": "Main@L3.0",
"Format settings, CABAC": "Yes",
"Format settings, ReFrames": "4 frames",
"Width": 720,
"Height": 576,
"Display aspect ratio": "16:9",
"Frame rate": "25.000 fps",
"Standard": "Component",
"Color space": "YUV",
"Chroma subsampling": "4:2:0",
"Bit depth": "8 bits",
"Scan type": "Interlaced",
"Color primaries": "5 (BT.601 PAL)",
"Transfer characteristics": "5 (BT.470 System B/G)",
"Matrix coefficients": "5 (BT.601)"}},
"ProgramSpecificInformation":
{"programs":
[{"pid": 1030,
"number": 1030,
"name": "Game_iptv",
"streams":
[{"pid": 1031, "type": 27, "detectedType": 12, "pcr": true},
{"pid": 1032, "type": 3, "detectedType": 2},
{"pid": 1034, "type": 6, "detectedType": 24},
{"pid": 1035, "type": 134, "detectedType": 255}]}],
"tables":[
{"pid": 0, "id": [0]},
{"pid": 16, "id": [64]},
{"pid": 17, "id": [70]},
{"pid": 20, "id": [112, 115]},
{"pid": 1030, "id": [2]}]}}]}]}