CGI Specification for IP Surveillance Products SIS Division

Transcription

CGI Specification for IP Surveillance Products SIS Division
CGI Specification for IP Surveillance Products
SIS Division
Copyright Notice
© 2008-2010 SAMSUNG TECHWIN CO., LTD. All rights reserved.
SNC-570
1.4.2
SND-560
SND-460V
SNC-550
SNP-1000/1000A
SNP-3300/3300A
SNS-100/400
SNC-1300
SNP-3750/3350
SNP-3370/3370TH
SNP-3301/3301H
3.0.0
Revision History
Date
Revision
Description
03.19.2009
2.0
First Draft
04.27.2009
2.1
Add Preset Function
06.09.2009
2.2
Add Profile Function
10.19.2009
2.3
Add SNC-1300 and SNP-3750/3350 Related Features
11.02.2009
2.4
Fix and add text totally.
11.15.2009
2.5
Fix some incorrect context.
01.06.2010
2.6
Corrected I/O port functions information.
Added <information> tables for audioGet function.
Deleted arguments and values in reboot and factory reset function.
Rearranged video request CGI description table for readability
02.19.2010
2.7
Errata corrected
Deleted model information in VideoGet function.
04.09.2010
2.8
Added SNP-3370/3370TH/3301/3301H Related Features
Added framerate table of SNC-1300
06.23.2010
2.9
Added Hostname Function on DDNS server arguement in 4.1.7 and
4.1.8.
Table of Contents
1. Introduction ................................................................................................. 1
2. Terms and Definitions .................................................................................. 2
2.1. Conventions .................................................................................................................... 2
2.2. Abbreviations .................................................................................................................. 2
3. Interface Specification ................................................................................. 3
3.1. HTTP status codes .......................................................................................................... 3
3.2. Error Codes ..................................................................................................................... 3
4. APIs ............................................................................................................ 4
4.1. Configuration ................................................................................................................... 4
4.1.1. Get Video Configuration........................................................................................ 4
4.1.2. Set Video Configuration ........................................................................................ 6
4.1.3. Get Audio Configuration........................................................................................ 8
4.1.4. Set Audio Configuration ...................................................................................... 10
4.1.5. Get Network Configuration.................................................................................. 11
4.1.6. Set Network Configuration .................................................................................. 13
4.1.7. Get DDNS and Network Port Configuration ........................................................ 15
4.1.8. Set DDNS Configuration ..................................................................................... 17
4.1.9. Get RTP Configuration ........................................................................................ 19
4.1.10. Set RTP Configuration ...................................................................................... 21
4.1.11. Get User Configuration ..................................................................................... 23
4.1.12. Set User Configuration...................................................................................... 26
4.1.13. Get Time Configuration ..................................................................................... 29
4.1.14. Set Time Configuration ..................................................................................... 31
4.1.15. Get MD(Motion Detection) Configuration .......................................................... 36
4.1.16. Set MD(Motion Detection) Configuration .......................................................... 38
4.1.17. Get Profile Configuration................................................................................... 40
4.2. I/O Port .......................................................................................................................... 42
4.2.1. Get Digital in(Sensor) Configuration ................................................................... 42
4.2.2. Set Digital in(Sensor) Configuration ................................................................... 44
4.2.3. Get Digital output(Relay) Configuration .............................................................. 45
4.2.4. Set Digital output(Relay) Configuration .............................................................. 46
4.3. Serial Port...................................................................................................................... 47
4.3.1. Get Serial Port .................................................................................................... 47
4.3.2. Set Serial Port ..................................................................................................... 48
4.4. PTZ................................................................................................................................ 50
4.4.1. Control PTZ Device ............................................................................................. 50
4.5. Logs ............................................................................................................................... 52
4.5.1. System Log ......................................................................................................... 52
4.6. System Reboot .............................................................................................................. 54
4.7. Factory Default .............................................................................................................. 55
4.8. Snapshot ....................................................................................................................... 56
4.9. JPEG Video Request .................................................................................................... 58
4.10. Video Streaming .......................................................................................................... 60
4.10.1. RTSP Commands ............................................................................................. 60
4.10.2. Options .............................................................................................................. 61
4.10.3. Describe ............................................................................................................ 61
4.10.4. Setup ................................................................................................................. 62
4.10.5. Play ................................................................................................................... 63
4.10.6. Pause ................................................................................................................ 64
4.10.7. Teardown .......................................................................................................... 64
4.10.8. Get Parameters ................................................................................................. 65
5. Appendix ................................................................................................... 66
5.1. Appendix A: Available Frame Rates ............................................................................. 66
5.1.1. SNC-1300 ........................................................................................................... 66
5.1.2. SNP-3370/3370TH/3301/3301H ......................................................................... 67
6. References................................................................................................ 68
CGI Specification for IP Surveillance Products
1. Introduction
This document specifies the CGI interface of the SAMSUNG TECHWIN(STW) network cameras.
The interface provides the functionality for serving live multimedia stream, for getting and setting
internal configuration values and for controlling internal devices through the embedded web
server application.
The STW network camera support GET/POST method. If you are using the GET method, you
are limited to a maximum of 255 characters. Supported parameters are product-dependent.
The command parameter must be sent function argument at the beginning.
If you access the CGI interface of STW, you need HTTP DIGEST authentication. You should
install DIGEST authentication on your system.
The Set/Get command must be sent with administrator authorization. Arguments and values are
case-sensitive. If you mistakenly set the same parameter more than once, later setting will take
effect.
SAMSUNG TECHWIN Co., Ltd.
1
CGI Specification for IP Surveillance Products
2. Terms and Definitions
2.1. Conventions
In URL syntax and in descriptions of CGI arguments, text in italics within angle brackets denotes
content that should be replaced with either a value or a string. For example, there is
<servername> in the URL syntax. It has to be replaced by the IP address or the real server
name.
Synopsis
http://<servername>/<cgi>.<ext>?[<argument>=<value>[&<argument>=<value>...]]
Example : Get the information of video channel 1.
http://mycam/public/stw.cgi?function=videoGet&ch=1
Every interface consists of several parts as following. First part describes what dose this
interface do. Second part denotes the synopsis of the interface. Third part lists the detail
information of arguments. At last part, there describes the return value of it.
2.2. Abbreviations

CGI (Common Gateway Interface) : The CGI is a standard protocol for interfacing external
application software with an information server, commonly a web server.

TBD (To Be Documented / To Be Determined)

