Chapter 1. INTRODUCTION Chapter 1-1. Overview This document, HTTPAPI, specifies the HTTP-based application-programming interface (API) for Merit LILIN IP Fast Dome camera, Merit LILIN Internet Video Server, Merit LILIN Network Camera, and Merit LILIN DVR. Application developers can use this document to develop applications for Merit LILINs IP products. The HTTP-based camera interface provides the functionalities, for example, to request video images, to control device outputs (PTZ, output relay etc.), and to get and to set IP devices information.
Chapter 1.1. Firmware versions The support for this HTTPAPI document is highly dependent on the product release. Please make sure that the functions, you want, are provided by the release of your product.
Chapter 1.2. Product-specific functionality Some of the functions described in this specification may not be implemented in every IP-based product, and the set of the Common Gateway Interface (CGI) parameters and actual parameter values may differ among different products. At the end of each API function has product information for developers.
Chapter 1.4. Product Support List Full HD IP Camera Series, 2, 3, and 5 MP IPR733, IPR434, IPR742, IPR722, IPR320, IPG1022, IPD2122S
CMOS HD IP camera, SX Series, 720P IPR31ESX, IPD112ESX, IPG012ES, IPR414/8ES, IPR614ES, IPR712S
MOS HD IP camera, MX Series, 1.3MP IPR31EMX, IPR414/8EMX, IPR712M
Fast Dome/Mini Fast Dome, H.264 D1 series IP Fast Dome: JPEG Series PIH-7000/7600/7625/7622/7635 IP Series, JPEG
IP Fast Dome: 22X, 25X, 30X, 35X, H.264 D1 Series PIH-7622/PIH-7635IP IPS125X, IPS130X, IPS135X IPS025X, IPS030X, IPS035X
H.264 AVC IP Mini Dome, 03X, 12X, H.264 D1 series IPS203 IPS212x
LAN Camera IPD552, IP454X, IR, H.264 D1 series
Video Server PVS-1020, JPEG Series, VS012, H.264 D1 series MERIT LILIN CO., LTD 5
Chapter 2. HOW TO USE THIS MANUAL This section contains information about general usages of this document. Chapter 2.1. General notations Chapter 2.1.1. General abbreviations CGI : Common Gateway Interface a standardized way to communicate between a client (e.g., a web browser) and a server (e.g., a web server). N/A : Not applicable a feature/parameter/value is not used in a specific task.
Chapter 2.2. Convention of this document In URL syntax and in descriptions of CGI parameters, text in italic within angle brackets denotes that is to be replaced with either a value or a string. When replacing the text string, the angle brackets shall also be replaced.
Chapter 2.3 HTTP status returned codes The built-in Web server uses the standard HTTP status codes. The syntax of returned HTTP status is as following format: HTTP/1.0 <HTTP code> <HTTP text> \r\n HTTP code and text meanings are described as the followings:
HTTP Code HTTP Text Description 200 OK The request has succeeded. 204 No Content Server has received the request but there is no information returned, and the client should stay in the same document view. This is mainly to allow inputting scripts without changing the document at the same time. 400 Bad Request The request had bad syntax or was inherently impossible to be satisfied. 401 Unauthorized The parameter to this message gives a specification of authorization schemes that are acceptable. The client should retry the request with a suitable Authorization header. 403 Forbidden The request is for an action that is forbidden. 404 Not Found The server has not found anything matching the given URL. MERIT LILIN CO., LTD 6
Chapter 3. HTTP API Chapter 3.1. Image and video request URLs There are two different ways to request images from Merit LILINs IP Fast Dome, LAN camera, and video serversnapshot (JPEG) and server-push (MJPEG). Snapshot: 1. Client connects to server. 2. Client sends snapshot image request to server. 3. Server accepts the request with snapshot content type. 4. Server sends one image to client. 5. Client receives one image. 6. Server actively closes the connection. 7. Go back to step 1 if client needs more video. Server-push: 1. Client connects to server. 2. Client sends server-push image request to server. 3. Server accepts the request with server-push content type. 4. Server sends one image to client with server-push boundary. 5. Client receives one image. 6. If more video is needed, go back to step 4; if no video is needed, continue step 7, Client actively closes the connection. Please note there is no need to make request every time for server-push method, because it reduces network traffic and eliminates socket re-creation. Its more efficient.
Chapter 3.1.1. JPEG image (snapshot) When a jpeg image is requested, the server either returns the specified JPEG image file or an image with an error image (No Video | Not Permission | Not available). Syntax: http://< serverIP >/snap<camid><image size>
Parameter Values Description <camid> 1~4 It ranges from 1 to 4 of video source(s). QUAD QUAD returns to quad display. <image size> qsif sif full vga 720p 176 by 112 in NTSC and 176 by 144 in PAL. 352 by 240 in NTSC and 352 by 288 in PAL. The biggest image size of the IP camera. 640 by 384 for SX series 1280 by 768 for SX series MERIT LILIN CO., LTD 7
Example: Request JPEG image from video input with sif size. http://192.168.0.200/snap1sif Return: Requested JPEG image of camera number 1 in CIF resolution.
Example: Requested JPEG image HTTP/1.0 200 OK\r\n Content-Type: image/jpeg\r\n Content-Length: 8567\r\n \r\n <JPEG image data which start with 0xffd8 and end with 0xffd9>\r\n
Chapter 3.1.2. MJPEG video (server-push) When an MJPG video is requested, the server either returns continuous flow of jpeg images or an image with an error image (No Video | Not Permission | Not available) returned. The content type is multipart/x-mixed-replace and each image ends with a boundary string <boundary>. The returned image and HTTP data are equal to the request for a single JPEG image. Syntax: http://<serverIP>/getimage?camera=<camera id>&fmt=<image size>&delay=<delay>&id=<script ID>
Note: For D1 series, only 1 FPS CIF (SIF) is supported MERIT LILIN CO., LTD 8
Parameter Values Description <camera id> 1,2,3,4 Select video source; omitted default is 1. <iamge size> qsif sif full vga 720p 176 by 112 in NTSC and 176 by 144 in PAL. 352 by 240 in NTSC and 352 by 288 in PAL. The biggest image size of the IP camera. 640 by 384 for SX series 1280 by 768 for SX series <delay> 0~(2 32 -1) Specify delay between frames, unit in 10ms, omitted default is 0. Its useful for network bandwidth control.
Note: HD model does not support this feature. <script ID> 0~9 Specify http action node identification, and omitted default is to send continuous MJPEG images. If there is any matching id in programming script and the script is started, the MJPEG stream will pause until http action node triggered. Please refer to Event Script Programmers Guide for detail.
Example: Request JPEG image stream from the 2 nd camera with sif resolution http://192.168.0.200/getimage?camera=0&fmt=sif Return: Requested Multipart JPEG image
Stamp: Time stamp, of which format is with Date, Time, Tick, and Sequence-number
Field Bits Example Date: Year, A.D. 31-16 07d2=2002 AD Month (1~12) 15-8 04=Apr Day (1~31) 7-0 01=First Time: Hour (0~23) 31-16 0011=17 hr Minute (0~59) 15-8 36=54 min Second (0~59) 7-0 0e=14 sec Tick: Ticks(0~99) 7-0 09=90 ms from last sec. Seq: Seq (0~2 32 -1) 31-0 84b=2123 images since server start MERIT LILIN CO., LTD 9
Chapter 3.1.3. H.264 video Please see chapter 4 for detail.
Chapter 3.2. Clock adjustment Adjust or read the server clock.
Chapter 3.2.1. Clock time request This function requests time from Merit LILIN IP cameras, video servers, or IP PTZ cameras Syntax: http://<serverIP>/getclock
Example: Request time from the server http://192.168.0.200/getclock Return: Requested time from the server
HTTP/1.0 200 OK\r\n Date: Thu, 01 Jan 1970 00:00:00 GMT\r\n Connection: close\r\n Content-Type: text/html\r\n Content-Length: 42\r\n \r\n hr=1\n min=20\n sec=38\n mn=1\n date=26\n year=2000\n You can try the CGI function with the browser. MERIT LILIN CO., LTD 11
The source of the HTML page is on the notepad. Its the returned values that you request via the CGI command.
Chapter 3.2.2. Clock time adjust Syntax: http://<serverIP> /setclock?Time=<hour>:<minute>:<second>:&Date=<year>/<month>/<date>
Parameter Values Description <hour> 1~ 23 Hour <min> 1~59 Minute <sec> 1~59 Second <month> 1~12 Month <date> 1~30 Date <year> 0000~9999 Year
Example: Request time from the server
Chapter 3.2.3. Serial port configuration Chapter 3.2.3.1. Configuration setup Set serial port configuration including COM port, baud rate, and data settings. Syntax: http://<serverIP>/setserial[?<parameter>=<value>[&<parameter>=<value>]]
Parameters: MERIT LILIN CO., LTD 12
Parameter Values Description port=<int> 1,2 The COM port is selected with this parameter. mode=<string> RS485 / RS232 The serial mode of selected COM port. usage=<int> 2 Reserved. It must be 2. baud=<int> 300,600,1200,2400,4800,9600,38400 The baud rate of baud rate. data=<int> 4~8 Data bits. parity=<int> 0,1 Set to 1 if Parity check is enabled; otherwise, 0 is disabled.. stop=<int> 1, 2 Stop bits.
Device Supported: PIH-7000/7600/7625 IP Series VS-1000S, and PIH-1000S
Chapter 3.2.3.2. Configuration query This feature requests serial port configuration. Syntax: http://<serverIP>/getserial?port=<port_id> Parameters: Parameter Values Description < port_id > 1,2 COM1 or COM2
Return: Requested serial port configuration HTTP/1.0 200 OK\r\n Date: Thu, 01 Jan 1970 00:00:00 GMT\r\n Connection: close\r\n Content-Type: text/html\r\n Content-Length: 124\r\n \r\n Port=<port>\n Serial Mode=<serial mode>\n Usage=<usage>\n Baud Rate=<baud rate>\n Data Bits=<data bits>\n Parity=<parity check>\n Stop Bits=<stop bits>\n
Example: Request the serial port configuration http://192.168.0.200/getserial?port=2 MERIT LILIN CO., LTD 13
Return: Requested serial port configuration HTTP/1.0 200 OK\r\n Date: Thu, 01 Jan 1970 00:00:00 GMT\r\n Connection: close\r\n Content-Type: text/html\r\n Content-Length: <content_length>\r\n \r\n Port=COM2\n Serial Mode=RS485\n Usage=Generic\n Baud Rate=9600\n Data Bits=8\n Parity=None\n Stop Bits=1\n
Device Supported: PIH-7000/7600/7625 IP Series VS-1000S, and PIH-1000S
Chapter 3.3. Serial port transmission This section describes the serial port data transmission including sending and receiving actions. Syntax: http://<serverIP>/serial[?<parameter>=<value>[&<parameter>=<value>]]
Parameters:
Parameter Values Description port=<int> 1,2 The COM port is selected with this parameter. write=<string> Hex string of ASCII code, e.g. write=414243 as ABC The string going to send through RS232/485 port. read=<int> 0..128 The string length expected to receive.
Example: Send string Hello to com2. http://192.168.0.200/serial?port=2&write=48656c6c6f Example: Send string Hello and wait for 5 characters from com2. http://192.168.0.200/serial?port=2&write=48656c6c6f&read=5
Note: The read function will response as #HexAscII# format, e.g. above example replies #41#42#43#44#45# when receiving ABCDE from com2. The read function expects to receive data within 500ms cycle, if it can not receive specific length of MERIT LILIN CO., LTD 14
string in this period. An error is responded such as Error 00000001.
Device Supported: PIH-7000/7600/7625 IP Series VS-1000S, PIH-1000S, H.264 AVC IP Fast Dome, H.264 AVC IP Mini Dome, IP454X, VS012
Chapter 3.4. Server device configuration Chapter 3.4.1. Server configuration setting Set servers configuration. Syntax: http://<serverIP>/setserver[?<parameter>=<value>[&<parameter>=<value>]]
Parameters:
Parameter Values Description device name=<string> <characters> The server name owner name=<string> <characters> The owner name owner email=<string> <characters> The E-mail address of the owner configuring camera at least once=<int> 0,1 Deprecated MAC address=<string> <characters> The MAC address of the server (read-only) logoEnable=<int> 0,1 Shows/hides the logo: 0=hide, 1=show. logo file name=<string> <characters> The file name of the logo image software Version=<string> <characters> The firmware version Revision=<string> <characters> Revision date (read-only) Model=<int> 2, 3 2 PVS1020, 3 PDR-400IP, Language=<int> 0,1 Select UI language. 0=English, 1=Traditional Chinese. javamode=<int> 0,1 0=Browsing live video using ActiveX (default). 1=Browsing live video using Java Applet. framedelay =<int> 0~65535 Its a global frame delay setting. There is also additional option of image to request CGI to achieve individual channel delay control, e.g. http://IP/getimage?camera=1&fmt=sif&framedelay={int}. 0 = No frame delay (default) Note: If image request got frame downer email=elay parameter, it would override global setting. Also, if there got frame delay parameter in Event system (HTTP action), it would override image request setting The priority of frame delay is Event>ImageRequest>Global Setting. DhcpEnable =<int> 0,1 Set the server using DHCP to get dynamic IP Address. 0=Disable, 1=Enable. Example: Set the server name to webcam1, owner to Merit LILIN, owner E-mail to test@meritlilin.com, enable logo display, set the file name of logo image to abc.gif, and set to use English language. MERIT LILIN CO., LTD 15
http://192.168.0.200/setserver?device name=webcam1&owner name=Merit Li-Lin&owner email=service@meritlilin.com&logoEnable=1&logo file name=merit.gif&Language=0 Device Supported: PIH-7000/7600/7625 IP Series VS-1000S, PIH-1000S
Chapter 3.4.2. Server configuration request Request servers configuration. Syntax: http://<serverIP>/server
Example #1: Request the server configuration http://192.168.0.200/server Return: Requested server configurations
HTTP/1.0 200 OK\r\n Date: Thu, 01 Jan 1970 00:00:00 GMT\r\n Connection: close\r\n Content-Type: text/html\r\n Content-Length: 244\r\n \r\n device name=webcam1\n owner name=merit\n owner email=service@domain.com\n configuring camera at least once=1\n MAC address=00-04-29-00-81-e0\n logoEnable=1\n logo file name=merit.gif\n Software Version=1.15\n Revision=0123.1630\n Model=0\n Language=0\n javamode=0\n framedelay=0\n DhcpEnable=0\n
Parameter Values Description save=<int> 0,1 Save the configurations to EEPROM. 0=no, 1=yes. IP address=<string> <characters> IP address of the server. subnet mask=<string> <characters> Subnet mask for the server domain. web server IP=<string> <characters> Deprecated. web server name=<string> <characters> Deprecated. dns1=<string> <characters> The 1st DNS server. dns2=<string> <characters> The 2nd DNS server dns3=<string> <characters> The 3rd DNS server gateway=<string> <characters> The gateway of the domain. http_port=<int> 1~65535 The Http connection port number.
Example: Set the server IP address to 192.168.0.129, subnet mask to 255.255.255.0, the 1st DNS server to 192.168.0.1, 2nd DNS server to 0.0.0.0, 3rd DNS server to 0.0.0.0, gateway to 192.168.0.254, and the Http connection port to 3080. http://192.168.0.200/setnetwork?save=1&IP address=192.168.0.200&subnet mask=255.255.255.0&dns1=192.168.0.1&dns2=0.0.0.0&dns3=0.0.0.0&gateway=192.168.0.254 &http_port=3080 Chapter 3.5.2. Network configuration request Syntax: http://<serverIP>/network
Example #1: request the network configuration http://192.168.0.200/network MERIT LILIN CO., LTD 17
Return: Requested network configurations
HTTP/1.0 200 OK\r\n Date: Thu, 01 Jan 1970 00:00:00 GMT\r\n Connection: close\r\n Content-Type: text/html\r\n Content-Length: 124\r\n \r\n IP address=192.168.0.200\n subnet mask=255.255.255.0\n web server IP=236.160.238.0\n web server name=www.meritlilin.com\n dns1=192.168.0.1\n dns2=0.0.0.0\n dns3=0.0.0.0\n gateway=192.168.0.254\n http_port=3080\n
Example #2: HTTP/1.0 200 OK\r\n Date: Thu, 01 Jan 1970 00:00:00 GMT\r\n Connection: close\r\n Content-Type: text/html\r\n Content-Length: 124\r\n \r\n IP address=192.168.0.200\n subnet mask=255.255.255.0\n dns1=192.168.0.1\n dns2=0.0.0.0\n gateway=192.168.0.254\n http_port=3080\n
Chapter 3.6. User configuration Chapter 3.6.1. User configuration setting Syntax: http://<serverIP>/setusers[?<parameter>=<value>[&<parameter>=<value>]]
Parameters:
Parameter Values Description tag=<int> 1,2,3,4 Command type: 1=add, 2=modify, 3=delete, 4=who am I. name=<string> <characters> User name password=<string> <characters> Password priority=<int> 0,..,100 Deprecated admin checked=<int> <characters> Administration permission 0=disable, 1=enable see image=<int> 0,1 Deprecated see video=<int> 0,1 Deprecated MERIT LILIN CO., LTD 18
change param=<int> 0,1 Permission to change the Image type (Full, SIF, or QSIF) 0=disable, 1=enable see source1=<int> 0,1 Permission to see video source 1 0=disable, 1=enable see source2=<int> 0,1 Permission to see Video source 2 0=disable, 1=enable see source3=<int> 0,1 Permission to see Video source 3 0=disable, 1=enable see source4=<int> 0,1 Permission to see Video source 4 0=disable, 1=enable see source_all=<int> 0,1 Permission to see the 4-split Video 0=disable, 1=enable
Example: Add a user with name=admin and password=admin. Set this user with administration permission, change image type permission, see video 1 to 4, and see 4-split video permission. http://192.168.0.200/setusers?tag=1&name=admin&password=admin&admin checked=1&change param=1&see source1=1&see source2=1&see source3=1&see source4=1&see source_all=1 Device Supported: PIH-7000/7600/7625 IP Series VS-1000S, PIH-1000S
Chapter 3.6.2. User configuration request Syntax: http://<serverIP>/users
Example: Request the user configuration http://192.168.0.200/users Return: Requested user configurations
see video=0\n change param=1\n see source1=1\n see source2=1\n see source3=1\n see source4=1\n see source_all=1\n name=guest\n password=guest\n priority=0\n admin checked=0\n see image=0\n see video=0\n change param=1\n see source1=1\n see source2=1\n see source3=1\n see source4=1\n see source_all=1\n
Chapter 3.7. Video configuration Chapter 3.7.1. Video configuration settings Set video configuration. Syntax: http://<serverIP>/setvideo[?<parameter>=<value>[&<parameter>=<value>]]
Parameters:
Parameter Values Description save=<int> 0,1 Save the configurations to EEPROM. 0=no, 1=yes VideoID=<int> 1,..,5 Specify which video channel will be set. 1=video1, 2=video2, 3=video3, 4=video4, 5=all the video channels JPEG Quality =<int> 1,..,30
20,..,80
1,..,80 (1~20:Low) (21~40:Medium) (41~80:High)
Lower value means Higher Quality and smaller size
Lower value means Higher Quality and smaller size(H.264 D1 IP camera)
Lower value means Higher Quality and smaller size(H.264 HD IP camera) BitmapEnable=<int> 0,1 Show / hide bitmap display. 0=hide, 1=show BitmapX=<int> 0,..,703 The X coordinate of the location of bitmap (valid value depends on the image size) BitmapY=<int> 0,..,479 The Y coordinate of the location of bitmap (valid value depends on the image size) MERIT LILIN CO., LTD 20
BitmapTime=<int> 0,1 Show/hide time on bitmap. BitmapTextEnable=<int> 0,1 Show/hide text on bitmap. BitmapText=<string> <characters> Text to show on the bitmap. If the text = null, it will not be shown. <characters>,the characters must in the subset: {{0,..,9},{a,..,z},{A,..,Z}}. ptz_model=<int> 0,..,5 Specify what kind of ptz camera is connected on the channel. 2=Lilin series profilename= <characters> Streaming profile name (H.264 HD IP camera) reboot=<int> 0,1 1:reboot
Example: Set the video channel 1 to display time on the bitmap at position (5,5), and the JPEG compression level to 20. The connected camera is Merit LILIN series. http://192.168.0.200/setvideo?save=1&VideoID=1&BitmapEnable=1&Bitmap Time=1 &BitmapX=0& BitmapY=0&ptz_model=2
Device Supported: PIH-7000/7600/7625 IP Series VS-1000S, PIH-1000S
Example: Set D1 IP Camera series for JPEG Quality
http://192.168.0.200/setvideo?JPEG Quality=80
Device Supported: H.264 AVC IP Fast Dome, H.264 AVC IP Mini Dome, IP454X, VS012
Chapter 3.7.2. Video configuration request Get video configuration. Syntax: http://<serverIP>/video
Example: Request the user configuration http://192.168.0.200/video Note: For HD IP camera, reboot is required for changing quality and frame rate of JPEG streaming., MERIT LILIN CO., LTD 21
Chapter 3.7.2.2. Set video configuration setting for H264 or JPEG Set H.264 AVC video configuration. Syntax: Note: JPEG does not have vbr/cbr and bitrate setting in our H.264 HD IP camera MERIT LILIN CO., LTD 22
Parameter Values Description vbrcbr =<int> 0/1 0:CBR,1:VBR bitrate =<int> (56~1024*3)*0.8 128~5120 Kbps Bit rate of connection.(H.264 D1 IP camera) Bit rate of connection (H.264 HD IP camera) gop =<int> 0~1 Parameter of successive B frame (H.264 D1 IP camera) Iframeperiod=<int> 5~40 I frame period (H.264 D1 IP camera) outrate =<int> 5~30 Parameter of frame rate. H264720P: 5~20 H264VGA: 5~25 JPEG720P: 1~10 JPEGVGA: 1~10 (H.264 HD IP camera) videoinresolution=<int> 0, 2,
2, 3, 4 Video Input Resolution : 0=Full D1, 2=CIF (H.264 D1 IP camera) Video Input Resolution : 2=CIF, 3=VGA, 4=720P (H.264 HD IP camera) entropy =<int> 0/1 Entropy coding mode: CAVLC/CABAC (H.264 D1 IP camera) deinterlace =<int> 0~6 VLC De-interlace (H.264 D1 IP camera) resolution =<int> 0/1 Client display default resolution:0=Full D1,1=CIF (H.264 D1 IP camera) profile=<int> 0/1 0=Baseline, 1=Main (H.264 D1 IP camera) level=<int> 0~8 0=Level 1, 1=Level 1b, 2=Level 1.1, 3=Level 1.2 4=Level 1.3, 5=Level 2, 6=Level 2.1, 7=Level 2.2, 8=Level 3 (H.264 D1 IP camera) Compression=<int> 0/1 0: JPEG, 1:H.264 (H.264 HD IP camera)
Profilename=<string> <characters> Streaming profile (H.264 HD IP camera) quality=<int> 0,1,2 0: High, 1: Medium, 2: Low (H.264 HD IP camera) reboot=<int> 0/1 1=reboot
Example: Set profile H264720P CBR at 5MBps bitrate,10 frame rate, and 720P resolution for H.264 http://192.168.0.200/setstreaming?vbrcbr=0&bitrate=5120&outrate=10&videoinresolution=4&co mpression=1&profilename=H264720P&reboot=0
http://192.168.0.200/setstreaming?reboot=1 http://192.168.0.200/setstreaming?profilename=JPEG720P&vbrcbr=0&outrate=5&bitrate=3072 &quality=0&reboot=1 Note: For HD IP camera, reboot is required for changing frame rate, bitrate, and resolution of H.264 streaming, Reboot is required for changing quality and frame rate of JPEG streaming., MERIT LILIN CO., LTD 23
http://192.168.0.200/setstreaming?profilename=JPEGVGA&vbrcbr=0&outrate=10&bitrate=2048 &quality=0&reboot=1 Device Supported: , H.264 AVC IP Fast Dome, H.264 AVC IP Mini Dome, IP454X, VS012, IPR31ESX, IPD112ESX, IPG012ES, IPR414ES, IPR614ES, IPR712S
Chapter 3.7.2.3 Set video flip Set video Filp. Syntax: http://<serverIP>/ flip
Chapter 3.8. PTZ configuration Chapter 3.8.1. PTZ commands Send the PTZ command. Syntax: http://<serverIP>/control[?<parameter>=<value>[&<parameter>=<value>]] Parameters: Parameter Values Description camid=<int> 1~4 Camera channel for pan, tilt, or zoom panpos=<int> 0~19199 Parameter of pan control to a absolute position 0~12799 Parameter of pan control to a absolute position (IPS0/1 Series) 0~15999 Parameter of pan control to a absolute position (IPS2/3 Series) tiltpos=<int> 1120~6560 Parameter of tilt control to a absolute position 467~2734 Parameter of tilt control to a absolute position (IPS0/1 Series) Note: For HD and later LILIN IP products, LILIN adopts RTSP for JPEG and H.264 streaming. Please chapter #4 for detail. MERIT LILIN CO., LTD 24
0~3999 Parameter of tilt control to a absolute position (IPS2/3 Series) zoompos=<int> 25~1197 Parameter of zoom control to a absolute position 64~2465 Parameter of zoom control to a absolute position (IPS025/125) 64~2520 Parameter of zoom control to a absolute position (IPS030/130) 64~2548 Parameter of zoom control to a absolute position (IPS035/135) 0~782 Parameter of zoom control to a absolute position (IPS203/303) 64~1334 Parameter of zoom control to a absolute position (IPS212/312) rpan=<int> -7~7 Pan relatively (positive value means pan right) rtilt=<int> -7~7 Tilt relatively (positive value means tilt Up) rzoom=<int> -7~7 Zoom relatively (positive value means zoom In) rotate=1 1 Rotate 180 stop 1 Stop relative Pan panposdegree=<int> 0~359 Pan degree tiltposdegree=<int> 0~90 Tilt degree zoomposdegree=<int> 1~35 Zoom degree cmd=getpanposdegree Get pan degree cmd=gettiltposdegree Get tilt degree cmd=getzoomposdegree Get zoom degree cmd=getallposdegree Get pan degree,tilt degree and zoom degree
Example: Set the camera 1 to pan right with speed 7 without stop. http://192.168.0.200/control?camid=1&rpan=7 Example: Set the camera 1 to stop. http://192.168.0.200/control?stop=1 Example: Set the camera 1 to pan right with speed 7 and stop. http://192.168.0.200/control?camid=1&rpan=7&stop=1 Example: Set the camera 1 to pan to position 33. http://192.168.0.200/control?camid=1&panpos=1911 Example: Set camera 1 to zoom out relatively. http://192.168.0.227/control?rzoom=-3 Example: Set camera 1 to zoom out a bit and then stop zooming immediately. http://192.168.0.227/control?rzoom=3&stop=1 Example: Set camera 1 to pan 180 degree, tilt 45 degree, zoom 10. MERIT LILIN CO., LTD 25
http://192.168.0.227/control?panposdegree=180&tiltposdegree=45&zoomposdegree=10 Example: Get camera 1 pan, tilt and zoom degree. http://192.168.0.227/control?cmd=getallposdegree Device Supported: H.264 AVC IP Fast Dome, H.264 AVC IP Mini Dome, VS012
Chapter 3.8.2. PTZ preset setting Set the PTZ preset points command. Syntax: http://<serverIP>/ptzpreset[?<parameter>=<value>[&<parameter>=<value>]]
Parameters:
Parameter Values Description camid=<int> 1~4 Camera number for preset settings goto_preset=<int> 0,..,19 Goto a preset position according to the preset number. set_preset=<int> 0,..,19 Assign a preset number to a preset position. set_presetname=<string> <characters> Assign a preset name to a preset position. rem_preset =<int> 0,..,19 Remove a preset name according the preset number. autopan 0/1 0: stop auto pan/1: start auto pan
Example: Set camera 1 to go to preset point 3. http://192.168.0.200/ptzpreset?camid=1&goto_preset=3 Example: Set the name door to the preset point 11. http://192.168.0.200/ptzpreset?camid=1&goto_preset=11 http://192.168.0.200/ptzpreset?camid=1&set_preset=11&set_presetname=door Example: Remove a preset name according the preset point 5. http://192.168.0.200/ptzpreset?camid=1&rem_preset=5 Device Supported: H.264 AVC IP Fast Dome, H.264 AVC IP Mini Dome, VS012
Parameter Values Description iris=<int> 1,-1 Iris relatively (positive value means Iris large) autoiris=<int> 1 Set auto iris. focus=<int> 1,-1 Focus relatively (positive value means Focus far) autofocus=<int> 1 Set auto focus.
Example: Set camera 1 to iris large http://192.168.0.200/camera?iris=1 http://192.168.0.200/control?stop=1 Example: Set camera 1 to focus near. http://192.168.0.200/camera?focus=-1 http://192.168.0.200/control?stop=1 Example: Set camera 1 to auto iris. http://192.168.0.200/camera?autoiris=1 Chapter 3.8.4. PTZ command set for PIH-7000/7600/7625IP, VS-1000S, and PIH-1000S Action Command Example Up v1_TU_01 http://192.168.0.200/cgi/ptz?camid=1&cmd=v1_TU_01 Down v1_TD_01 http://192.168.0.200/cgi/ptz?camid=1&cmd=v1_TD_01 Left v1_PL_01 http://192.168.0.200/cgi/ptz?camid=1&cmd=v1_PL_01 Right v1_PR_01 http://192.168.0.200/cgi/ptz?camid=1&cmd=v1_PR_01 Up-Right v1_TUPR_01 http://192.168.0.200/cgi/ptz?camid=1&cmd=v1_TUPR_01 Down-Right v1_TDPR_01 http://192.168.0.200/cgi/ptz?camid=1&cmd=v1_TDPR_01 Up-Left v1_TUPL_01 http://192.168.0.200/cgi/ptz?camid=1&cmd=v1_TUPL_01 Down-Right v1_TDPL_01 http://192.168.0.200/cgi/ptz?camid=1&cmd=v1_TDPL_01 Zoom In v1_ZI http://192.168.0.200/cgi/ptz?camid=1&cmd=v1_ZI Zoom Out v1_ZO http://192.168.0.200/cgi/ptz?camid=1&cmd=v1_ZO Rotate 180 v1_Flip http://192.168.0.200/cgi/ptz?camid=1&cmd=v1_Flip Iris (+) v1_IL http://192.168.0.200/cgi/ptz?camid=1&cmd=v1_IL Iris (-) v1_IS http://192.168.0.200/cgi/ptz?camid=1&cmd=v1_IS Focus(+) v1_FR http://192.168.0.200/cgi/ptz?camid=1&cmd=v1_FR Focus(-) v1_FN http://192.168.0.200/cgi/ptz?camid=1&cmd=v1_FN Autopan v1_AUTO_START http://192.168.0.200/cgi/ptz?camid=1&cmd=v1_AUTO_START MERIT LILIN CO., LTD 27
AutopanStop v1_AUTO_STOP http://192.168.0.200/cgi/ptz?camid=1&cmd=v1_AUTO_STOP Preset1 v1_goPreset_00 http://192.168.0.200/cgi/ptz?camid=1&cmd=v1_goPreset_00 Preset2 v1_goPreset_01 http://192.168.0.200/cgi/ptz?camid=1&cmd=v1_goPreset_01 Preset3 v1_goPreset_02 http://192.168.0.200/cgi/ptz?camid=1&cmd=v1_goPreset_02 Preset4 v1_goPreset_03 http://192.168.0.200/cgi/ptz?camid=1&cmd=v1_goPreset_03 Clear Preset v1_clearAllPre http://192.168.0.200/cgi/ptz?camid=1&cmd=v1_clearAllPre Set Group 1 v1_setPGroup_1 http://192.168.0.200/cgi/ptz?camid=1&cmd=v1_setPGroup_1 Set Group 2 v1_setPGroup_2 http://192.168.0.200/cgi/ptz?camid=1&cmd=v1_setPGroup_2 Set Group 3 v1_setPGroup_3 http://192.168.0.200/cgi/ptz?camid=1&cmd=v1_setPGroup_3 Set Group 4 v1_setPGroup_4 http://192.168.0.200/cgi/ptz?camid=1&cmd=v1_setPGroup_4 SetPreset Vl_setPreset http://192.168.0.200/cgi/ptz?camid=1&cmd=v1_setPreset
Device Supported: PIH-7000/7600/7625 IP Series VS-1000S, PIH-1000S Chapter 3.8.5. PTZ preset setting request Request the PTZ preset settings. Syntax: http://<serverIP>/ptzpreset
Chapter 3.8.6. ROI adjustment Set region of interest cropping window. Please make sure that the ROI feature is enabled. For ROI mode, streaming #1 is used for main streaming. The rest of streaming 2, 3, and 4 can be cropped based on streaming #1 MERIT LILIN CO., LTD 28
Parameters: Parameter Values Description streamno=<int> 2, 3, 4 Streaming #2, #3, and #4 dptzdirect =<int> 1 Enable direct positioning digital PTZ based on X and Y coordinates. dptzx =<int> 0~319/0~719 Cropping start X position of the streaming resolution dptzy =<int> 0~239/0~479 Cropping start Y position of the streaming resolution Dptzw =<int> 0~319/0~719 Cropping width of the streaming resolution Dptzh = <int> 0~239/0~479 Cropping height of the streaming resolution Example: Crop the video on streaming #2 at D1 (720 * 480) resolution starting at 6 pixel of the x direction with width 703 pixel and starting at 4 pixel of the y direction with 467 height.
Example: Disable ROI feature on streaming #2 and return to home position. http://<serverIP>/control?home=1&streamno=2
MERIT LILIN CO., LTD 29
Device Supported: IPR733, IPR434, IPR742, IPR722, IPR320, IPG1022 Chapter 3.9. System functions Chapter 3.9.1. Reboot server Reboot the server. Syntax: http://<serverIP>/control?reboot=1
Example: Request the server to reboot. http://192.168.0.200/reboot Chapter 3.9.2. Factory default Restore configurations to factory default. Syntax: http://<serverIP>/factorydefault
Example: Request the server to load factory default. http://192.168.0.200/factorydefault Chapter 3.9.3. Video quality adjustment Syntax: http://<serverIP>/camctrl[?<parameter>=<value>[&<parameter>=<value>]] Parameters: Parameter Values Description cmd=<string> set,get,camstat It is necessary to choose what kind of command: set=set the video quality settings. get=get the video quality settings. camstat=return the format of the connected video. (0=No Video, 1=NTSC, 2=SECAM, 3=PAL) camid=<int> 1~4 Camera source to be adjusted contrast=<int> -100~100 -50~50
-50~50
Contrast level adjustment which default value is 0 Contrast level adjustment which default value is 7 (H.264 D1 IP camera) Contrast level adjustment which default value is 0 (H.264 HD IP camera) MERIT LILIN CO., LTD 30
bright=<int> -100~100 -50~50
-50~50 Brightness level adjustment which default value is 0 Brightness level adjustment which default value is -5 (H.264 D1 IP camera) Brightness level adjustment which default value is 0 (H.264 HD IP camera) hue=<int> -100~100 -50~50
-50~50
Hue level adjustment which default value is 0 Hue level adjustment which default value is 0 (H.264 D1 IP camera) Hue level adjustment which default value is 0 (H.264 HD IP camera) Saturation=<int> -100~100 -50~50
-50~50 Saturation level adjustment which default value is 0 Saturation level adjustment which default value is 0 (H.264 D1 IP camera) Saturation level adjustment which default value is 0 (H.264 HD IP camera) Sharpness=<int> 0~15 0~31 Sharpness level adjustment which default value is 5 Sharpness level adjustment which default value is 16 (H.264 HD IP camera) framedelay=<int> 0~(2 32 -1) Set delay time between frames. The unit is in 10m and the default value is 0. ptzid=<int> 1~255 Control ID of PTZ device. By default, video-1 will be assigned to ptz-1, video-2 to ptz-2, etc. (not applicable to IP speed dome).
Example: Set the video quality of video channel 1.to default values. http://192.168.0.200/camctrl?cmd=set&camid=1&contrast=0&bright=0&hue=0&saturation=0 Example: Request the video quality of video channel 1. http://192.168.0.200/camctrl?cmd=get&camid=1 Return: Requested PTZ preset settings
Example: Request the video format. http://192.168.0.200/camctrl?cmd=camstat Return: Requested video format Syntax: http://<serverIP>/quality[?<parameter>=<value>[&<parameter>=<value>]] Parameters: Parameter Values Description cmd=<string> set,get It is necessary to choose what kind of command: set=set the video quality settings. get=get the video quality settings. DayNight=<int> 0,1
Set day quality is 0 Set night quality is 1 EV=<int> 1~16 Exposure Value WDR=<int> 0,1 0=Off, 1=On BLC=<int> 0,1 Back-light Compensation 0=off, 1=On ShutterLimitmin=<int> 30~8000 Shutter Limit(sec): Min 30=1/30, 50=1/50, 60=1/60, 100=1/100, 120=1/120, 160=1/160, 200=1/200, 240=1/240, 320=1/320, 400=1/400, 480=1/480, 640=1/640, 800=1/800, 1000=1/1000, 1600=1/1600, 2000=1/2000, 3000=1/3000, 4000=1/4000, 6000=1/6000, 8000=1/8000 ShutterLimitmax=<int> 30~8000 Shutter Limit(sec): Max 30=1/30, 50=1/50, 60=1/60, 100=1/100, 120=1/120, 160=1/160, 200=1/200, 240=1/240, 320=1/320, 400=1/400, 480=1/480, 640=1/640, 800=1/800, 1000=1/1000, 1600=1/1600, 2000=1/2000, 3000=1/3000, 4000=1/4000, 6000=1/6000, 8000=1/8000 AGC=<int> 1~6 Auto Gain Control 1=2x(6dB), 2=4x(12dB), 3=8x(18dB), 4=16x(24dB), MERIT LILIN CO., LTD 32
5=32x(30dB), 6=64x(36dB) NoiseReduction=<int> 0~32 3D Noise Reduction SenseUp=<int> 0~4 Sense Up 0=Off, 1=1 frame, 2=2 frames, 3=3 frames,4=7 frames AWB=<int> 0~6 White Balance Control 0=Auto, 1=Tungsten, 2=Fixed Indoor, 3=Fixed Fluorescents 1, 4=Fixed Fluorescents 2, 5=Fixed Outdoor1, 6=Fixed Outdoor2 MIRROR=<int>
Example: Set the video quality . http://192.168.0.200/quality?cmd=set&DayNight=0&EV=7&WDR=1&BLC=0&ShutterLimitmin=8 000&ShutterLimitmax=30&AGC=2&NoiseReduction=2&SenseUp=0&AWB=0&MIRROR=0&FLI P=0 Example: Request the video quality. http://192.168.0.200/quality?cmd=get&DayNight=0 Return: Requested video quality settings HTTP/1.0 200 OK Date: Wed, 08 Feb 2012 06:43:22 GMT Connection: close Content-Type: text/html Content-Length: 112
Parameter Values Description cmd=<string> get,set It is necessary to choose what kind of command. get=request the motion detection settings. set=set the motion detection settings. mdEv=<int> 0,1 Motion detection feature enable or disable 0=disable, 1=enable. mdSen=<int> 1~30 Motion detection sensitivity, larger value means less sensitive. Default value is 5. mdFreq=<int> 1~100 Polling Frequency in 1/10 second. Default value is 5. mdX0=<int> 0~10 Left most coordinates of grid number mdX1=<int> 0~10 Right most coordinates of grid number mdY0=<int> 0~6 Top coordinates of grid Number mdY1=<int> 0~6 Bottom coordinates of grid number MdBlock=<int>[,<int>,..] 0,..,76 Series of blocks for detect motion if using GRID method.
Example: Enable the motion detection function, set the sensitivity to 5, set frequency to 0.5 second for video channel 1, and set the motion detection area to block 1, 12, and 13. http://192.168.0.200/motion? cmd=set&camid=1&mdEv=1&mdSen=5&mdFreq=5&mdBlock=1v12v13v
The mdBlock=1v12v13v parameter means the motion detection areas are block 1, block 12, and block 13 as the red areas in the following map.
Parameter Values Description cmd=<string> get,set It is necessary to choose what kind of command. get=request the motion detection settings. set=set the motion detection settings. mdEv=<int> 0,1 Motion detection feature enable or disable 0=disable, 1=enable. mdSen=<int> 1~99 Motion detection sensitivity, larger value means less sensitive. Default value is 30. mdX0=<int> 0~14 0~19 Left most coordinates of grid number (H.264 D1 IP camera) Left most coordinates of grid number (H.264 HD IP camera) mdX1=<int> 0~14
0~19 Right most coordinates of grid number (H.264 D1 IP camera) Right most coordinates of grid number (H.264 HD IP camera) mdY0=<int> 0~9
0~11 Top coordinates of grid Number (H.264 D1 IP camera) Top coordinates of grid Number (H.264 HD IP camera) mdY1=<int> 0~9
0~11 Bottom coordinates of grid number (H.264 D1 IP camera) Bottom coordinates of grid number (H.264 HD IP camera) MdBlock=<int>[,<int>,..] 0v,149v
0v,239v Series of blocks for detect motion if using GRID method. (H.264 D1 IP camera) Series of blocks for detect motion if using GRID method. (H.264 HD IP camera) MERIT LILIN CO., LTD 35
Parameter Values Description cmd=<string> get,reset It is necessary to choose what kind of command. get=request the motion detection settings. reset=clear motion counter
Example: Request the motion detection configuration. http://192.168.0.200/motioncounter?cmd=get Return: Requested motion counter value
If Relay=1, the GPIO relay is high. Else if the Relay=0, the GPIO relay is low. Chapter 3.11.3. GPIO relay setting Set GPIO relay configuration. Syntax: http://<serverIP>/ setio[?<parameter>=<value>[&<parameter>=<value>]] Parameters:
Chapter 3.13. DDNS CGI Dynamic Domain Name Service (DDNS) is used when users want to access Merit LILIN IP camera, video server, and LAN camera using domain name instead of IP address. This service could be useful when device is located behind dial-up ADSL or IP sharing devices, which does not have fix IP address. It is impossible to reach Merit LILIN digital device from Internet. The mechanism of Merit LILIN DDNS service is described as below:
When Merit LILIN digital device enables the DDNS service, it registers to Merit LILIN DDNS server with its information, such as server name to access, router virtual port number, and updated frequency, etc. Merit LILIN digital device automatically updates to DDNS server by a fix frequency, so even IP of the digital device is changed by ISP, the DDNS server could still get and update internal database.
For PDR-400IP, DDNS server gets updated if IP address is changed or at reboot time.
MERIT LILIN CO., LTD 40
Chapter 3.13.1. Get DDNS configurations Get DDNS configuration from digital device. Syntax: http://<serverIP>/ddns?cmd=get
Device Supported: PIH-7000/7600/7625 IP Series VS-1000S, PIH-1000S, H.264 AVC IP Fast Dome, H.264 AVC IP Mini Dome, IP454X, VS012, IPR31ESX, IPD112ESX, IPG012ES, IPR414ES, IPR614ES, IPR712S
Example #2:
DDNS Configuration: ddnsaddr=domain.dyndns.org
Device Supported: PDR-400IP, PVS-1020, PIH-036/038IP, H.264 AVC IP Fast Dome, H.264 AVC IP Mini Dome, IP454X, VS012, IPR31ESX, IPD112ESX, IPG012ES, IPR414ES, IPR614ES, IPR712S
Chapter 3.13.2. Set DDNS configurations Set DDNS configurations. Syntax: http://<serverIP>/ddns?cmd=set&<parameter>=<value>
Parameters:
Parameter Values Description enable=<int> 0,1 0: Disable, 1: Enable DDNS service Ddnsaddr=<string> Omit default: ddns.meritlilin.com Specify the DDNS server IP address. You may use domain name. Ddnsport=<int> 0..65535, Omit default: 80 Specify the DDNS server listen port. MERIT LILIN CO., LTD 41
routerinport=<int> 0..65535, Omit default: Same as HTTP port of Merit LILINs digital device Specify the IP sharing devices virtual server listen port. For example, the IP sharing device may listen to port 8000 and redirect to Merit LILINs digital device, then it should set this parameter to 8000. updatetime=<int> Unit: second Omit default: 600 seconds (10 minutes) Specify the automatic update frequency once start the DDNS service.
Example #1: http://192.168.0.200/ddns?cmd=set&enable=1&ddnsaddr=ddns.meritlilin.com&ddnsport=80&ro uterinport=8000&updatetime=600 Return: Set the DDNS configurations.
Device Supported: PIH-7000/7600/7625 IP Series VS-1000S, PIH-1000S
Example #2: http://192.168.0.200/ddns?cmd=set&ddnsaddr=ddns.dyndns.org Device Supported: PDR-400IP, PVS-1020, PIH-036/038IP, H.264 AVC IP Fast Dome, H.264 AVC IP Mini Dome, IP454X, VS012, IPR31ESX, IPD112ESX, IPG012ES, IPR414ES, IPR614ES, IPR712S
If CGI command fails, the following hints may help you to diagnostic: Confirm your network setting is correct including Gateway IP reaching Internet. DNS1 IP address should be public and reachable, and HTTP port should be configured the same with your IP sharing redirection port. Try to ping above IP address if reachable. The routerinport should be the same as the routers (IP Sharing) listen port.
Chapter 3.14. PPPoE CGI Set PPPoE configurations. Syntax: http://<serverIP>/pppoe[?<parameter>=<value>[&<parameter>=<value>]]
Specify the PPPoE account string Pppoepassword=<string>
Specify the PPPoE acount password
Device Supported: H.264 AVC IP Mini Dome, IP454X, VS012, IPR31ESX, IPD112ESX, IPG012ES, IPR414ES, IPR614ES, IPR712S MERIT LILIN CO., LTD 42
Chapter 4. H.264 Streaming Chapter 4.1. H.264 and JPEG RTSP streaming To test streamings of H.264 and JPEG of NVT media stramings via RTP/RTSP/HTTP, you can verify the streamings by using QuickTime.
To test RTP/RTSP/HTTP, please click on QuickTime->Edit->Preference. Click on Transport Setup->Custom. Change the protocol to HTTP and make sure port ID is 554.
MERIT LILIN CO., LTD 43
After setting up above, please click on File->Open URL. Please type the following URLs:
Chapter 4.1.1 RTSP session description protocol (SDP) for H.264 AVC IP camera D1 resolution Transport Protocol: RTSP/HTTP