Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions x.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
const onvif = require('node-onvif');

// Create an OnvifDevice object
let device = new onvif.OnvifDevice({
xaddr: 'http://10.10.10.3/onvif/device_service',
user : 'admin',
pass : 'senha',
});

// Initialize the OnvifDevice object
device.init().then(() => {
// Move the camera
return device.ptzMove({
'speed': {

x: 0.5, // Speed of pan (in the range of -1.0 to 1.0)
y: 0.0, // Speed of tilt (in the range of -1.0 to 1.0)
z: 0.0 // Speed of zoom (in the range of -1.0 to 1.0)
},
'timeout': 2 // seconds
});

}).then(() => {
console.log('Done!');
}).catch((error) => {
console.error(error);
});