PTZ (Pan Tilt Zoom) : Camera movements, especially when attached to a tripod or support
SAMSUNG TECHWIN Co., Ltd.
2
CGI Specification for IP Surveillance Products
3. Interface Specification
3.1. HTTP status codes
The embedded Web server returns standard HTTP status code. [RFC 1945],[RFC 2616]
3.2. Error Codes
Shown below are the error codes and messages when set/get commands are issued.
Error Code
Message
Description
1
Parameter not set
In the case of invalid ID or password.
2
Not accessed by administrator
In the case of access violation
3
Error : malformed synopsis
In the case of malformed synopsis :
arguments are not well-formed
4
Invalid name and value parameter
In the case of invalid arguments or values
5
Fail
In the case of failure caused by internal
server error
6
Not encoding JPEG
7
Not access function
8
Invalid function
9
Video request is denied
SAMSUNG TECHWIN Co., Ltd.
3
CGI Specification for IP Surveillance Products
4. APIs
4.1. Configuration
4.1.1. Get Video Configuration
It queries configuration information of the video channel.
Synopsis
http://<servername>/public/stw.cgi?function=videoGet[&<argument>=<value>]
<argument> and <value> are required as following.
Argument
Valid values
Description
ch=<int>
1~999
Video channel number
Note: Default is 1.
Example 1: Get configuration information of the video channel 1.
Example
http://mycam/public/stw.cgi?function=videoGet&ch=1
or
http://mycam/public/stw.cgi?function=videoGet
Return:
Success
HTTP Code: 200 OK
Content-Type: text/plain
Body:
<information>
<information> are product and firmware dependent.
<information> are as follows:
Argument
Valid values
Description
compressionType
jpeg,
Video compression type
=<string>
mpeg
resolution
d1, cif, qcif
Video resolution
=<string>
SAMSUNG TECHWIN Co., Ltd.
4
CGI Specification for IP Surveillance Products
quality=<int>
0, … ,4
Video quality : 0=very high, 4=very low
framerate=<int>
1, 5, 10, 15,
Video frame rate
20, 25(, 30)
For NTSC camera, the maximum frame rate is 30 fps.
For PAL camera, the maximum frame rate is 25 fps.
Failure
HTTP Code: 200 OK
Content-Type: text/plain
Body:
<message>
Refer to 3.2 Error Codes for <message>.
SAMSUNG TECHWIN Co., Ltd.
5
CGI Specification for IP Surveillance Products
4.1.2. Set Video Configuration
It changes the configuration information of video channel.
Synopsis
http://<servername>/public/stw.cgi?function=videoSet[&<argument>=<value>][&<argument>=<v
alue>]...
<argument> and <value> are required as following.
Argument
Valid values
Description
ch=<int>
1~999
Video channel number
Note: Default is 1.
compressionType
jpeg,
Video compression type
=<string>
mpeg
SNC-570,
h264
SND-560,
jpeg, mpeg
SND-460V,
SNC-550,
SNP-1000/1000A,
SNP-3300/3300A,
SNS-100/400,
SNC-1300,
SNP-3750/3350
SNP-3370/3370TH,
jpeg, mpeg, h264
SNP-3301/3301H
resolution
d1,
SNC-570,
=<string>
halfd1,
SND-560,
cif,
SND-460V
qcif,
SNC-550,
4cif,
SNP-1000/1000A,
960p_mega,
SNP-3300/3300A,
960p_4cif,
SNS-100/400
960p_cif,
SNC-1300
720p_mega,
d1, cif, qcif
d1, halfd1, cif
960p_mega, 960p_4cif, 960p_cif,
720p_mega, 720p_4cif, 720p_cif
720p_4cif,
SNP-3750/3350,
720p_cif
SNP-3370/3370TH,
4cif, cif, qcif
SNP-3301/3301H
SAMSUNG TECHWIN Co., Ltd.
6
CGI Specification for IP Surveillance Products
quality=<int>
0, 1, 2, 3, 4
Selects the video quality
0 – very high
1 – high
2 – middle
3.- low
4 – very low
framerate=<int>
1~30
FPS(frame per sec)
NTSC : 1~30 , PAL : 1~25
For SNC-1300 and SNP-3370/3370TH/3301/3301H, valid
framerate range varies dynamically depending on the video
configuration. See 5.1. Appendix A for detailed information.
Example 1: Set the configuration of 1st video channel
Example
http://mycam/public/stw.cgi?function=videoSet&ch=1&compressionType=mpeg&quality=3
Return:
Success
HTTP Code: 200 OK
Content-Type: text/plain
Body:
Success
Failure
HTTP Code: 200 OK
Content-Type: text/plain
Body:
<message>
Refer to 3.2 Error Codes for <message>.
SAMSUNG TECHWIN Co., Ltd.
7
CGI Specification for IP Surveillance Products
4.1.3. Get Audio Configuration
It queries the configuration information of audio channel.
Synopsis
http://<servername>/public/stw.cgi?function=audioGet[&<argument>=<value>]
<argument> and <value> are required as following.
Argument
Valid values
Description
ch=<int>
1~999
Audio channel number
Note: Default is 1.
Example 1: Get the configuration information of audio channel 1.
Example
http://mycam/public/stw.cgi?function=audioGet&ch=1
Return:
Success
HTTP Code: 200 OK
Content-Type: text/plain
Body:
<information>
<information> are product and firmware dependent.
<information> are as follows:
Argument
Valid values
Description
ch=<int>
1~999
Audio channel number
audioInUse
0, 1
Determines whether to use audio input
=<int>
0 is disable
1 is enable
audioOutUse
0, 1
=<int>
Determines whether to use audio output
0 is disable
1 is enable
Failure
SAMSUNG TECHWIN Co., Ltd.
8
CGI Specification for IP Surveillance Products
HTTP Code: 200 OK
Content-Type: text/plain
Body:
<message>
Refer to 3.2 Error Codes for <message>.
SAMSUNG TECHWIN Co., Ltd.
9
CGI Specification for IP Surveillance Products
4.1.4. Set Audio Configuration
It changes the configuration information of audio channel.
Synopsis
http://<servername>/public/stw.cgi?function=audioSet[&<argument>=<value>][&<argument>=<v
alue>]...
<argument> and <value> are required as following.
Argument
Valid values
Description
ch=<int>
1~999
Audio channel number
Note: Default is 1.
audioInUse
0, 1
=<int>
Determines whether to use audio input
0 is disable
1 is enable
audioOutUse
0, 1
=<int>
Determines whether to use audio output
0 is disable
1 is enable
Example 1: Set the configuration of 1st audio channel
Example
http://mycam/public/stw.cgi?function=audioSet&ch=1&audioInUse=1&audioOutUse=1
Return:
Success
HTTP Code: 200 OK
Content-Type: text/plain
Body:
Success
Failure
HTTP Code: 200 OK
Content-Type: text/plain
Body:
<message>
Refer to 3.2 Error Codes for <message>.
SAMSUNG TECHWIN Co., Ltd.
10
CGI Specification for IP Surveillance Products
4.1.5. Get Network Configuration
It queries the configuration information of network.
Synopsis
http://<servername>/public/stw.cgi?function=networkGet
<argument> and <value> are required as following.
Argument
Valid values
Description
ch=<int>
1~999
Video channel number
Note: Default is 1.
Example 1: Get the configuration information of network.
Example
http://mycam/public/stw.cgi?function=networkGet
Return:
Success
HTTP Code: 200 OK
Content-Type: text/plain
Body:
<information>
<information> are as follows:
Argument
Valid values
Description
connectionType
static,
You
=<string>
xdsl,
configuration, xdsl modem and dhcp for cable modem.
dhcp
static – configure network assignment information of a
can
select
static
interface
for
static
IP
camera connected to the local area network or to the
static IP of xDSL modem.
xdsl – For dynamic IP of xDSL, enter xDSLusername
and xDSLpassword of xDSL
dhcp – For IP router or cable modem interface, select
DHCP.
ip=<string>
<IP Address>
IP Address
netmask=<string>
<NETMASK>
Netmask
SAMSUNG TECHWIN Co., Ltd.
11
CGI Specification for IP Surveillance Products
gateway=<string>
<GATEWAY>
Gateway
dns1 =<string>
<DNS1>
DNS1 server address.
dns2 =<string>
<DNS2>
DNS2 server address.
Failure
HTTP Code: 200 OK
Content-Type: text/plain
Body:
<message>
Refer to 3.2 Error Codes for <message>.
SAMSUNG TECHWIN Co., Ltd.
12
CGI Specification for IP Surveillance Products
4.1.6. Set Network Configuration
It changes the configuration information of network. After this action, the system should be
rebooted.
Synopsis
http://<servername>/public/stw.cgi?function=networkSet[&<argument>=<value>][&<argument>=
<value>]...
<argument> and <value> are required as following.
Argument
Valid values
Description
connectionType
static,
You
=<string>
xdsl,
configuration, xdsl modem and dhcp for cable modem.
dhcp
static – configure network assignment information of a
can
select
static
interface
for
static
IP
camera connected to the local area network or to the
static IP of xDSL modem.
xdsl – For dynamic IP of xDSL, enter xDSLusername
and xDSLpassword of xDSL
dhcp – For IP router or cable modem interface, select
DHCP.
ip=<string>
<IP Address>
IP Address
netmask=<string>
<NETMASK>
Netmask
gateway=<string>
<GATEWAY>
Gateway
dns1 =<string>
<DNS1>
DNS1 server address.
dns2 =<string>
<DNS2>
DNS2 server address.
xDSLusername
<xDSL ID>
Set ID to access to the xDSL modem.
xDSLpassword
<xDSL
Set password to access to the xDSL modem.
=<string>
Password>
=<string>
Example 1: Set the configuration of network
Example 1.
http://mycam/public/stw.cgi?function=networkSet&connectionType=static&ip=192.168.1.100
Return:
Success
SAMSUNG TECHWIN Co., Ltd.
13
CGI Specification for IP Surveillance Products
HTTP Code: 200 OK
Content-Type: text/plain
Body:
Success
Failure
HTTP Code: 200 OK
Content-Type: text/plain
Body:
<message>
Refer to 3.2 Error Codes for <message>.
SAMSUNG TECHWIN Co., Ltd.
14
CGI Specification for IP Surveillance Products
4.1.7. Get DDNS and Network Port Configuration
It queries the configuration information of DDNS and network port.
Synopsis
http://<servername>/public/stw.cgi?function=ddnsPortGet
Example 1: Get the configuration information of DDNS and network port.
Example
http://mycam/public/stw.cgi?function=ddnsPortGet
Return:
Success
HTTP Code: 200 OK
Content-Type: text/plain
Body:
<information>
<information> are product and firmware dependent.
<information> are as follows:
Argument
Valid values
Description
connectionPort
1~65535
Connection port is to control communication with camera.
httpPort=<int>
1~65535
Http port is to access to the camera web page.
ftpPort=<int>
1~65535
FTP port is to access to use FTP function.
ddnsUse
0, 1
Determine use of DDNS Server.
=<int>
=<int>
DDNS allows you to connect to the server transforming
dynamic IP.
0 is disable
1 is enable.
ddnsServer
A string
Set DDNS Server name to access to the DDNS Server.
A string
Set ID or Hostname to access to the DDNS Server.
A string
Set password to access to the DDNS Server
=<string>
ddnsId
=<string>
ddnsPassword
=<string>
SAMSUNG TECHWIN Co., Ltd.
15
CGI Specification for IP Surveillance Products
Failure
HTTP Code: 200 OK
Content-Type: text/plain
Body:
<message>
Refer to 3.2 Error Codes for <message>.
SAMSUNG TECHWIN Co., Ltd.
16
CGI Specification for IP Surveillance Products
4.1.8. Set DDNS Configuration
It changes the configuration information of DDNS. After this action, the system should be
rebooted.
Synopsis
http://<servername>/public/stw.cgi?function=ddnsPortSet[&<argument>=<value>][&<argument>
=<value>]...
<argument> and <value> are required as following.
Argument
Valid values
Description
connectionPort
1~65535
Connection port is to control communication with camera.
=<int>
(Used in SNC-570, SND-560, SND-460V, SNC-550, SNP1000/1000A, SNP-3300/3300A, and SNS-100/400)
httpPort=<int>
1~65535
Http port is to access to the camera web page.
(Used in SNC-570, SND-560, SND-460V, SNC-550, SNP1000/1000A, SNP-3300/3300A, and SNS-100/400)
ftpPort=<int>
1~65535
FTP port is to access to use FTP function.
(Used in SNC-570, SND-560, SND-460V, SNC-550, SNP1000/1000A, SNP-3300/3300A, and SNS-100/400)
servicePort
1~65535
=<int>
Service port replaces all the three ports above.
(Used in SNC-1300, SNP-3750/3350, SNP-3370/3370TH,
and SNP-3301/3301H)
ddnsUse
0, 1
=<int>
Determine use of DDNS Server.
DDNS allows you to connect to the server transforming
dynamic IP.
0 is disable
1 is enable.
ddnsServer
A string
Set DDNS Server name to access to the DDNS Server.
A string
Set ID or Hostname to access to the DDNS Server.
A string
Set password to access to the DDNS Server
=<string>
ddnsId
=<string>
ddnsPassword
=<string>
Example 1: Set the configuration of DDNS
SAMSUNG TECHWIN Co., Ltd.
17
CGI Specification for IP Surveillance Products
Example 1.
http://mycam/public/stw.cgi?function=ddnsPortSet&ddnsUse=1&connectionPort=4000
Return:
Success
HTTP Code: 200 OK
Content-Type: text/plain
Body:
Success
Failure
HTTP Code: 200 OK
Content-Type: text/plain
Body:
<message>
Refer to 3.2 Error Codes for <message>.
SAMSUNG TECHWIN Co., Ltd.
18
CGI Specification for IP Surveillance Products
4.1.9. Get RTP Configuration
It queries the configuration information of RTP.
Synopsis
http://<servername>/public/stw.cgi?function=rtpGet[&<argument>=<value>]
<argument> and <value> are required as following.
Argument
Valid values
Description
ch=<int>
1~999
Video channel number
Note: Default is 1.
Example 1: Get the configuration information of rtp.
Example
http://mycam/public/stw.cgi?function=rtpGet&ch=1
Return:
Success
HTTP Code: 200 OK
Content-Type: text/plain
Body:
<information>
<information> are product and firmware dependent.
For SNC-570/SND-560/SND-460V, <information> are as follows:
Argument
Valid values
Description
rtspTcpEnable
0, 1
Determines whether to use RTSP/TCP.
=<int>
0 is disable
1 is enable.
rtpUdpEnable
0, 1
=<int>
Determines whether to use RTP/UDP.
0 is disable
1 is enable
rtpMulticastEnable
0, 1
=<int>
Determines whether to use RTP/Multicast.
0 is disable
1 is enable
MulticastIp
<Multicast IP
SAMSUNG TECHWIN Co., Ltd.
Multicast IP Address.
19
CGI Specification for IP Surveillance Products
=<string>
Address>
multicastPort
1~65535
RTP/Multicast .
imageResolution
d1,
Determines the resolution of the Streaming Engine.
=<string>
halfd1,
=<int>
cif,
qcif
Failure
HTTP Code: 200 OK
Content-Type: text/plain
Body:
<message>
Refer to 3.2 Error Codes for <message>.
SAMSUNG TECHWIN Co., Ltd.
20
CGI Specification for IP Surveillance Products
4.1.10. Set RTP Configuration
It changes the configuration information of RTP.
Synopsis
http://<servername>/public/stw.cgi?function=rtpSet[&<argument>=<value>][&<argument>=<valu
e>]...
<argument> and <value> are required as following.
Argument
Valid values
Description
rtspTcpEnable
0, 1
Determines whether to use RTSP/TCP.
=<int>
0 is disable
1 is enable.
rtpUdpEnable
0, 1
=<int>
Determines whether to use RTP/UDP.
0 is disable
1 is enable
rtpMulticastEnable
0, 1
=<int>
Determines whether to use RTP/Multicast.
0 is disable
1 is enable
MulticastIp
<Multicast IP
Multicast IP Address.
=<string>
Address>
multicastPort
1~65535
RTP/Multicast .
imageResolution
d1,
Determines the resolution of the Streaming Engine
=<string>
4cif,
SNC-570, SND-560,
cif,
SND-460V
qcif,
SNP-3750/3350
main,
SNP-3370/3370TH
sub
SNP-3301/3301H
=<int>
SNC-1300
rtspStandardPortE
0, 1
d1, cif, qcif
4cif, cif, qcif
main, sub
Determines whether to use RTSP standard port (554)
nable
instead of the service port.
=<int>
0 is disable
1 is enable
(Used in SNC-1300, SNP-3750/3350, SNP-3370/3370TH,
and SNP-3301/3301H)
SAMSUNG TECHWIN Co., Ltd.
21
CGI Specification for IP Surveillance Products
Example 1: Set the configuration of RTP
Example 1.
http://mycam/public/stw.cgi?function=rtpSet&rtspTcpEnable=1&imageResolution=d1
Return:
Success
HTTP Code: 200 OK
Content-Type: text/plain
Body:
Success
Failure
HTTP Code: 200 OK
Content-Type: text/plain
Body:
<message>
Refer to 3.2 Error Codes for <message>.
SAMSUNG TECHWIN Co., Ltd.
22
CGI Specification for IP Surveillance Products
4.1.11. Get User Configuration
It queries the configuration information of users.
Synopsis
http://<servername>/public/stw.cgi?function=userGet
Example 1: Get the configuration information of users.
Example
http://mycam/public/stw.cgi?function=userGet
Return:
Success
HTTP Code: 200 OK
Content-Type: text/plain
Body:
<information>
<information> are as follows:
Argument
Valid values
Description
adminPassword
A string
Change password of administrator.
0, 1
Allowing guest to connect Main Viewer.
=<string>
guestPermission
=<int>
0 is disable
1 is enable
user1Id
A string
Determines ID of user1.
A string
Determines password of user1.
0~7
Control level of user1
=<string>
user1Password
=<string>
user1Control
=<int>
0 : none
1 : Audio-In
2 : Controls
3 : Controls / Audio-In
4 : Video
5 : Video / Audio-In
SAMSUNG TECHWIN Co., Ltd.
23
CGI Specification for IP Surveillance Products
6 : Video / Controls
7 : Video / Controls / Audio-In
user1Use
0, 1
=<int>
user2Id
Use
0 : not use, 1 : use
A string
Determines ID of user2.
A string
Determines password of user2.
0~7
Control level of user2
=<string>
user2Password
=<string>
user2Control
=<int>
user2Use
* Same as user1Control
0, 1
=<int>
user3Id
Use
0 : not use, 1 : use
A string
Determines ID of user3.
A string
Determines password of user3.
0~7
Control level of user3
=<string>
user3Password
=<string>
user3Control
=<int>
user3Use
* Same as user1Control
0, 1
=<int>
user4Id
Use
0 : not use, 1 : use
A string
Determines ID of user4.
A string
Determines password of user4.
0~7
Control level of user4
=<string>
user4Password
=<string>
user4Control
=<int>
user4Use
* Same as user1Control
0, 1
=<int>
user5Id
Use
0 : not use, 1 : use
A string
Determines ID of user5.
A string
Determines password of user5.
0~7
Control level of user5
=<string>
user5Password
=<string>
user5Control
=<int>
user5Use
* Same as user1Control
0, 1
SAMSUNG TECHWIN Co., Ltd.
Use
24
CGI Specification for IP Surveillance Products
=<int>
0 : not use, 1 : use
Failure
HTTP Code: 200 OK
Content-Type: text/plain
Body:
<message>
Refer to 3.2 Error Codes for <message>.
SAMSUNG TECHWIN Co., Ltd.
25
CGI Specification for IP Surveillance Products
4.1.12. Set User Configuration
It changes the configuration information of user. After changing the admin password, you need
to login again.
Synopsis
http://<servername>/public/stw.cgi?function=userSet[&<argument>=<value>][&<argument>=<va
lue>]...
<argument> and <value> are required as following.
Argument
Valid values
Description
adminPassword
A string
Change password of administrator.
0, 1
Allowing guest to connect Main Viewer.
=<string>
guestPermission
=<int>
0 is disable
1 is enable
user1Id
A string
Determines ID of user1.
A string
Determines password of user1.
0~7
Control level of user1
=<string>
user1Password
=<string>
user1Control
=<int>
0 : none
1 : Audio-In
2 : Controls
3 : Controls / Audio-In
4 : Video
5 : Video / Audio-In
6 : Video / Controls
7 : Video / Controls / Audio-In
user1Use
0, 1
=<int>
user2Id
Use
0 : not use, 1 : use
A string
Determines ID of user2.
A string
Determines password of user2.
0~7
Control level of user2
=<string>
user2Password
=<string>
user2Control
SAMSUNG TECHWIN Co., Ltd.
26
CGI Specification for IP Surveillance Products
=<int>
user2Use
* Same as user1Control
0, 1
=<int>
User3Id
Use
0 : not use, 1 : use
A string
Determines ID of user3.
A string
Determines password of user3.
0~7
Control level of user3
=<string>
user3Password
=<string>
user3Control
=<int>
user3Use
* Same as user1Control
0, 1
=<int>
user4Id
Use
0 : not use, 1 : use
A string
Determines ID of user4.
A string
Determines password of user4.
0~7
Control level of user4
=<string>
user4Password
=<string>
user4Control
=<int>
user4Use
* Same as user1Control
0, 1
=<int>
user5Id
Use
0 : not use, 1 : use
A string
Determines ID of user5.
A string
Determines password of user5.
0~7
Control level of user5
=<string>
user5Password
=<string>
user5Control
=<int>
user5Use
* Same as user1Control
0, 1
=<int>
Use
0 : not use, 1 : use
Example 1: Set the configuration of user
Example 1.
http://mycam/public/stw.cgi?function=userSet&adminPassword=12345678&guestPermission=1
Return:
Success
HTTP Code: 200 OK
SAMSUNG TECHWIN Co., Ltd.
27
CGI Specification for IP Surveillance Products
Content-Type: text/plain
Body:
Success
Failure
HTTP Code: 200 OK
Content-Type: text/plain
Body:
<message>
Refer to 3.2 Error Codes for <message>.
SAMSUNG TECHWIN Co., Ltd.
28
CGI Specification for IP Surveillance Products
4.1.13. Get Time Configuration
It queries the current time of GMT and the configuration information of time.
Synopsis
http://<servername>/public/stw.cgi?function=timeGet
Example 1: Get the configuration information of time.
Example
http://mycam/public/stw.cgi?function=timeGet
Return:
Success
HTTP Code: 200 OK
Content-Type: text/plain
Body:
<information>
<information> are as follows:
Argument
Valid values
Description
year=<int>
1970~2031
Current year.
month=<int>
1~12
Current month.
day=<int>
1~31
Current day.
hour=<int>
0~23
Current hour.
min=<int>
0~59
Current min.
gmt=<string>
A string
The time offset from the GMT(Greenwich Mean Time).
SNC-570, SND-560, SND-460V,
+09:00, -04:30 ... Etc
SNC-550, SNP-1000/1000A,
SNP-3300/3300A, SNS-100/400
SNC-1300, SNP-3750/3350,
GMT Code in 4.1.14.1
SNP-3370/3370TH/3301/3301H
ntpenable
0, 1
=<int>
ntpserver1
Determines the time server.
0 is disable, 1 is enable
A string
Set up address of time server of Server 1
A string
Set up address of time server of Server 2
=<string>
ntpserver2
SAMSUNG TECHWIN Co., Ltd.
29
CGI Specification for IP Surveillance Products
=<string>
ntpserver3
A string
Set up address of time server of Server 3
A string
Set up address of time server of Server 4
A string
Set up address of time server of Server 5
=<string>
ntpserver4
=<string>
ntpserver5
=<string>
Failure
HTTP Code: 200 OK
Content-Type: text/plain
Body:
<message>
Refer to 3.2 Error Codes for <message>.
SAMSUNG TECHWIN Co., Ltd.
30
CGI Specification for IP Surveillance Products
4.1.14. Set Time Configuration
It changes the configuration information of time.
Synopsis
http://<servername>/public/stw.cgi?function=timeSet[&<argument>=<value>][&<argument>=<va
lue>]...
<argument> and <value> are required as following.
Argument
Valid values
Description
year=<int>
1970~2031
Current year.
month=<int>
1~12
Current month.
day=<int>
1~31
Current day.
hour=<int>
0~23
Current hour.
min=<int>
0~59
Current min.
gmt=<string>
A string
GMT(Greenwich Mean Time).
SNC-570, SND-560, SND-460V,
+09:00, -04:30 ... Etc
SNC-550, SNP-1000/1000A,
SNP-3300/3300A, SNS-100/400
SNC-1300, SNP-3750/3350,
GMT Code in 4.1.14.1
SNP-3370/3370TH/3301/3301H
dstuse=<int>
0, 1
Determines whether to use DST of current GMT area.
(Used in SNC-1300, SNP-3750/3350, SNP-3370/3370TH, and
SNP-3301/3301H)
0 is disable
1 is enable
ntpenable
0, 1
=<int>
Determines the time server.
0 is disable
1 is enable
ntpserver1
A string
Set up address of time server of Server 1
A string
Set up address of time server of Server 2
A string
Set up address of time server of Server 3
A string
Set up address of time server of Server 4
=<string>
ntpserver2
=<string>
ntpserver3
=<string>
ntpserver4
SAMSUNG TECHWIN Co., Ltd.
31
CGI Specification for IP Surveillance Products
=<string>
ntpserver5
A string
Set up address of time server of Server 5
=<string>
Example 1: Set the configuration of time
Example 1.
http://mycam/public/stw.cgi?function=timeSet&year=2009&month=1&day=28&gmt=+09:00
Return:
Success
HTTP Code: 200 OK
Content-Type: text/plain
Body:
Success
Failure
HTTP Code: 200 OK
Content-Type: text/plain
Body:
<message>
Refer to 3.2 Error Codes for <message>.
SAMSUNG TECHWIN Co., Ltd.
32
CGI Specification for IP Surveillance Products
4.1.14.1. GMT Code List
Shown below is the code list of GMT areas
GMT code
Time offset
Cities
N1200_IntDateLineWest
GMT-12:00
International Date Line West
N1100_MidwayIsland
GMT-11:00
Midway Island, Samoa
N1000_Hawaii
GMT-10:00
Hawaii
N0900_Alaska
GMT-09:00
Alaska
N0800_PacificTime
GMT-08:00
Pacific Time
N0800_Tijuana
GMT-08:00
Tijuana, Baja California
N0700_Arizona
GMT-07:00
Arizona
N0700_Chihuahua
GMT-07:00
Chihuahua, La Paz, Mazatian
N0700_Mountain
GMT-07:00
Mountain Time
N0600_CentralAmerica
GMT-06:00
Central America
N0600_CentralTime
GMT-06:00
Central Time
N0600_Guadalajara
GMT-06:00
Guadalajara, Mexico City, Monterrey
N0600_Saskatchewan
GMT-06:00
Saskatchewan
N0500_Bogota
GMT-05:00
Bogota, Lima, Quito, Rio Branco
N0500_EasternTime
GMT-05:00
Eastern Time
N0500_Indiana
GMT-05:00
Indiana
N0430_Caracas
GMT-04:30
Caracas
N0400_Atlantic
GMT-04:00
Atlantic Time
N0400_LaPaz
GMT-04:00
La Paz
N0400_Manaus
GMT-04:00
Manaus
N0400_Santiago
GMT-04:00
Santiago
N0330_Newfoundland
GMT-03:30
Newfoundland
N0300_Brasilia
GMT-03:00
Brasilia
N0300_BuenosAires
GMT-03:00
Buenos Aires
N0300_Georgetown
GMT-03:00
Georgetown
N0300_Greenland
GMT-03:00
Greenland
N0300_Montevideo
GMT-03:00
Montevideo
N0200_MidAtlantic
GMT-02:00
Mid-Atlantic
N0100_Azores
GMT-01:00
Azores
N0100_CapeVerdeIs
GMT-01:00
Cape Verda Is.
P0000_Casablanca
GMT
Casablanca
P0000_Greenwich
GMT
Greenwich Mean Time:Dublin, Edinburgh, Lisbon,
SAMSUNG TECHWIN Co., Ltd.
33
CGI Specification for IP Surveillance Products
London
P0000_Monrovia
GMT
P0100_Amsterdam
GMT+01:00
P0100_Belgrade
GMT+01:00
Belgrade, Bratislava, Budapest, Ljubljana, Praque
P0100_Brussels
GMT+01:00
Brussels, Copenhagen, Madrid, Paris
P0100_Sarajevo
GMT+01:00
Sarayebo, Skopje, Warsaw, Zagreb
P0100_WestCentralAfrica
GMT+01:00
West Central Africa
P0200_Amman
GMT+02:00
Amman
P0200_Athens
GMT+02:00
Athens, Bucharest, Istanbul
P0200_Beirut
GMT+02:00
Beirut
P0200_Cairo
GMT+02:00
Cairo
P0200_Harare
GMT+02:00
Harare, Pretoria
P0200_Helsinki
GMT+02:00
Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius
P0200_Jerusalem
GMT+02:00
Jerusalem
P0200_Minsk
GMT+02:00
Minsk
P0200_Windhoek
GMT+02:00
Windhoek
P0300_Baghdad
GMT+03:00
Baghdad
P0300_Kuwait
GMT+03:00
Kuwait, Riyadh
P0300_Moscow
GMT+03:00
Moscow, St_Petersburg, Volgograd
P0300_Nairobi
GMT+03:00
Nairobi
P0330_Tehran
GMT+03:30
Tehran
P0400_Tbilisi
GMT+04:00
Tbilisi
P0400_AbuDhabi
GMT+04:00
Abu Dhabi, Muscat
P0400_Baku
GMT+04:00
Baku
P0400_Caucasus
GMT+04:00
Caucasus Standard Time
P0400_PortLouis
GMT+04:00
Port Louis
P0400_Yerevan
GMT+04:00
Yerevan
P0430_Kabul
GMT+04:30
Kabul
P0500_Ekaterinburg
GMT+05:00
Ekaterinburg
P0500_Islamabad
GMT+05:00
Islamabad, Karachi
P0500_Tashkent
GMT+05:00
Tashkent
P0530_Chennai
GMT+05:30
Chennai, Kolkata, Mumbai, New Delhi
P0530_Sri
GMT+05:30
Sri Jayawardenepura
P0545_Kathmandu
GMT+05:45
Kathmandu
SAMSUNG TECHWIN Co., Ltd.
Monrovia, Reykjavik
Amsterdam,
Berlin,
Bern,
Rom,
Stockholm,
Vienna
34
CGI Specification for IP Surveillance Products
P0600_Almaty
GMT+06:00
Almaty, Novosibirsk
P0600_Astana
GMT+06:00
Astana, Dhaka
P0630_Yangon
GMT+06:30
Yangon
P0700_Bangkok
GMT+07:00
Bangkok, Hanoi, Jakarta
P0700_Krasnoyarsk
GMT+07:00
Krasnoyarsk
P0800_Beijing
GMT+08:00
Beijing, Chongqing, Hong Kong, Urumqi
P0800_Irkutsk
GMT+08:00
Irkutsk, Ulaan Bataar
P0800_KualaLumpur
GMT+08:00
KualaLumpur, Singapore
P0800_Perth
GMT+08:00
Perth
P0800_Taipei
GMT+08:00
Taipei
P0900_Osaka
GMT+09:00
Osaka, Sapporo, Tokyo
P0900_Seoul
GMT+09:00
Seoul
P0900_Yakutsk
GMT+09:00
Yakutsk
P0930_Adelaide
GMT+09:30
Adelaide
P0930_Darwin
GMT+09:30
Darwin
P1000_Brisbane
GMT+10:00
Brisbane
P1000_Canberra
GMT+10:00
Canberra, Melbourne, Sydney
P1000_Guam
GMT+10:00
Guam, Port Moresby
P1000_Hobart
GMT+10:00
Hobart
P1000_Vladivostok
GMT+10:00
Vladivostok
P1100_Magadan
GMT+11:00
Magadan
P1200_Auckland
GMT+12:00
Auckland, Wellington
P1200_Fiji
GMT+12:00
Fiji, Kamchatka, Marshall Is.
P1300_Nukualofa
GMT+13:00
Nuku'alofa
SAMSUNG TECHWIN Co., Ltd.
35
CGI Specification for IP Surveillance Products
4.1.15. Get MD(Motion Detection) Configuration
It queries the configuration MD information of video channel.
Synopsis
http://<servername>/public/stw.cgi?function=motionGet[&<argument>=<value>]
<argument> and <value> are required as following.
Argument
Valid values
Description
ch=<int>
1~999
Video channel number
Note: Default is 1.
Example 1: Get the configuration MD information of video channel 1.
Example
http://mycam/public/stw.cgi?function=motionGet&ch=1
Return:
Success
HTTP Code: 200 OK
Content-Type: text/plain
Body:
<information>
<information> are as follows:
Argument
Valid values
Description
ch=<int>
1~999
Camera Channel.
Note: Default is 1.
enable
0, 1
Decide whether you use motion detection function.
1~5
Setting up sensitivity to detect motion to adjust input video by
=<int>
sensitivity
=<int>
situation. You can select 1-5, and 5 is the highest.
1 : very low
2 : low
3 : middle
4 : high
5 : very high
SAMSUNG TECHWIN Co., Ltd.
36
CGI Specification for IP Surveillance Products
status=<int>
0, 1
Status of the Motion Detection.
0 : Off, 1: On
Failure
HTTP Code: 200 OK
Content-Type: text/plain
Body:
<message>
Refer to 3.2 Error Codes for <message>.
SAMSUNG TECHWIN Co., Ltd.
37
CGI Specification for IP Surveillance Products
4.1.16. Set MD(Motion Detection) Configuration
This CGI request returns the MD configuration for the queried channel.
Synopsis
http://<servername>/public/stw.cgi?function=motionSet[&<argument>=<value>][&<argument>=<
value>]...
<argument> and <value> are required as following.
Argument
Valid values
Description
ch=<int>
1~999
Camera Channel.
Note: Default is 1.
area
0, 1
=<int>
You can select motion detection area.
0 is deselect.
1 is select all.
enable
0, 1
Decide whether you use motion detection function.
1~5
Setting up sensitivity to detect motion to adjust input video by
=<int>
sensitivity
=<int>
situation. You can select 1-5, and 5 is the highest.
1 : very low
2 : low
3 : middle
4 : high
5 : very high
Example 1: Set the MD configuration of 1st video channel
Example 1.
http://mycam/public/stw.cgi?function=motionSet&area=1&enable=1&sensitivity=3
Return:
Success
HTTP Code: 200 OK
Content-Type: text/plain
Body:
Success
SAMSUNG TECHWIN Co., Ltd.
38
CGI Specification for IP Surveillance Products
Failure
HTTP Code: 200 OK
Content-Type: text/plain
Body:
<message>
Refer to 3.2 Error Codes for <message>.
SAMSUNG TECHWIN Co., Ltd.
39
CGI Specification for IP Surveillance Products
4.1.17. Get Profile Configuration
It queries a profile of the system..
Synopsis
http://<servername>/public/stw.cgi?function=profile[&<argument>]
<argument> is required as following.
Argument
Description
ModelName
System model.
Manufacturer
System manufacturer.
FirmwareVersion
System firmware version.
MacAddress
System MAC Address
VideoFormat
Supported video format.(NTSC or PAL)
compressionType
Supported video compression type.
resolution
Supported resolutions.
quality
Supported valid values of quality.
framerate
Supported frame rates.
Input
Number of input. (Sensor)
Output
Number of output. (Relay)
Video
Number of supported video channels.
Audio
Number of supported audio channels.
PTZEnable
Flag that indicates whether PTZ support.
0 is not supported. PTZ function.
1 is supported PTZ function.
Example 1: Get the system profile for all information.
Example
http://mycam/public/stw.cgi?function=profile
Example 2: Get the system profile for arguments.
Example
http://mycam/public/stw.cgi?function=profile&Manufacturer&VideoFormat
Return:
Success
SAMSUNG TECHWIN Co., Ltd.
40
CGI Specification for IP Surveillance Products
HTTP Code: 200 OK
Content-Type: text/plain
Body:
<information>
<information> are product and firmware dependent.
<information> are as follows:
Argument
Valid values
Description
ModelName=<string>
A string
System model.
Manufacturer=<string>
A string
System manufacturer.
FirmwareVersion
A string
System firmware version.
MacAddress=<string>
A string
System MAC Address
VideoFormat=<string>
NTSC,
Supported video format.(NTSC or PAL)
=<string>
PAL
compressionType
MPEG4,
Supported video compression type.
=<string>
MJPEG
resolution=<string>
A string
Supported resolutions.
quality=<string>
A string
Supported valid values of quality.
framerate=<string>
A string
Supported frame rates.
Input=<int>
1~999
Number of input. (Sensor)
Output=<int>
1~999
Number of output. (Relay)
Video=<int>
1~999
Number of supported video channels.
Audio=<int>
1~999
Number of supported audio channels.
PTZEnable=<int>
0, 1
Flag that indicates whether PTZ support.
0 is not supported. PTZ function.
1 is supported PTZ function.
Failure
HTTP Code: 200 OK
Content-Type: text/plain
Body:
<message>
Refer to 3.2 Error Codes for <message>.
SAMSUNG TECHWIN Co., Ltd.
41
CGI Specification for IP Surveillance Products
4.2. I/O Port
4.2.1. Get Digital in(Sensor) Configuration
It queries the configuration information of sensor number.
Synopsis
http://<servername>/public/stw.cgi?function=digitalInTypeGet[&<argument>=<value>]
<argument> and <value> are required as follows.
Argument
Valid values
Description
no=<int>
1~999
Sensor number
Note: Default is 1.
Example 1: Get the configuration sensor information of sensor number 1.
Example
http://mycam/public/stw.cgi?function= digitalInTypeGet &no=1
Return:
Success
HTTP Code: 200 OK
Content-Type: text/plain
Body:
<information>
<information> are product and firmware dependent.
<information> are as follows:
Argument
Valid values
Description
no=<int>
1~999
Sensor number
Note: Default is 1.
type
normalopen,
Types of sensors are „normalopen‟ and „normalclose‟. This
=<string>
normalclose
selects up type of connected sensor.
status=<int>
0, 1
The status of the sensor.
0: off, 1: on
Failure
SAMSUNG TECHWIN Co., Ltd.
42
CGI Specification for IP Surveillance Products
HTTP Code: 200 OK
Content-Type: text/plain
Body:
<message>
Refer to 3.2 Error Codes for <message>.
SAMSUNG TECHWIN Co., Ltd.
43
CGI Specification for IP Surveillance Products
4.2.2. Set Digital in(Sensor) Configuration
It changes the sensor type of sensor number.
Synopsis
http://<servername>/public/stw.cgi?function=digitalInTypeSet[&<argument>=<value>][&<argum
ent>=<value>]...
<argument> and <value> are required as following.
Argument
Valid values
Description
no=<int>
1~999
sensor number
Note: Default is 1.
type=<string>
normalopen,
Types of sensors are „normalopen‟ and „normalclose‟. This
normalclose
selects up type of connected sensor.
Example 1: Set the type of 1st digital in device as normal open state.
Example
http://mycam/public/stw.cgi?function=digitalInTypeSet&no=1&type=normalopen
Return:
Success
HTTP Code: 200 OK
Content-Type: text/plain
Body:
Success
Failure
HTTP Code: 200 OK
Content-Type: text/plain
Body:
<message>
Refer to 3.2 Error Codes for <message>.
SAMSUNG TECHWIN Co., Ltd.
44
CGI Specification for IP Surveillance Products
4.2.3. Get Digital output(Relay) Configuration
It queries the digital output status configuration of system..
Synopsis
http://<servername>/public/stw.cgi?function=digitalOutGet[& <argument>=<value>]
<argument> and <value> are required as following.
Argument
Valid values
Description
no=<int>
1~999
Relay number
Note: Default is 1.
Example 1: Get the configuration sensor information of sensor number 1.
Example
http://mycam/public/stw.cgi?function= digitalOutGet &no=1
Return:
Success
HTTP Code: 200 OK
Content-Type: text/plain
Body:
<information>
<information> are product and firmware dependent.
<information> are as follows.
Argument
Valid values
Description
no=<int>
1~999
Relay number
active=<int>
0, 1
The active status of the relay device.
0: inactive, 1: active.
Failure
HTTP Code: 200 OK
Content-Type: text/plain
Body:
<message>
Refer to 3.2 Error Codes for <message>.
SAMSUNG TECHWIN Co., Ltd.
45
CGI Specification for IP Surveillance Products
4.2.4. Set Digital output(Relay) Configuration
It changes the digital output of system.
Synopsis
http://<servername>/public/stw.cgi?function=digitalOutSet[&<argument>=<value>][&<argument
>=<value>]...
<argument> and <value> are required as following.
Argument
Valid values
Description
no=<int>
1~999
Relay number
active=<int>
0, 1
Set up Digital Out.
0: inactive, 1: active
Example 1: Set the 1st digital output device as active state.
Example
http://mycam/public/stw.cgi?function=digitalOutSet&no=1&active=1
Return:
Success
HTTP Code: 200 OK
Content-Type: text/plain
Body:
Success
Failure
HTTP Code: 200 OK
Content-Type: text/plain
Body:
<message>
Refer to 3.2 Error Codes for <message>.
SAMSUNG TECHWIN Co., Ltd.
46
CGI Specification for IP Surveillance Products
4.3. Serial Port
4.3.1. Get Serial Port
It queries the serial port configuration of system.
Synopsis
http://<servername>/public/stw.cgi?function=serialPortGet[&<argument>=<value>]
<argument> and <value> are required as following.
Argument
Valid values
Description
no=<int>
1~999
The serial port number
Note: Default is 1.
Example 1: Get the configuration sensor information of sensor number 1.
Example
http://mycam/public/stw.cgi?function=serialPortGet&no=1
Return:
Success
HTTP Code: 200 OK
Content-Type: text/plain
Body:
<information>
<information> are product and firmware dependent.
Failure
HTTP Code: 200 OK
Content-Type: text/plain
Body:
<message>
Refer to 3.2 Error Codes for <message>.
SAMSUNG TECHWIN Co., Ltd.
47
CGI Specification for IP Surveillance Products
4.3.2. Set Serial Port
It changes the serial port configuration of system.
Synopsis
http://<servername>/public/stw.cgi?function=serialPortSet[&<argument>=<value>][&<argument
>=<value>]...
<argument> and <value> are required as following.
Argument
Valid values
Description
no=<int>
1~999
The serial port number
Note: Default is 1.
baudRate
2400,
=<int>
4800,
A baud of the serial port.
9600,
19200,
38400,
57600,
115200
dataBit=<int>
7, 8
The number of data bits.
parityBit
none,
A parity bit of the serial port.
=<string>
Odd,
even
stopBit=<int>
1, 2
A stop bit of the serial port.
deviceId=<int>
1~255
The device ID of the serial port.
mode=<string>
spd,
The mode of the serial port.
pelcod
Example 1: Set the configuration of 1st video channel
Example
http://mycam/public/stw.cgi?function=serialPortSet&no=1&baudRate=38400
Return:
Success
HTTP Code: 200 OK
Content-Type: text/plain
SAMSUNG TECHWIN Co., Ltd.
48
CGI Specification for IP Surveillance Products
Body:
Success
Failure
HTTP Code: 200 OK
Content-Type: text/plain
Body:
<message>
Refer to 3.2 Error Codes for <message>.
SAMSUNG TECHWIN Co., Ltd.
49
CGI Specification for IP Surveillance Products
4.4. PTZ
4.4.1. Control PTZ Device
It controls pan, tilt and zoom of a PTZ unit.
Synopsis
http://<servername>/public/stw.cgi?function=ptz[&<argument>=<value>][&<argument>=<value>
]...
<argument> and <value> are required as following.
Argument
Valid values
Description
ch=<int>
1~999
channel number
Note: Default is 1.
zoom=<int>
0, 1
Set up zoom.
0 is Zoom wide.
1 is Zoom tele.
focus=<int>
0, 1
Adjust focus.
0 is focus near.
1 is focus far.
move=<string>
up,
down,
left,
right,
uleft.
uright,
dleft,
dright
ptspeed=<int>
1~6
Select the pan and Tilt speed.
1 – slow
6 - fast
Note: Default is speed 3
zfspeed=<int>
1~4
Select the zoom and focus speed.
1 – slow
4 - fast
Note: Default is speed 3
preset=<int>
1~255
SAMSUNG TECHWIN Co., Ltd.
Move the position of preset number.
50
CGI Specification for IP Surveillance Products
129~255 are available only in SNP-3750/3350, SNP3370/3370TH, and SNP-3301/3301H
setpreset=<int>
1~255
Set the Preset.
129~255 are available only in SNP-3750/3350, SNP3370/3370TH, and SNP-3301/3301H
stop=<int>
1
Stop PTZ operation (SNP-3750/3350, SNP-3370/3370TH,
and
SNP-3301/3301H
only:
other
PTZ
cameras
automatically stop after move, zoom, focus operation,
without explicit stop command)
Example 1: Set the configuration of 1st video channel
Example
http://mycam/public/stw.cgi?function=ptz&move=left&ptspeed=3
Return:
Success
HTTP Code: 200 OK
Content-Type: text/plain
Body:
Success
Failure
HTTP Code: 200 OK
Content-Type: text/plain
Body:
<message>
Refer to 3.2 Error Codes for <message>.
SAMSUNG TECHWIN Co., Ltd.
51
CGI Specification for IP Surveillance Products
4.5. Logs
4.5.1. System Log
It queries the configuration information of System Log.
Synopsis
http://<servername>/public/stw.cgi?function=logGet
<argument> and <value> are required as following. (Arguments are available only in SNC-1300,
SNP-3750/3350, SNP-3370/3370TH, and SNP-3301/3301H)
Argument
Valid values
Description
type=<string>
systemLogAll,
Select the log category to search.
systemLogDevice,
Note: Default is systemLogAll
systemLogNetwork,
systemLogUser,
systemLogConfig,
systemLogEtc,
eventLogAll,
eventLogMotion,
eventLogAnalytic,
eventLogSensor,
eventLogRelay,
eventLogEtc
startIndex
1~
=<int>
endIndex
Index of the oldest log to search.
Note: Default is 1
1~
=<int>
Index of the newest log to search.
Note: Default is the last index of log
Note: The maximum count of log query results is
product, firmware, and query option dependent.
If both start and end indexes are specified and
endIndex – startIndex + 1 > (max result count), then
only endIndex will take effect.
detail=<int>
0, 1
Determines whether the query result contains the
detailed information of each log.
0 is not include detail info
SAMSUNG TECHWIN Co., Ltd.
52
CGI Specification for IP Surveillance Products
1 is include detail info
Example 1: Get the log configuration of 1st video channel
Example 1.
http://mycam/public/stw.cgi?function=logGet
Return:
Success
HTTP Code: 200 OK
Content-Type: text/plain
Body:
Success
Failure
HTTP Code: 200 OK
Content-Type: text/plain
Body:
<messages>
Refer to 3.2 Error Codes for <message>.
SAMSUNG TECHWIN Co., Ltd.
53
CGI Specification for IP Surveillance Products
4.6. System Reboot
This CGI request reboots the system.
Synopsis
http://<servername>/public/stw.cgi?function=systemReboot
Example 1: Get the configuration of 1st video channel
Example 1.
http://mycam/public/stw.cgi?function=systemReboot
Return:
Success
HTTP Code: 200 OK
Content-Type: text/plain
Body:
Success
Failure
HTTP Code: 200 OK
Content-Type: text/plain
Body:
<message>
Refer to 3.2 Error Codes for <message>.
SAMSUNG TECHWIN Co., Ltd.
54
CGI Specification for IP Surveillance Products
4.7. Factory Default
This CGI request returns the factory reset configuration. This function reloads factory default
setting. All parameter are set to their factory default value. After this action, the system should
be rebooted.
Synopsis
http://<servername>/public/stw.cgi?function=factoryReset
Example 1: Get the configuration of 1st video channel
Example 1.
http://mycam/public/stw.cgi?function=factoryReset
Return:
Success
HTTP Code: 200 OK
Content-Type: text/plain
Body:
Success
Failure
HTTP Code: 200 OK
Content-Type: text/plain
Body:
<message>
Refer to 3.2 Error Codes for <message>.
SAMSUNG TECHWIN Co., Ltd.
55
CGI Specification for IP Surveillance Products
4.8. Snapshot
This CGI request returns the snapshot configuration for the queried channel.
Synopsis
http://<servername>/public/stw.cgi?function=getImage[&<argument>=<value>]
When the system allows the guest login, user can request the snapshot without authentication.
For this case, the synopsis is as follows.
Synopsis
http://<servername>/guest/guest.cgi?function=getImage[&<argument>=<value>]
<argument> and <value> are required as following.
Argument
Valid values
resolution
d1,
=<string>
4cif,
cif,
qcif,
main,
sub
Description
Image Resolution.
SNC-570, SND-560, SND-460V
d1, cif, qcif
SNP-3750/3350,
4cif, cif, qcif
SNP-3370/3370TH/3301/3301H
SNC-1300
main, sub
Note: SNC-550, SNP-1000/1000A, SNP-3300/3300A, and SNS-100/400 operate based on
video configuration of the product.
Example 1: Get the configuration of 1st video channel
Example 1.
http://mycam/public/stw.cgi?function=getImage&resolution=cif
Return:
Success
HTTP Code: 200 OK
Content-Type: text/plain
Body:
Success
Failure
SAMSUNG TECHWIN Co., Ltd.
56
CGI Specification for IP Surveillance Products
HTTP Code: 200 OK
Content-Type: text/plain
Body:
<message>
Refer to 3.2 Error Codes for <message>.
SAMSUNG TECHWIN Co., Ltd.
57
CGI Specification for IP Surveillance Products
4.9. JPEG Video Request
If CGI request was successful, the server returns a continuous stream of JPEG images.
The JPEG image is separated by boundary and data.
This function is available only for one user.
Synopsis
http://<servername>/public/video.cgi?[&<argument>=<value>]
<argument> and <value> are required as following.
Argument
Valid values
Description
ch=<int>
1~999
channel number
Note: Default is 1.
resolution
d1,
=<string>
4cif,
SNC-570, SND-560, SND-460V
d1, cif, qcif
cif,
SNP-3750/3350,
4cif, cif, qcif
qcif,
SNP-3370/3370TH/3301/3301H
main,
SNC-1300
fps=<int>
Image Resolution.
main, sub
sub
Note: Default is cif or sub
1, 5, 10, 15,
FPS(frame per sec)
20, 25, 30
NTSC : 1, 5, 10, 15, 20, 25, 30 , PAL : 1, 5, 10, 15, 20, 25
Resolution field is invalid in SNC-550, SNP-1000/1000A, SNP-3300/3300A, and SNS-100/400,
because they operate based on video configuration of the product.
It is invalid to apply fps, higher than currently set figure.
Example 1: Get the multipart JPEG Image.
Example 1.
http://mycam/public/video.cgi?ch=1&resolution=cif&fps=25
HTTP/1.x 200 OK
Content-Type: multipart/x-mixed-replace;boundary=<boundary>
Body
- - <boundary>
Content-type : image/jpeg
Content-length : <image size>
SAMSUNG TECHWIN Co., Ltd.
58
CGI Specification for IP Surveillance Products
<JPEG image data>
- - <boundary>
Content-type : image/jpeg
Content-length : <image size>
<JPEG image data>
Return:
Success
HTTP/1.x 200 OK
Transfer-Encoding: chunked
Cache-Control: no-cache
Pragma: no-cache
Expires: Sat, 07 Jan 1978 09:13:00 GMT
Content-Type: multipart/x-mixed-replace;boundary=<boundary>
Date: Thu, 19 Mar 2009 06:40:14 GMT
Server: lighttpd/1.4.19
Failure
HTTP Code: 200 OK
Content-Type: text/plain
Body:
<message>
Refer to 3.2 Error Codes for <message>.
SAMSUNG TECHWIN Co., Ltd.
59
CGI Specification for IP Surveillance Products
4.10. Video Streaming
The RTSP(Real Time Streaming Protocol) is a protocol for use in streaming media systems
[RFC2326]. It allows a client to remotely control a streaming media server. Commands are VCRlike commands such as “play” and “pause”, and allowing time-based access to files on a server.
4.10.1. RTSP Commands
Request Syntax
COMMAND URI RTSP/1.0
Headerfield1: val1
Headerfield2: val2
COMMAND
- DESCRIBE, OPTIONS, SETUP, PLAY, PAUSE, TEARDOWN, GET_PARMETERS
URI : rtsp://<server address>/<stream name>
*<server address> : host name or IP address
*<stream name> : mpeg4unicast, mpeg4multicast
Response Syntax
RTSP/1.0 ResultCode ResultString
Headerfield3: val3
Headerfield4: val4
Common Request Headerfield
Authorization : Authorization information from the client.
CSeq : Request sequence number.
Session : Session identifier.
Content-Length : Length of content.
Content-Type : The media type of content.
User-Agent : Information about the client that initiates the request.
Common Response Headerfield
CSeq : Response sequence number
Date : Date and time of the response
SAMSUNG TECHWIN Co., Ltd.
60
CGI Specification for IP Surveillance Products
4.10.2. Options
Request
CSeq : Response sequence number.
Example
OPTIONS rtsp://147.46.67.172:554/mpeg4unicast RTSP/1.0
CSeq: 1
User-Agent: VLC media player (LIVE555 Streaming Media v2008.11.13)
Response
Public : Specify the supported RTSP commands.
Example
RTSP/1.0 200 OK
CSeq: 1
Date: Tue, Jan 13 2009 11:46:16 GMT
Public: OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE
4.10.3. Describe
Request
Accept : List of content types that client supports.( application/sdp 만 지원한다.)
Authorization : Authorization information from the client.
Example
DESCRIBE rtsp://147.46.67.172:554/mpeg4unicast RTSP/1.0
CSeq: 2
Accept: application/sdp
User-Agent: VLC media player (LIVE555 Streaming Media v2008.11.13)
Response
Content-Base : Base URL of SDP description
Content-Type : Type of content
Content-Length : Length of SDP description
SAMSUNG TECHWIN Co., Ltd.
61
CGI Specification for IP Surveillance Products
Example
RTSP/1.0 200 OK
CSeq: 2
Date: Tue, Jan 13 2009 11:46:16 GMT
Content-Base: rtsp://192.168.0.24/mpeg4unicast/
Content-Type: application/sdp
Content-Length: 598
v=0
o=- 1231847147421026 1 IN IP4 192.168.0.24
s=Session streamed by "testOnDemandRTSPServer"
i=mpeg4unicast
t=0 0
a=tool:LIVE555 Streaming Media v2008.04.09
a=type:broadcast
a=control:*
a=x-qt-text-nam:Session streamed by "testOnDemandRTSPServer"
a=x-qt-text-inf:mpeg4unicast
m=video 0 RTP/AVP 96
c=IN IP4 0.0.0.0
a=rtpmap:96 MP4V-ES/90000
a=fmtp:96 profile-level-id=244;config=000001B0F4000001B50800000100000001
200086C5D4C28B021E0A4C00000001B25876694430303339
a=control:track1
m=audio 0 RTP/AVP 96
c=IN IP4 0.0.0.0
a=rtpmap:96 L16/8000/2
a=range:npt=0-27.648
a=control:track2
4.10.4. Setup
Request
Transport : Specify how the data stream is transported.
(For a mpeg4unicast session, RTP/AVP, RTP/AVP/TCP are supported,
and for a mpeg4multicast session, only RTP/AVP is supported)
SAMSUNG TECHWIN Co., Ltd.
62
CGI Specification for IP Surveillance Products
Example
SETUP rtsp://192.168.0.24/mpeg4unicast/track1 RTSP/1.0
CSeq: 3
Transport: RTP/AVP;unicast;client_port=47184-47185
User-Agent: VLC media player (LIVE555 Streaming Media v2008.11.13)
Response
Transport : Same as above
Session : session identifier
Example
RTSP/1.0 200 OK
CSeq: 3
Date: Tue, Jan 13 2009 11:46:16 GMT
Transport: RTP/AVP;unicast;destination=147.46.67.26;source=192.168.0.24;client_port=4718447185;server_port=6970-6971
Session: 1
4.10.5. Play
Request
Scale : Supported only when file playing(FF/REW)
Range : Supported only when file playing(start, end time)
Example
PLAY rtsp://192.168.0.24/mpeg4unicast/ RTSP/1.0
CSeq: 5
Session: 1
Range: npt=0.000User-Agent: VLC media player (LIVE555 Streaming Media v2008.11.13)
Response
Scale : Same as above
Range : Same as above(In case of live streaming, this value is set to 0)
RTP-Info : Information of the RTP stream
SAMSUNG TECHWIN Co., Ltd.
63
CGI Specification for IP Surveillance Products
Example
RTSP/1.0 200 OK
CSeq: 5
Date: Tue, Jan 13 2009 11:46:16 GMT
Range: npt=0.000Session: 1
RTP-Info:
url=rtsp://192.168.0.24/mpeg4unicast/track1;seq=28930;rtptime=975976654,url=rtsp://192.168.
0.24/mpeg4unicast/track2;seq=61172;rtptime=3946903863
4.10.6. Pause
Request
No specific headerfield is supported
Example
PAUSE rtsp://192.168.0.24/mpeg4unicast
CSeq: 6
Session: 1
Response
No specific headerfield is supported
Example
RTSP/1.0 200 OK
CSeq: 6
Date: Tue, Jan 13 2009 11:46:16 GMT
Session: 1
4.10.7. Teardown
Request
No specific headerfield is supported
Example
TEARDOWN rtsp://192.168.0.24/mpeg4unicast
SAMSUNG TECHWIN Co., Ltd.
64
CGI Specification for IP Surveillance Products
CSeq: 7
Session: 1
Response
No specific headerfield is supported
Example
RTSP/1.0 200 OK
CSeq: 7
Date: Tue, Jan 13 2009 11:46:16 GMT
4.10.8. Get Parameters
Request
No specific headerfiled is supported. (Used only for liveness check)
Example
GET_PARAMETERS
CSeq: 8
Session: 1
Response
No specific headerfield is sent.
Example
RTSP/1.0 200 OK
CSeq: 8
Date: Tue, Jan 13 2009 11:46:16 GMT
SAMSUNG TECHWIN Co., Ltd.
65
CGI Specification for IP Surveillance Products
5. Appendix
5.1. Appendix A: Available Frame Rates
In some models, valid frame rate range may vary dynamically depending on video configuration
of the device.
5.1.1. SNC-1300
SNC-1300 can operate either in 960P mode, or in 720P mode. The resolution of video source is
1280x960 in 960P mode, and 1280x720 in 720P mode. In 960P mode, max frame rate is
restricted to 20.
Mode
960P
720P
Mainstream
Mainstream
Resolution
1
2
Mainstream
Substream
Framerate
Framerate
Framerate
Framerate
(MPEG4)
(JPEG)
(MPEG4)
(JPEG)
1, 2, 5, 10
1, 2, 5
1, 2, 5, 10, 15, 20
1, 2, 5
15, 20
1
1, 2, 5, 10
1, 2, 5
4CIF
1, 2, 5, 10, 15, 20
1, 2, 5
1, 2, 5, 10, 15, 20
1, 2, 5
MEGA
1, 2, 5, 10
1, 2, 5
1, 2, 5, 10, 15, 20,
1, 2, 5
MEGA
Substream
25(, 30)
4CIF
15, 20, 25
1
1, 2, 5, 10, 15
1, 2, 5
1, 2, 5, 10, 15, 20,
1, 2, 5
1, 2, 5, 10, 15, 20,
1, 2, 5
25(, 30)
1
2
3
3
25(, 30)
The resolution of mainstream is mega(1280x960 / 1280x720) or 4CIF
The resolution of substream is always QCIF.
30 fps is available only in NTSC.
SAMSUNG TECHWIN Co., Ltd.
66
CGI Specification for IP Surveillance Products
5.1.2. SNP-3370/3370TH/3301/3301H
For SNP-3370/3370TH/3301/3301H, H.264 codec and MPEG4 codec are selectable. (JPEG
stream is always available)
For NTSC,
Codec
H.264
MPEG4
H.264/MPEG
H.264/MPEG
JPEG
4CIF Framerate
CIF/QCIF Framerate
4CIF/CIF/QCIF Framerate
1, 2, 5, 10, 15, 20
1, 2, 5, 10, 15, 20, 25, 30
1, 2, 5, 10, 15
25
1, 2, 5, 10, 15, 20, 25
1, 2, 5
30
1, 2, 5, 10
1, 2, 5
1, 2, 5, 10, 15, 20, 25, 30
1, 2, 5, 10, 15, 20, 25, 30
1, 2, 5, 10
H.264/MPEG
H.264/MPEG
JPEG
4CIF Framerate
CIF/QCIF Framerate
4CIF/CIF/QCIF Framerate
1, 2, 5, 10, 15
1, 2, 5, 10, 15, 20, 25
1, 2, 5, 10, 15
20
1, 2, 5, 10, 15, 20
1, 2, 5
25
1, 2, 5, 10
1, 2, 5
1, 2, 5, 10, 15, 20, 25
1, 2, 5, 10, 15, 20, 25
1, 2, 5, 10
For PAL,
Codec
H.264
MPEG4
SAMSUNG TECHWIN Co., Ltd.
67
CGI Specification for IP Surveillance Products
6. References
[RFC1945] T.Berners-Lee, R.Fielding, H.Frystyk, “Hypertext Transfer Protocol – HTTP/1.0”,
MAY. 1996
[RFC2616] R.Fielding, J.Gettys, J.Mogul, H.Frystyk, L.Masinter, P.Leach, T.Berners-Lee,
“Hypertext Transfer Protocol –HTTP/1.1”, June 1999
SAMSUNG TECHWIN Co., Ltd.
68

Similar documents

view - Hanwha Techwin

view - Hanwha Techwin • 16 : 9 HD (720p) resolution support • 4.45 ~ 89mm(20x) optical zoom, 16x digital zoom • H.264, MPEG-4, MJPEG multiple codec • PoE plus, SD memory, IP66, Bi-directional audio support

More information

Samsung-Sales - Hanwha Techwin America

Samsung-Sales - Hanwha Techwin America • Superior system compatibility : Multi protocols supports • OSD Menu, 3D joystick control • RS-485 and RS-422 compatibility

More information