Mês: janeiro 2016

IP Camera Protocol / Webapp Integration

This post is for interested who want to create a desktop or web software to control IP cameras.

Reverse engineering was made in a Chinese IP camera (the image below)

Features:

  • Powerful high-speed video protocol processor.
  • Optimized MJPEG video compression for transmission.
  • Multi-level users management and passwords definition.
  • Embeded Web Server for users to visit by IE.
  • Support wireless network (Wi-Fi/802.11/b/g)mobile, two way audio.
  • Supporting Dynamic IP (DDNS)and UPnP LAN.
  • Giving alarm in cause of motion detection.
  • Support multiple network protocols:
    • HTTP/TCP/IP/UDP/STMP/DDNS/SNTP/DHCP/FTP.
  • Support remote system update,Multi-Protocol support and Transportation.
  • Sending the image to your mailbox automatically when the IP CAM is triggered.

Ref: http://www.chantronics.com.au/computers/viewitem.php?productid=204

In this model the web interface is at the port 81. As the IP of this equipment is dynamic, you can resort to the DHCP client list of the router, or run a port scan. In Linux, use:

nmap -p 81 192.168.1.0/24

Accessing resources of camera

Configuration Page
http://IP:81/config.htm

Telnet
telnet IP
Login: root, Pass: 123456

TIPs:

Open source software in Java, which supports integration with IP cameras:
http://webcam-capture.sarxos.pl/

Java FTP Server:
http://mirror.nbtelecom.com.br/apache/mina/ftpserver/1.0.6/dist/
Ref: https://geertschuring.wordpress.com/2015/02/11/how-to-start-a-simple-embedded-java-based-ftp-server/

Protocol


Video Stream

http://IP:PORT/videostream.cgi?loginuse=myuser&loginpas=mypass

Include in Webapp / Html page:

Snapshot

/snapshot.cgi?loginuse=myuser&loginpas=mypass

Request General Settings

/get_status.cgi?loginuse=myuser&loginpas=mypass

Response:

var alias=”IPCAM”; var deviceid=”EST-065556-XXXX”; var sys_ver=”57.2.0.138″; var now=1452435094; var alarm_status=0; var upnp_status=1; var dnsenable=0; var osdenable=0; var syswifi_mode=1; var mac=”00:0C:6C:11:XX:XX”; var wifimac=”00:0C:6C:11:XX:XX”; var dns_status=0; var authuser=0; var devicetype=21037151; var devicesubtype=0; var externwifi=1; var record_sd_status=0; var sdtotal=0; var sdfree=0;

Request Image Settings

/get_camera_params.cgi?loginuse=myuser&loginpas=mypass

var resolution=0; var vbright=1; var vcontrast=114; var vhue=0; var vsaturation=0; var OSDEnable=0; var mode=1; var flip=1; var enc_framerate=10; var sub_enc_framerate=15; var speed=10; var enc_bitrate=500; var ircut=1;

Change Name

/set_alias.cgi?alias=MYNAME&loginuse=myuser&loginpas=mypass

Resolution

/camera_control.cgi?loginuse=myuser&loginpas=mypass&param=0&value=XX
value=0 – VGA
value=1 – QVGA

Image Mirror

/camera_control.cgi?loginuse=myuser&loginpas=mypass&param=5&value=X
value=0 – normal
value=1 – reversal
value=2 – mirror
value=3 – reversal & mirror

FreameRate

/camera_control.cgi?loginuse=myuser&loginpas=mypass&param=6&value=10
value = 1 a 30

Brightness

/camera_control.cgi?loginuse=myuser&loginpas=mypass&param=1&value=1
value = 1 a 255

Contrast

camera_control.cgi?loginuse=myuser&loginpas=mypass&param=2&value=73
value = 1 a 255

Rotate/Move Speed

/camera_control.cgi?loginuse=myuser&loginpas=mypass&param=100&value=X
value = 1 .. 10

Rotate/Move

/decoder_control.cgi?loginuse=myuser&loginpas=mypass&command=XX&onestep=0
Command Center = 25
PTZ_UP=0;
PTZ_UP_STOP=1;
PTZ_DOWN=2;
PTZ_DOWN_STOP=3;
PTZ_LEFT=4;
PTZ_LEFT_STOP=5;
var PTZ_RIGHT=6;
var PTZ_RIGHT_STOP=7;
var PTZ_LEFT_UP=90;
var PTZ_RIGHT_UP=91;
var PTZ_LEFT_DOWN=92;
var PTZ_RIGHT_DOWN=93;
var PTZ_STOP=1;
var PTZ_VPATROL=26;
var PTZ_VPATROL_STOP=27;
var PTZ_HPATROL=28;
var PTZ_HPATROL_STOP=29;

List Alarms

/get_alarmlog.cgi&loginuse=myuser&loginpas=mypass

Clear: /set_alarmlogclr.cgi&loginuse=myuser&loginpas=mypass

var log_text=””; log_text+=”gpio alarm 2016-01-10 15:49:56\n”; log_text+=”gpio alarm 2016-01-10 15:49:09\n”;

References:

 

Anúncios