getRecordingStatus.lua
[INDEX]

ABSTRACT

Get current recording status

ARGUMENTS

HTTP Arguments submit: GET; POST

Test this API over HTTP - (URL):

Stream
(MUST)

Specify the stream to get recording status:

main

Main stream

sub

Sub stream

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

"Status":
"STRING"

Current recording status

started

Recording is started [NOTE: The follow fields are only avaliable when Status is 'started']

idle

No recording

error

recording error (unknown reason)

error.start.nodisk

No valid disk

error.start.nospace

Insufficient space (while starting record)

error.recording.nospace

Insufficient space (while recording, so forced stop the recording)

error.start.not-start

Stream is not enabled

error.start.not-exist

Stream is not exist

error.start.no-source

No media source

error.start.start-fail

Start recording fail

error.status-error.update-record

Error while updating record status

"RecordDevice":
"STRING"

Recording to which device (The device identifier, Refer to getDisks.lua)

"SequenceID":
"STRING"

Current recording sequence ID.

Each time start a recording, it creates a new sequence, so this is the unique ID of the sequence. Because the recording may separate into multiple files, so a sequence can contain one or more files.
"RecordPath":
"STRING"

Recording path. This path is mapped to a HTTP accessable directory. (Please see the notes)

"Files": [
/*ARRAY*/

An array to contain all files info in current sequence. Each item is:

{
/*OBJECT*/

"Filename":
"STRING"

File name

"Size":
INTEGER

File size in KB

}
]
"CurrentFilename":
"STRING"

Current recording file name

"CurrentSize":
INTEGER

Current file size in KB

"CurrentDuration":
INTEGER

Current recording file duration in seconds

"CurrentStartTime":
"STRING"

The start record time of current file, the format is "yyyy-mm-dd hh:nn:ss"

"TotalSize":
INTEGER

The total size of current sequence, in KB

"TotalDuration":
INTEGER

The total duration of current sequence, in seconds

"StartTime":
"STRING"

The start record time of current sequence, the format is "yyyy-mm-dd hh:nn:ss"

"Format":
"STRING"

File format:

ts

TS

mp4

MP4 (Unsupport for current version)

}
}

NOTES

The full path of a recording file is "RecordPath/Filename". e.g. RecordPath = /media/usb/sda1/RECORD/M-20170611-150311-0001 and file name is REC00000001.ts, so the full path is "/media/usb/sda1/RECORD/M-20170611-150311-0001/REC00000001.ts", this is HTTP accessable, you can get (download) it by this path.

OTHER NOTES

KILOVIEW Device HTTP API, v1.0