Created
May 16, 2021 19:34
-
-
Save gabonator/006d50567abd1496281e987bf4058ba6 to your computer and use it in GitHub Desktop.
Nodejs downloads still image from hikvision nvr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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') | |
}) | |
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
hi, can you help me ?with a project using ISAPI for face detection and face register in a express api