We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello. I'm trying to get a video stream behind the cameras on the RPI 4, but I'm getting the following error:
Using the libcamera-hello command, the image is displayed. I suspect there may be an error in the camera's image format.
Platform: Raspbian Bullseye 11 (32-bit) OpenCV: v4.5.5 NodeJS: v16
My code: const cv2 = require('@u4/opencv4nodejs'); const path = require('path'); const express = require('express'); const app = express(); const server = require('http').Server(app); const io = require('socket.io')(server);
app.set('view engine', 'ejs'); const FPS = 30; const Vcap = new cv2.VideoCapture(0); Vcap.set(cv2.CAP_PROP_FRAME_WIDTH, 300); Vcap.set(cv2.CAP_PROP_FRAME_HEIGHT, 300);
app.get('/', async(req, res, next) => { res.render('index'); }); let frame; setInterval(() => { frame = Vcap.read() const image = cv2.imencode('.jpg', frame).toString('base64') io.emit('image', image); }, 1000 / FPS); server.listen(3030, () => console.log('open up your browser'));
The text was updated successfully, but these errors were encountered:
This repository is not maintained anymore, please use @u4/opencv4nodejs for a more active fork
Sorry, something went wrong.
No branches or pull requests
Hello. I'm trying to get a video stream behind the cameras on the RPI 4, but I'm getting the following error:
Using the libcamera-hello command, the image is displayed. I suspect there may be an error in the camera's image format.
Platform: Raspbian Bullseye 11 (32-bit)
OpenCV: v4.5.5
NodeJS: v16
My code:
const cv2 = require('@u4/opencv4nodejs');
const path = require('path');
const express = require('express');
const app = express();
const server = require('http').Server(app);
const io = require('socket.io')(server);
app.set('view engine', 'ejs');
const FPS = 30;
const Vcap = new cv2.VideoCapture(0);
Vcap.set(cv2.CAP_PROP_FRAME_WIDTH, 300);
Vcap.set(cv2.CAP_PROP_FRAME_HEIGHT, 300);
app.get('/', async(req, res, next) => {
res.render('index');
});
let frame;
setInterval(() => {
frame = Vcap.read()
const image = cv2.imencode('.jpg', frame).toString('base64')
io.emit('image', image);
}, 1000 / FPS);
server.listen(3030, () => console.log('open up your browser'));
The text was updated successfully, but these errors were encountered: