Skip to content

Instantly share code, notes, and snippets.

@gabonator
Created May 16, 2021 19:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gabonator/006d50567abd1496281e987bf4058ba6 to your computer and use it in GitHub Desktop.
Save gabonator/006d50567abd1496281e987bf4058ba6 to your computer and use it in GitHub Desktop.
Nodejs downloads still image from hikvision nvr
// nodejs script for downloading still images from hikvision nvr
// uses request-digest for basic http authenticatication
//
// Still images are available at this url:
// http://192.168.1.130/ISAPI/Streaming/channels/200/picture?videoResolutionWidth=1920&videoResolutionHeight=1080
var digestRequest = require('request-digest')('user', 'password');
var fs = require('fs');
var cam = 3;
digestRequest.request({
host: 'http://192.168.1.130',
path: '/ISAPI/Streaming/channels/'+cam+'00/picture?videoResolutionWidth=1920&videoResolutionHeight=1080',
port: 80,
method: 'GET',
encoding:'binary'
}, function (error, response, body) {
if (error) {
throw error;
}
fs.writeFileSync('cam' + cam + '.jpeg', body, 'binary')
})
@krvinc0de
Copy link

hi, can you help me ?with a project using ISAPI for face detection and face register in a express api

@gabonator
Copy link
Author

no, but this piece of code is a good starting point

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment