Minimal RPI camera server using node.js. See the simple cam view repo for streaming/displaying the camera on your device.
- Node.js
- npm
raspistill
(for images)ffmpeg
(for streaming)
For websLinux virtual video device node must also be
loaded. Specifically, server runs ffmpeg
on input node
/dev/video0
.
For actual streaming, the video stream will be grabbed from
/dev/video<X>
. If the virtual device does not show up, load the
bcm2835-v4l2
device driver module:
sudo modprobe bcm2835-v4l2
- Install the only depedency (needed if "streaming")
npm install
- Update
config.js
as necessary - Start server on server
node src/server
- Then there are different options on the client machine:
- Open
http://HOST:PORT/?u=USERNAME&p=PASSWORD
in browser. - Open
http://HOST:PORT/stream?u=USERNAME&p=PASSWORD
in browser. - Send
GET
request tohttp://HOST:PORT/pi.jpg?u=USERNAME&p=PASSWORD
to fetch latest image. - Open a websocket connection to
ws://HOST:PORT/stream
, and send authentication token (fixed string) on connect.
- Open
USERNAME
, PASSWORD
, and PORT
are specified in config.js
.