Current service manages PTZ IP camera using ONVIF (Open Network Video Interface) protocol. Internally, it uses Shinobi ONVIF library.
Following operations are implemented:
-
GET http://127.0.0.1:8880/discover - exposes information about discovered ONVIF devices; operation seems to be working only in local network.
-
GET http://127.0.0.1:8880/profile - exposes information about the selected and supported profiles.
-
GET http://127.0.0.1:8880/home - turns camera back to the home position, if device supports current operation.
-
GET http://127.0.0.1:8880/move?x=1.0&y=-1.0&z=0.5&t=5 - makes the PTZ camera to move with specified axis speeds during 5 seconds. x, y, z values must be within the range [-1.0;1.0]. t - time period in seconds.
x - pan, y - tilt, z - zoom
-
GET http://127.0.0.1:8880/position?x=1.0&y=-1.0&z=0.5 - absolute move; values ranges depend on camera model.
- Create .env file in project folder. Specify following configuration parameters:
PORT=8880 # port on which NodeJS service is running
LOGIN=admin # user name for ONVIF endpoint
PASSWORD=qwerty123! # user password for ONVIF endpoint
WARN=Port 80 on camera MUST be accessible in any way!
# even when internal port 80 is mapped to any other value, it must also be mapped to the external 80th port!
CAM_MGMT_URL=http://213.87.92.175/onvif/device_service # onvif management endpoint
npm install
- installs all dependenciesnpm run start
- starts NodeJS server