Wrapper for raspivid tool for Raspbian OS. Typescript typedefs included. Includes built in converter to save records in mp4 format.
- Raspberry Pi (tested on 3 version), Raspbian OS with Raspivid lib
- Node 12+ installed
- Raspberry camera connected to your Pi
npm i node-raspivideo
Sample usage
// import {Raspivid} from 'node-raspivideo';
const {Raspivid} = require('node-raspivideo');
const raspivid = new Raspivid({
videoFolder: './videos',
verticalFlip: true,
format: 'mp4'
});
raspivid.record('myvideo', 10000)
.then(() => {
console.log('done!');
})
.catch((err) => {
console.error(err);
});
Current options are:
key | type | defaults | desc |
---|---|---|---|
width | number | 640 | |
height | number | 480 | |
bitrate | number | 1200000 | bps |
format | string - 'mp4' or 'h264' | mp4 | |
videoFolder | string | ./videos | |
verticalFlip | boolean | false | |
horizontalFlip | boolean | false |
Lib is MIT licensed.
Sample video file for tests was provided by https://file-examples.com
- More docs
- Streams
- More tests