Scan API
Start Analyzer
Section titled “Start Analyzer”Request: POST /control/
{ "cmd": "scan-init", "scan": "..."}scan- stream address. Read more about Media Address Format
Response:
{ "scan-init": "ok", "id": "..."}id- identifier of the created analyzer instance
Analyzer will be stopped automatically in 10 seconds. To keep analyzer active for longer, use scan-check API method.
Stop Analyzer
Section titled “Stop Analyzer”Request: POST /control/
{ "cmd": "scan-kill", "id": "..."}id- identifier of the analyzer instance
This method stops analyzer immediately.
Get Information
Section titled “Get Information”Request: POST /control/
{ "cmd": "scan-check", "id": "..."}id- identifier of the analyzer instance
Response:
{ "scan-check": "ok", "scan": [ { "psi": "...", "table_id": N, "pid": N, "version": N, "crc32": N, ... } ]}scan- array with stream information, if no any new information this field will be omitted
Stream information:
psi- Program Stream Information (PSI) packet name. Could be:pat,pmt,cat,nit,sdttable_id- PSI identifierpid- MPEG-TS packet identifierversion- PSI packet versioncrc32- PSI packet checksum
Additional fields depen of the PSI type.
Program Association Table (PAT) is a list of programs. Contains Program Number (PNR) and Packet Identifier (PID) of the associated PMT. Additional fields:
{ "psi": "pat", "table_id": 0, "pid": 0, "tsid": N, "programs": [ { "pnr": N, "pid": N } ]}table_id- always0pid- always0tsid- Transport Stream identifierprograms- list of programs
Program information:
pnr- program numberpid- MPEG-TS packet identifier for PMT
Program Mapping Table (PMT) is a list of program elementary streams: Video, Audio, and other data. Additional fields:
{ "psi": "pmt", "table_id": 2, "pnr": N, "pid": N, "pcr": N, "streams": [ { "pid": N, "type_name": "...", "type_id": N, "descriptors": [ { "type_id": N, "type_name": "...", ... } ] } ]}table_id- always2pid- MPEG-TS packet identifierpnr- Program Numberpcr- MPEG-TS packet identifier for packets with the Program Clock Reference (PCR) timestampsstreams- list of program elementary streams
Elementary Stream information:
pid- MPEG-TS packet identifier for elementary streamtype_name- elementary stream type:VIDEO,AUDIO,SUB,TTX,AIT,DATAtype_id- elementary stream identifierdescriptors- elementary stream descriptors contains additional information