Skip to content

Latest commit

 

History

History
64 lines (46 loc) · 1.46 KB

README.md

File metadata and controls

64 lines (46 loc) · 1.46 KB

node-raspivideo

Build status Total alerts

Wrapper for raspivid tool for Raspbian OS. Typescript typedefs included. Includes built in converter to save records in mp4 format.

Reqs

  • Raspberry Pi (tested on 3 version), Raspbian OS with Raspivid lib
  • Node 12+ installed
  • Raspberry camera connected to your Pi

Install

npm i node-raspivideo

Usage

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

License info

Lib is MIT licensed.

Sample video file for tests was provided by https://file-examples.com

TODO

  • More docs
  • Streams
  • More tests