getJPEGStreaming.lua
[INDEX]

ABSTRACT

Get current Motion-JPEG encoding/streaming parameters and/or status

Motion-JPEG encoding/streaming in all KILOVIEW encoder products is defaultly open, assisted to snap photography for preview. But Motion-JPEG can be configured to different modes, like only used for preview (image is small, frame-rate is 5fps) or same as main stream or same as sub stream for different applications.

ARGUMENTS

HTTP Arguments submit: GET; POST

Test this API over HTTP - (URL):

Config

Optional.

1

Need to get Motion-JPEG encoding configurations (See the 'Config' in RETURNS)

0

([Default], if not specified) Not return the configurations

Test value:

Status

Optional.

1

Need to get Motion-JPEG instant status (See the 'Status' in RETURNS)

0

([Default], if not specified) Not return the 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*/

"Type":
"STRING"

Currrent Motion-JPEG configuration mode:

preview

Only for preview (size should be 720x405, 5fps)

main

The image size is same as main H.264 stream (and frame rate is configurable)

sub

The image size is same as sub H.264 stream (and frame rate is configurable)

"SnapUrl":
"STRING"

http://...,

The preview image HTTP URL

"Config": {
/*OBJECT*/

Current Motion-JPEG encoding configuration parameters (If specify Config=1 among ARGUMENTS, it returns)

"Quality":
INTEGER

1-99, JPEG image quality (higher value means higher quality)

"Chrome":
INTEGER

0|1, 0 means color, 1 means gray

"FrameRateMode":
"STRING"

Frame rate mode

default

Full frame rate, that is, encoding frame rate is same as the input video frame rate

half

Half frame rate, that is, encoding frame rate is half of input video frame rate if input frame rate is >= 50

custom

Manually set frame rate

"FrameRate":
NUMBER

Manually set frame rate (If the 'FrameRateMode' is 'full'/'half', don't set this)

"BindAudioChannel":
INTEGER

Bound audio encoding engine channel number, -1 means no audio channel bound.

}
"Status": {
/*OBJECT*/

Current instant encoding status information (If specify Status=1 among ARGUMENTS, it returns)

"BindAudioChannel":
INTEGER

Bound audio encoding engine channel number, -1 means no audio channel bound. (It's same as 'BindAudioChannel' in 'Config')

"Width":
INTEGER

Actual encoding video width

"Height":
INTEGER

Actual encoding video height

"FrameRate":
NUMBER

Actual video encoding frame rate (fps)

"Bitrate":
INTEGER

Actual video encoding bitrate(Kbps)

}
}
}

NOTES

If you need to get instant audio encoding status, please separately call getAudioEngChannel.lua according to BindAudioChannel in RETURNS.

OTHER NOTES

Device HTTP API, v1.0