mmaelzer / mjpeg-camera Goto Github PK
View Code? Open in Web Editor NEWA node.js library and/or server for connecting to, recording from, and streaming mjpeg cameras.
A node.js library and/or server for connecting to, recording from, and streaming mjpeg cameras.
How do I record videos through this?
Hi, I just wondering, why I cant install this magnificent plugin locally?
but have to do it globally. any clues to do it manually?
The Lodash library has been found to be vulnerable to Prototype Pollution attack.
npm advises an update to the latest library version.
Do you think it will require a lot of effort?
I tried running 'npm audit fix' but apparently the patch causes breaking changes in mjpeg-camera code.
I use cs command in zsh
cs http://140.120.200.61/mjpg/video.mjpg?camera=1 -n "Spring Grove" -p 12345
Result says
: No such file or directory
Please tell me how to fix it, thanks!
[root@cctv]# cs -l http://10.0.0.200:8008 -n "cam"
=== cam camera server listening on 8080 ===
after close browser:
/usr/lib/node_modules/mjpeg-camera/cs:50
camera.unpipe(ws);
^
TypeError: camera.unpipe is not a function
at ServerResponse.<anonymous> (/usr/lib/node_modules/mjpeg-camera/cs:50:14)
at emitNone (events.js:67:13)
at ServerResponse.emit (events.js:166:7)
at Socket.onServerResponseClose (_http_server.js:131:44)
at emitOne (events.js:82:20)
at Socket.emit (events.js:169:7)
at TCP._onclose (net.js:469:12)
[root@cctv]# node -v v4.1.1
Like in title.
Tested on Win7 x64, MAC OS - same behaviour for both.
Node 5.0.0
Npm 3.3.6
No issues when installing.
Steps to reproduce:
npm install mjpeg-camera -g
cs -l http://10.53.2.43/ -p 12345
http://10.53.2.43:12345/
hiii,
thanks, good work.
i try mjpeg-camera in windows, it work well.
but not work in linux.
i use node v10.24.1 may be need upper version??
best regards
The camera.getScreenshot example code doesn't seem to be working correctly. It correctly saves a frame into the camera-screenshot.jpg
file, but it "hangs" until the following error is thrown:
TypeError: Cannot call method 'abort' of null
at Camera.stop (/mjpeg-camera-example/node_modules/mjpeg-camera/mjpeg-camera.js:97:19)
at Camera.<anonymous> (/mjpeg-camera-example/node_modules/mjpeg-camera/mjpeg-camera.js:119:10)
at Timer.listOnTimeout [as ontimeout] (timers.js:112:15)
Since the Camera.prototype.stop
method is setting the connection to null
after aborting it, it seems to me that two consecutive stop
calls would cause the error, most likely caused by the camera.getScreenshot
call followed by the keepalive
timer call.
My use case allows me to "fix" the stop
call by checking if the connection is null
before aborting, but this doesn't seem to be the proper fix (or at least not enough to fix it), since the same example code will hang forever (i.e., no error is thrown but the program never quits).
Thank you for mjpeg-camera
by the way, I was looking for a module capable of grabbing a single MJPEG frame and this was exactly it.
I have an error importing this module and pg using Node 10.x
an example is:
const pg_1 = require("pg");
var MjpegCamera = require('mjpeg-camera');
async function getNow() {
let pg = new pg_1.Pool({
user: 'userDB',
database: 'DB',
password: 'passDB',
port: 5432,
host: 'localhost',
max: 15,
idleTimeoutMillis: 3000,
});
let strsql = "SELECT NOW() as now;";
console.log('query:' + strsql);
console.log(pg);
return await pg.query(strsql);
}
getNow();
using getScreenshot fuction, i have a problem when the camera breaks the connection. In this case, the getScreenshot fuction never gives a callback or error.
thanks
Hi,
My goal is to display in a Reactjs web app the images that my camera is streaming as MJPEG (10 per second)
Also I want to take a picture everytime I press a button.
I have the IP, username, password and url where my camera is streaming.
Am I supposed to run this library on Express backend?
I have tried it but I'm not seeing that the file is writed on /frames or /motion
Sometimes when I try to snapshot I get the next error:
videostream.on('data', this.onFrame.bind(this));
^
TypeError: Cannot read properties of undefined (reading 'on')
at Camera.start (C:\Users\100032595\Documents\GitHub\welcomi_localweb\welcomi_localweb\backend\node_modules\mjpeg->camera\mjpeg-camera.js:50:15)
Is a Hikvision camera and I followed the next doc to get the MJPEG stream:
HIKVISION
When camera.stop() is called and the connection is aborted then keepalive is called by this line:
this.connection.on('error', this.keepalive.bind(this));
and so when stop() is called again in keepalive()
it tries to abort the connection that has already been aborted and set to null
resulting in error: TypeError: Cannot read properties of null (reading 'abort')
Using Node v16.14.2
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.