IP Camera CGI Application Guide
Index
ip camera cgi Introduction ....................................................................................................... 3 check_user.cgi ............................................................................................................................... 4 snapshot.cgi ...................................................................................................................................... 4 videostream.cgi ............................................................................................................................... 5 videostream.asf ............................................................................................................................... 5 get_status.cgi ..................................................................................................................................... 5 get_camera_params.cgi ..................................................................................................................... 7 decoder_control.cgi ........................................................................................................................... 7 camera_control.cgi ............................................................................................................................ 8 reboot.cgi .......................................................................................................................................... 8 restore_factory.cgi............................................................................................................................. 8 get_params.cgi .................................................................................................................................. 9 upgrade_firmware.cgi ..................................................................................................................... 11 upgrade_htmls.cgi ........................................................................................................................... 11 set_alias.cgi ..................................................................................................................................... 12 set_datetime.cgi .............................................................................................................................. 12 set_users.cgi .................................................................................................................................... 12 set_network.cgi ............................................................................................................................... 13 set_wifi.cgi ...................................................................................................................................... 13 set_pppoe.cgi .................................................................................................................................. 14 set_upnp.cgi .................................................................................................................................... 14 set_ddns.cgi ..................................................................................................................................... 14 set_ftp.cgi ........................................................................................................................................ 15 set_mail.cgi ..................................................................................................................................... 15 set_alarm.cgi ................................................................................................................................... 16 set_forbidden.cgi ............................................................................................................................. 17 get_forbidden.cgi ............................................................................................................................ 18 set_misc.cgi ..................................................................................................................................... 18 get_misc.cgi .................................................................................................................................... 19 wifi_scan.cgi ................................................................................................................................... 19 get_wifi_scan_result.cgi ................................................................................................................. 19 get_log.cgi ....................................................................................................................................... 20 test_mail.cgi .................................................................................................................................... 21 test_ftp.cgi ....................................................................................................................................... 21 backup_params.cgi .......................................................................................................................... 22 restore_params.cgi .......................................................................................................................... 22 set_mac.cgi ...................................................................................................................................... 22
ip camera cgi Introduction
The CGI listed here is an ip camera interface based on http protocol. The client application (it could be the web browser page or other applications) can be programmed by this CGI.
? Cgi security certificate:All the CGI listed below need security certificate when it is visited.
Besides, different CGI interface requires different authority, there are 3 classes: guest, operator, and administrator. And the authority is controlled by the user set on the device.
The specific safety certification mechanism supports 2 ways: http protocol basic one and add the username and password into the CGI parameter.
? The method to visit CGI: among all the http methods, the CGI only supports get and post.
And upgrade_firmware.cgi and upgrade_htmls.cgi only support post, and other CGI just supports get method.
Get example:
Post example
? Cgi return:according to the different return information, the CGI listed could be divided
into below 2 category:
? Get the status and parameter, including get_status.cgi and get_params.cgi. Their return
includes the text of device status or parameter, the specific format is similar to variable definitions of javascript, every status and parameter are defined as a Variable and return,
for example:
var id=’003456789A0A’; var sys_ver=’0.0.1.2’; var app_ver=’0.0.1.3’; var alias=”;
var now=1195552193; var tz=0;
var ntp_enable=1;
var ntp_svr=’time.nist.gov’;
? Set device parameter or operate it: The CGI will return the text including operation
result, for example if succeeded, and then return “ok”, if failed, and then return the error information, for example: “error: illegal param”. If you don’t need only the simple “ok” text, you could add a parameter into the CGI parameter string: next_url. The operation
is succeeded and then jump to next document. Note it must be the relative path.
check_user.cgi
Description:get the current user check result
Authority:guest
Syntax:/check_user.cgi[?user=&pwd=] Return:
user:present user pwd:present password pri:present authority
1:guest 2:operator 3:adminstrator
snapshot.cgi
Description:get the real time picture Authority:guest
Syntax:/snapshot.cgi[?user=&pwd=&next_url=] Parameter:
next_url:Picture document name Instruction:
0
If there is no next_url parameter,return picture document name is: device id(device
alias)_present time.jpg,otherwise the document name is: next_url defined document
name.
videostream.cgi
Description:ipcamera sends the jpeg video stream by server push mode
Authority:guest
Syntax:/videostream.cgi[?user=&pwd=&resolution=] Parameter: resolution:(8:320*240,32:640*480)
videostream.asf
Description:ipcamera send asf video stream data,only support vlc player and
mplayer Authority:guest
Syntax:/videostream.asf[?user=&pwd=&resolution=] Parameter: resolution:(8:320*240,32:640*480)
get_status.cgi
Description:get status Authority:N/A
Syntax:/get_status.cgi Return:
id:device id
sys_ver:firmware version app_ver:web page version alias:
now:the seconds it goes from 1970-1-1 0:0:0
tz:current time area setting and the different second from standard GMT alarm_status:alarm status,0:no alarm;1:Motion detection alarm;2:input alarm ddns_status:DDNS status
0 1 2 3 Non operation Connecting Server Connection error Dyndns succeeded