getVideoEncoding.lua
[INDEX]

ABSTRACT

Get video H.264 encoding parameters and/or status of specified stream (main stream/sub stream)

ARGUMENTS

HTTP Arguments submit: GET; POST

Test this API over HTTP - (URL):

Stream
(MUST)

Stream:

main

Main stream

sub

Sub stream

Test value:

Config
INTEGER

Optional.

1

Need to get encoding configurations.

0

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

Test value:

Status
INTEGER

Optional.

1

([Default], if not specified) Need to get encoding status.

0

Not return encoding 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

"SnapUrl":
"STRING"

http://...

HTTP URL for getting previewing video image (Note: essentially, no matter which stream, SnapUrl will get the same content, because there only one Motion-JPEG encoding service)

"Config": {
/*OBJECT*/

Current encoding configurations (If specified Config=1 among ARGUMENTS, it returns)

"Scaling":
"STRING"

Encoding image size

default

No scaling, for main stream, image size is same as input video size;

for sub stream, default size is 720x576.

(w)x(h)

(w) is the width, (h) is the height (e.g. 1280x720): Specified image scaling size for encoding.

"Chrome":
INTEGER

0|1, 0 means color, 1 means gray.

"Codec":
"STRING"

H264|H265, video codec algorithm (only for H264 now)

"Profile":
"STRING"

base|main|high, H.264 Codec profile

"BRCtrl":
"STRING"

cbr|vbr, Bitrate controlling, 'cbr' or 'vbr'.

"Bitrate":
INTEGER

Encoding (want) bitrate, in bps. Like 1000000 is 1Mbps.

"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)

"GOPSize":
INTEGER

H.264 GOP size (determine I frame interval), frame number as unit.

"RefFrame":
INTEGER

1|2, reference frame, 1 means unique reference frame, 2 means multiple reference frames.

"BindAudioChannel":
INTEGER

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

}
"Status": {
/*OBJECT*/

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

"Codec":
"STRING"

H264|H265, Current Codec

"Profile":
"STRING"

base|main|high, Current H.264 profile

"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