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
| ||||||||||||||||||||||
"Status": "STRING" | Current recording 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:
| ||||||||||||||||||||||
} | |||||||||||||||||||||||
} |
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.
Device HTTP API, v1.0
Copyright (c) 2016.