getStreamService.lua
[INDEX]

ABSTRACT

Get media service information of specified stream (main stream/sub stream/motion-JPEG stream)

Media service, means service like RTSP/RTMP/HLS/...

KILOVIEW encoders support multiple media stream services cocurrent, and each one can open/close seperately,also these services can dynamic adding/deleting[ Statement: RTSP service and KMP service are fixed service, can't add/delete].

ARGUMENTS

HTTP Arguments submit: GET; POST

Test this API over HTTP - (URL):

Stream
(MUST)

Stream:

main

Main stream

sub

Sub stream

jpeg

Motion-JPEG stream

Test value:

Config
INTEGER

Optional.

1

Indicate to return stream service configuration parameters.

0

([Default], if not specified) Not return configuration parameters.

Test value:

Status
INTEGER

Optional.

1

([Default], if not specified) Indicate to return stream service status.

0

Not return stream service status.

Test value:

RETURNS

Return a JSON style result. The JSON format is:

{
/*OBJECT*/

"Result":
NUMBER

200 means OK, other error code meanings are similar to HTTP Response.

"Status":
"STRING"

Status message. Responsing result status of API executive, if there errors, it will describe reasons.

"Data": {
/*OBJECT*/

"Stream":
"STRING"

Current stream:

main

Main stream

sub

Sub stream

jpeg

Motion JPEG stream

"Enable":
INTEGER

Enable status of current stream

0

Disabled. If value is 0, then following parameter will not return.

1

Enabled.

"ServiceConfigs": [
/*ARRAY*/

Each item represents one configuration parameters of media service, return only when ARGUMENT Config=1

{
/*OBJECT*/

"ID":
"STRING"

Unique ID for media service. It might be:

Rtsp_server

Kmp_pullingServer

Dynamic_services[0]

Dynamic_services[1]

Dynamic_services[2]

Dynamic_services[3]

Dynamic_services[4]

Dynamic_services[5]

Dynamic_services[6]

Dynamic_services[7]

"Type":
"STRING"

Service type, value may be one of the followings:These service types may add with the extending of functions.

Rtsp_server

RTSP server

Kmp_pullingServer

KILOVIEW Media Protocol pulling service

Rtmp_push

RTMP push service

Rtp_push

RTP push or multicast service

Kmp_push

KILOVIEW Media Protocol push service

Sproxy_push

Specific OEM clients push service, normally please not consider

TS_push

TS/UDP push or multicast service

HLS

HLS(HTTP Live Streaming) service

"Rtsp_server": {
/*OBJECT*/

Configuration parameters for corresponding RTSP service [Return only when Type = 'Rtsp_server']

"port":
INTEGER

RTSP service port, default as 554

"session":
"STRING"

RTSP service SessionID

"ssm":
INTEGER

0|1,whether enable RTSP Multicast service. 1 means enable and 0 means disable.

"multicast_addr":
"STRING"

RTSP multicast address

"multicast_video_port":
INTEGER

multicast video port

"multicast_audio_port":
INTEGER

multicast audio port

"multicast_ttl":
INTEGER

multicast TTL value

}
"Kmp_pullingServer": {
/*OBJECT*/

Configuration parameters for corresponding Kmp_pullingServer [Return only when Type = 'Kmp_pullingServer']

"enabled":
INTEGER

0|1, whether enable KMP pulling service. 0 means disable and 1 means enable.

}
"Rtmp_push": {
"STRING"

Configuration parameters for corresponding Rtmp pushing service [Return only when Type = 'Rtmp_push']

"enabled":
INTEGER

0|1, whether enable RTMP pushing stream. 0 means disable, 1 means enable.

"pubPoint":
"STRING"

RTMP publish point URL

"username":
"STRING"

RTMP authentication username

"password":
"STRING"

RTMP authentication password

"timeout":
INTEGER

RTMP connection timeout (unit: seconds)

"reconnect_interval":
INTEGER

RTMP reconnection interval time after broken (unit: seconds)

}
"Rtp_push": {
"STRING"

Configuration parameters for corresponding Rtp pushing service [Return only when Type = 'Rtp_push']

"enabled":
INTEGER

0|1, whether enable Rtp pushing function. 0 means disable, 1 means enable.

"target_video_IP":
"STRING"

target video push IP or multicast IP

"target_video_port":
INTEGER

target video push port

"target_audio_IP":
"STRING"

target audio push IP or multicast IP

"target_audio_port":
INTEGER

target audio push port

"ttl":
INTEGER

If target IP is a multicast address, then specifying multicast TTL value

}
"Kmp_push": {
"STRING"

Configuration parameter for corresponding Kmp pushing service [Return only when Type = 'Kmp_push']

"enabled":
INTEGER

0|1, whether enable KMP pushing. 0 means disable, 1 means enable.

"pubPoint":
"STRING"

KMP publish point URL

"username":
"STRING"

KMP authentication username

"password":
"STRING"

KMP authentication password

"timeout":
INTEGER

KMP connection timeout (unit: seconds)

"reconnect_interval":
INTEGER

KMP reconnection interval time after broken (unit: seconds)

}
"Sproxy_push": {
"STRING"

Configuration parameters for corresponding Sproxy pushing service [Return only when Type = 'Sproxy_push']

"...":
"STRING"

Special application, parameter not provided yet.

}
"TS_push": {
"STRING"

Configuration parameters for corresponding TS/UDP [Return only when Type = 'TS_push']

"enabled":
INTEGER

0|1, whether enable TS pushing. 0 means disable, 1 means enable.

"address":
"STRING"

push target IP address or multicast IP

"port":
INTEGER

push port

"ttl":
INTEGER

multicast TTL

}
"HLS": {
"STRING"

Configuration parameters for corresponding HLS service [Return only when Type = 'HLS']

"enabled":
INTEGER

0|1, whether enable HLS service. 0 means disable, 1 means enable.

"session":
"STRING"

HLS session ID determines HLS URL path. HLS URL path is http://<ip address>/<session>/playlist.m3u8

"segmentTime":
INTEGER

HLS segment time (approximate value, unit is milliseconds). Actual segment time could use this value for reference, but there deviation due to codec data.

"maxSegments":
INTEGER

Among the playlist of m3u8, maximum segments number simutaneously. According HLS rules, this value must be >=3

}
}
]
"ServiceStatus": [
/*ARRAY*/

Each item represents working status information of each media service

{
/*OBJECT*/

"ID":
"STRING"

The media service Unique ID. Value might be:

Rtsp_server

Kmp_pullingServer

Dynamic_services[0]

Dynamic_services[1]

Dynamic_services[2]

Dynamic_services[3]

Dynamic_services[4]

Dynamic_services[5]

Dynamic_services[6]

Dynamic_services[7]

"Type":
"STRING"

Service type, value might be:

Rtsp_server

RTSP service

Kmp_pullingServer

KILOVIEW Media Protocol pulling service

Rtmp_push

RTMP push service

Rtp_push

RTP push or mulicast service

Kmp_push

KILOVIEW Media Protocol push service

Sproxy_push

Specific OEM client push service, normally please not condsider

TS_push

TS/UDP push or mulicast service

HLS

HLS(HTTP Live Streaming) service

"Enable":
INTEGER

0|1, return the enabling status of current service. 1 means enable, 0 means disable.

"Status":
"STRING"

Working status, indicating realtime status of this media service:

error

Error

offline

Disabled/offline

connecting

Is connecting

online

Online/Enabled

"URL":
"STRING"

The media accessing URL (e.g. rtsp://192.168.1.168/ch01)

}
]
}
}

OTHER NOTES

Device HTTP API, v1.0