“look and feel” and arrangement of such Content, contained in this Manual is owned, controlled or licensed by or to Avonic, and is protected by trade dress, copyright, patent and trademark laws, and various other intellectual property rights and unfair competition laws.
Contents DISCLAIMER, CONTACT AND LIABILITY....................ii Symbols Used in This Manual......................ii INTRODUCTION............................4 Purpose of This Manual......................4 Target Audience......................... 4 Document Structure........................4 APPENDIX C - HTTP API.........................5 How to use HTTP API........................5 Curl............................. 6 {"GetEnv"}........................... 6 HTTP API code list........................7 IR Remote Control......................
INTRODUCTION Purpose of This Manual This Manual describes the instructions and programming codes of the HTTP API functionality of the CM70 camera, which you could use to control the camera over IP. Target Audience This manual is developed for IT professionals who are responsible for operating the Product. Document Structure The Manual is subdivided into the following Chapters: Introduction...
APPENDIX C - HTTP API With the HTTP API you can control the camera by using a web browser like Microsoft Edge or Google Chrome. It is possible to change multiple settings at once using this feature. This document is available as an Appendix in the CM70 series manual and as a separate document that can be downloaded on the product website.
Curl It is also possible to change the camera settings at once by using the Command Prompt from Windows. Follow instructions below: 1. Click on Start in the left corner of your screen in Windows. 2. Type Notepad and open this application. 3.
HTTP API code list IR Remote Control IR Enable/Disable Command Code Command Setting szCmd http://192.168.5.126/ajaxcom? bIrCtrlEnable 0: ON szCmd={"SetEnv":{"ArmPtz": 1: OFF {"bIrCtrlEnable":0}}} PTZControl Code: http://192.168.5.126/ajaxcom?szCmd={"SysCtrl":{"PtzCtrl":{"nChanel":0,"szPtzCmd":"left_start","byValue":50}}} Command Setting Function Command nChanel byValue 0,100 used to control the speed of ptz szPtzCmd left start left_start left stop...
Page 8
PTZControl downstart down_start downstop down_stop PTZ speed Set PTZ Speed Command Code Command Setting szCmd http://192.168.5.126/ajaxcom?szCmd={"SetEnv": nPTZSpeed 0: Slow 1: High {"PTZSpeed":{"nPTZSpeed":1}}} Speed by Zoom Set Speed By Zoom Command Code Command Setting szCmd http://192.168.5.126/ajaxcom?szCmd={"SetEnv": bSpeedByZoom 1: on 0: off {"ArmPtz":{"bSpeedByZoom":0}}} Image Freezing Set Image Freezing...
Preset Commands Clean preset preset_clean Audio Audio Configure Get audio configure Code http://192.168.5.126/ajaxcom?szCmd={"GetEnv":{"Audio":{}}} Set audio configure Code http://192.168.5.126/ajaxcom?szCmd={"SetEnv":{"Audio":{"nSampleBits":16,"nAudioSmstMask": [33554888,33554888,33554433],"bEnable":0,"nInpVolume":4,"nBitRate":64,"nAEncType":7,"byAudioCodecList": [6,7,2],"nSampleRate":44100,"nChannel":1}}} Function Code Command Setting Enable http://192.168.5.126/ajaxcom? bEnable 0: off szCmd={"SetEnv":{"Audio": 1: on {"bEnable":1}}} Encode http://192.168.5.126/ajaxcom? nAEncType 6: Mp3AAC Type szCmd={"SetEnv":{"Audio": 7: G.711A {"nAEncType":7}}} Sample...
Page 11
Video encode settings Video Encode Settings Function Code Command Setting Compressed Format http://192.168.5.126/ajaxcom? emVideoCodec 5: H.264 szCmd={"SetEnv":{"VideoEncode":[{"stMaster": 7: H.265 (BP profile only) {"emVideoCodec":5},"nChannel":0}]}} Profile http://192.168.5.126/ajaxcom? byProfile 0: BP szCmd={"SetEnv":{"VideoEncode":[{"stMaster": 1: MP {"byProfile":0},"nChannel":0}]}} 2: HP http://192.168.5.126/ajaxcom?szCmd={"GetEnv": byImageSizeList (Lists {"VideoEncode":{"nChannel":-1}}} and receive its all imagesize, different returning value.
Page 12
Video Streaming Stream Publish Get stream publish parameters Code http://192.168.5.126/ajaxcom?szCmd={"GetEnv":{"StreamPublish":{"nChannel":-1}}} Set stream publish parameters Code http://192.168.5.126/ajaxcom?szCmd={"SetEnv":{"StreamPublish":[{"stSlave": {"wHostPort":1935,"szHostUrl":"192.168.5.11", "nProtolType":2,szStreamName":"live/ av1","bEnable":0,"nAbProtolMask":1,"szSrtKey":"","wSrtKeyLen":0,"szUserName":"","szPassword":""},”stMaster”: {"wHostPort":1935, "szHostUrl":"192.168.5.11",”nProtolType":3,"szStreamName":"live/av0","bEnable":0, "nAbProtolMask":1,"szSrtKey":"1111111111","wSrtKeyLen":0,"szUserName":"", "szPassword":""},"nChannel":0}]}} NOTE: When modifying one param, you should take along wHostPort. Otherwise, the host port will be zero. Function Code Command...
Page 13
RTP Multicast NOTE: When modifying one param you should take along bEnable and awMultiCastPort. Otherwise, it will be set to 0. Suggesting that when setting env, you can distinguish the stMaster and stSlave. RTP Multicast Settings RTP Multicast Settings Function Code Command Setting...
Page 14
Camera Settings Mode http://192.168.5.126/ajaxcom?szCmd={"SetEnv": emExpMode Auto {"VideoParam":[{"stExp":{"stExpMode": Manual {"emExpMode":0}},"nChannel":0}]}} Bright Exposure: Auto http://192.168.5.126/ajaxcom? expcomp_mode szCmd={"SetEnv":{"VideoParam":[{"stExp": {"expcomp_mode":2},"nChannel":0}]}} http://192.168.5.126/ajaxcom? expcomp [0, 14] Level szCmd={"SetEnv":{"VideoParam":[{"stExp": {"expcomp":8},"nChannel":0}]}} http://192.168.5.126/ajaxcom?szCmd={"SetEnv": backlight {"VideoParam":[{"stExp":{"backlight":2},"nChannel":0}]}} Camera Settings Exposure: Auto Function Code Command Setting Flicker http://192.168.5.126/ajaxcom? antiflicker szCmd={"SetEnv":{"VideoParam":[{"stExp": 50HZ {"antiflicker":0},"nChannel":0}]}} 60HZ G.Limit http://192.168.5.126/ajaxcom?
Page 15
Camera Settings Exposure: AEE Flicker http://192.168.5.126/ajaxcom? Antiflicker szCmd={"SetEnv":{"VideoParam":[{"stExp": 50HZ {"antiflicker":0},"nChannel":0}]}} 60HZ G.Limit http://192.168.5.126/ajaxcom? gainLimit [0, 15] szCmd={"SetEnv":{"VideoParam":[{"stExp": {"gainLimit":5},"nChannel":0}]}} Iris http://192.168.5.126/ajaxcom? nIris [0, 12] szCmd={"SetEnv":{"VideoParam":[{"stExp": {"stIris":{"nIris":12}},"nChannel":0}]}} http://192.168.5.126/ajaxcom? [0, 8] szCmd={"SetEnv":{"VideoParam":[{"stExp": {"drc":6},"nChannel":0}]}} Exposure: Bright Bright http://192.168.5.126/ajaxcom? bright [0, 23] szCmd={"SetEnv":{"VideoParam":[{"stExp": {"bright":0},"nChannel":0}]}} Flicker, G.Limit, DRC You can find the same configure at AAE Color and Image Camera Settings...
Page 17
Video OSD Video OSD Get video parameters Code http://192.168.5.126/ajaxcom?szCmd={"GetEnv":{"VideoOsd":{"nChannel":-1}}} Set set video parameters Code http://192.168.5.126/ajaxcom?szCmd={"SetEnv":{"VideoOsd":[{"stTime": {"bEnable":1,"nIndex":0,"nXPos":0,"szText":"","nYPos":10000, "stFtColor": {"byAlpha":128,"byRed":255,"byGreen":255,"byBlue":255},"stBkColor": {"byAlpha":0,"byRed":0,"byGreen":0,"byBlue":0}},"stTitle": {"bEnable":0,"nIndex":0,"nXPos":0,"szText":"","nYPos":0,"stFtColor": {"byAlpha":128,"byRed":255,"byGreen":255,"byBlue":255},"stBkColor": {"byAlpha":0,"byRed":0,"byGreen":0,"byBlue":0}},"nChannel":0}]}} NOTE: All params can be saved by this command and also you can set one param alone. Function Code Command Setting...
Page 18
OSD Font Size Get OSD font size parameters Code http://192.168.5.126/ajaxcom?szCmd={"GetEnv":{"TTFFontSize":{"nChannel":-1}}} Set video parameters Code http://192.168.5.126/ajaxcom?szCmd={"SetEnv":{"TTFFontSize":{"nFontSize":[48,48],"bAutoSize":1}}} Function Code Command Setting bAutoSize 0: off,1: on nFontSize [8,200] Output Format (Video) Output Format Get video out parameters Code http://192.168.5.126/ajaxcom?szCmd={"GetEnv":{"VideoOut":{"nChannel":-1}}} Set video out parameters Code http://192.168.5.126/ajaxcom?szCmd={"SetEnv":{"VideoOut": {"nNetMode":2,"emVoutFormat":9,"byFormatList":[10,9,4,3,8,7,6,5,26,25,20,21,22,23,24]}}}...
Code http://192.168.5.126/ajaxcom?szCmd={"GetEnv":{"NetWork":{"nChannel":-1}}} Set network SRT parameters Code http://192.168.5.126/ajaxcom?szCmd={"SetEnv":{"NetWork":{"stSrt": {"wSrtLen":0,"wSrtPort":9000,"szSrtPin":"xxxxxxxxxx"}}}} Function Code Command Setting crypto key length in bytes wSrtLen [0-32] Port SRT wSrtPort Default 9000 Password stream encryption szSrtPin user-defined Network Network configure and port settings Network Configure Get network port parameters Code http://192.168.5.126/ajaxcom?szCmd={"GetEnv":{"NetWork":{"nChannel":-1}}} Set network port parameters...
Ethernet DHCP http://192.168.5.126/ajaxcom?szCmd={"SetEnv":{"NetWork":{"stEth": byValid 5:off 7:on [{"byValid":5}]}}} IP Address http://192.168.5.126/ajaxcom?szCmd={"SetEnv":{"NetWork":{"stEth": [{"szIPAddr":"192.168.5.127"}]}}} Subnet Mask http://192.168.5.126/ajaxcom?szCmd={"SetEnv":{"NetWork":{"stEth": [{"szSubMask":"255.255.255.0"}]}}} Default Gateway http://192.168.5.126/ajaxcom?szCmd={"SetEnv":{"NetWork":{"stEth": [{"szGateway":"192.168.5.1"}]}}} Get dns parameters Code http://192.168.5.126/ajaxcom?szCmd={"GetEnv":{"NetWork":{"nChannel":-1}}} Set dns parameters Code http://192.168.5.126/ajaxcom?szCmd={"SetEnv":{"NetWork":{"stDns":{"szDns1":"8.8.8.8","szDns2":"0.0.0.0"}}}} Function Code Command Setting Preferred DNS Server http://192.168.5.126/ajaxcom?szCmd={"SetEnv":{"NetWork":{"stDns": {"szDns1":"8.8.8.8"}}}} Alternative DNS Server http://192.168.5.126/ajaxcom?szCmd={"SetEnv":{"NetWork":{"stDns": {"szDns2":"8.8.8.8"}}}} System...
Page 21
SysTime Code http://192.168.5.126/ajaxcom?szCmd={"QueryState":{"QuerySysTime":{}}} Set system time parameters Code http://192.168.5.126/ajaxcom?szCmd={"SetEnv":{"SysTime":{"nDateSprtr":2,"nDateFormat":0,"nZone":1,"nHourType":0,"stNtp": {"bEnable":1,"nHostPort":123,"nUpdateInterval":2,"szHostUrl":"ntp4.aliyun.com"}}}} Function Code Command Setting Date Format http://192.168.5.126/ajaxcom?szCmd={"SetEnv":{"SysTime": nDateFormat 0: YYYY-MM-DD {"nDateFormat":0}}} 1: MM-DD-YYYY 2: DD-MM-YYYY Date Sprtr http://192.168.5.126/ajaxcom?szCmd={"SetEnv":{"SysTime": nDateSprtr 0: . {"nDateSprtr":0}}} 1: - 2: / SysTime Function Code Command Setting Zone http://192.168.5.126/ajaxcom?
Page 22
SysUser Code http://192.168.5.126/ajaxcom?szCmd={"GetEnv":{"SysUser":{}}} Set sysuser parameters Code http://192.168.5.126/ajaxcom?szCmd={"SetEnv":{"SysUser":{"stUsers": [{"nUserType":0,"szUserName":"admin","szPassword":"admin"},{"nUserType":1,"szUserName":"user1","szPassword":"user1"}, {"nUserType":1,"szUserName":"user2","szPassword":"user2"}]}}} Function Code Command Setting Authority nUserType 0: admin 1: user1 or user 2 User Name szUserName user-defined: no white space Password szPassword user-defined, no white space. This command must set three users at the same time. Update Update Get update parameters...
Need help?
Do you have a question about the CM70-IP Series and is the answer not in the manual?
Questions and answers