CGI

Record CGI

Version / Author / DateModify
1.0/David/2013-03-30First edition

Overview

Users by CGI manual recording of audio and video to set the IP Camera; and through the CGI query, download video files stored on the SD card, and delete operations.

Manual recording

Start_record.cgi

  • Description:
Manual recording, manual recording for some time by the CGI in the IP Camera settings specified location, when it will automatically end manual recording tasks during this period can also be ended prematurely by stop_record.cgi.
  • Permissions requirements:
Video permissions
  • Syntax:
/ Start_record.cgi [? User = & pwd = & session = & json = & jsonp_callback = & length = & result = & task =]
  • Parameters:
User / pwd: Parameter authentication method required to login username / password
session: Session authentication method required to Session ID
json / jsonp_callback: return the json type of data set
length: recording time; Unit: seconds; value :10-900; such as this parameter is not set or set to null, use the default parameters
result / task: set the variable name returned.
  • Returns:
Result: 1: the operation is successful, has to start recording; <= 0: The operation failed
task:> 0: operation successful return task id = 0: The operation failed.
  • Example:
Http://192.168.0.188/start_record.cgi?session=1891048766&length=60&result=ret&task=id user request manual recording 60 seconds
IP Camera Back:
var ret = 1;
var id = 1;

Stop manual recording

Stop_record.cgi

  • Permissions requirements:
Video permissions
  • Syntax:
/ Stop_record.cgi? Task = [& user = & pwd = & session = & json = & jsonp_callback = & next_url =]
  • Parameters:
User / pwd: Parameter authentication method required to login username / password
session: Session authentication method required to Session ID
json / jsonp_callback: return the json type of data set
the task id of the task: the need to stop the manual recording
next_url: return to the page after the successful operation.
  • Returns:
[The text @ operating results or specified page@]
  • Example:
Http://192.168.0.188/stop_record.cgi?session=1891048766&task=1 user request to stop the manual recording task 1

Find meet the conditions on the SD card video files

Search_record.cgi

  • Permissions requirements:
Video permissions
  • Syntax:
/ Search_record.cgi [? User = & pwd = & session = & json = & jsonp_callback = & from = & to = & status = & result = & name = & path = & flag = & start_time = & end_time = & size =]
  • Parameters:
User / pwd: Parameter authentication method required to login username / password
session: Session authentication method required to Session ID
json / jsonp_callback: return the json type of data set
from / to / status: the query video file should meet the conditions.
from: the number of seconds elapsed starting time 1970-1-1 00:00:00 GMT
to: the number of seconds of the termination of the passage of time 1970-1-1 00:00:00 GMT
from and all video files to specify the start time lookup; including from all video files to the termination of the time between the recording should be <= to; these two parameters or set to empty if not set, the query
status: specify query video meets the specified file during recording
0: query all video files
Bit0: video motion detection alarm
Bit1: external alarm video
Bit2: video, sound detection alarm
result / name / path / flag / start_time / end_time / size: set the variable name returned.
  • Returns:
Return js text
result: <0: operation failed,> = 0: Find the video file number
name: array variables, file name
path: array variables, file path
flag: array variables, a sign of the video file
Bit0: video motion detection alarm
Bit1: external alarm video
Bit2: video, sound detection alarm
start_time: array variables, the number of seconds of video file to start recording the passage of time 1970-1-1 00:00:00 GMT
end_time: array variables, the number of seconds elapsed by the end of the video file video time 1970-1-1 00:00:00 GMT
size: an array of variables, the size of the video file, Unit: BYTE
Return json text
result: <0: operation failed,> = 0: Find the video file number
record an array of objects, record objects include:
name, path, flag, start_time, end_time, size
  • Example:
Http://192.168.0.188/search_record.cgi?session=1891048766 query all video files
IP Camera Back:
var result = 3;
var name = new Array ();
var path = new Array ();
var flag = new Array ();
var start_time = new Array ();
var end_time = new Array ();
var size = new Array ();
name [0] = '000000000002_20110709162828_1310200108_59_4. asf ';
path [0] = '/ mnt/sd/000000000002_20110709162828_1310200108_59_4.asf';
flag [0] = 4;
start_time [0] = 1310200108;
end_time [0] = 1310200167;
size [0] = 16770513;
name [1] = '000000000002_20110709160243_1310198563_59_4. asf ';
path [1] = '/ mnt/sd/000000000002_20110709160243_1310198563_59_4.asf';
flag [1] = 4;
start_time [1] = 1310198563;
end_time [1] = 1310198622;
size [1] = 17780177;
name [2] = '000000000002_20110709154733_1310197653_59_0. asf ';
path [2] = '/ mnt/sd/000000000002_20110709154733_1310197653_59_0.asf';
flag [2] = 0;
start_time [2] = 1310197653;
end_time [2] = 1310197712;
size [2] = 16844241;

http://192.168.0.188/search_record.cgi?session=1891048766&status=1 query all video motion detection during video file

Video file @ http://192.168.0.188/search_record.cgi?session=1891048766&from=1310190000&to=1310199999=status=7 query alarm during a specified time period

Delete SD card on the specified video file

Del_record.cgi

  • Permissions requirements:
Video permissions
  • Syntax:
/ Del_record.cgi? Name = [& user = & pwd = & session = & json = & jsonp_callback = & next_url =]
  • Parameters:
User / pwd: Parameter authentication method required to login username / password
session: Session authentication method required to Session ID
json / jsonp_callback: return the json type of data set
name: the name of the video file to be deleted
next_url: return to the page after the successful operation.
  • Returns:
[The text @ operating results or specified page@]
  • Example:
Http://192.168.0.188/del_record.cgi?session=1891048766&name=000000000002_20110709154733_1310197653_59_0.asf
Delete name for 000000000002_20110709154733_1310197653_59_0.asf video file

Download SD card on the specified video file

Get_record.cgi

  • Permissions requirements:
Video permissions
  • Syntax:
/ Get_record.cgi? Path = [& user = & pwd = & session = & name =]
  • Parameters:
User / pwd: Parameter authentication method required to login username / password
session: Session authentication method required to Session ID
path: the path of the video file to be downloaded
name: the name of the preservation of the download video files, such as not set this parameter is set to null, as compared to the original name.
  • Returns:
Video file
  • Example:
Http://192.168.0.188/get_record.cgi?session=1891048766&path=/mnt/sd/000000000002_20110709154733_1310197653_59_0.asf&name=save.asf
Download specify a video file and save the settings name as save.asf
Copyright:Shenzhen XRC Tech Co.,Ltd.

ICP:粤ICP备09050685号