UNPKG

raspicam-js

Version:

A Node.js-based controller module for the Raspberry Pi camera based on a command structure similar to Johnny-Five

23 lines (17 loc) 551 B
var RaspiCam = require("../lib/raspicam"); var camera = new RaspiCam({ mode: "video", output: "./video/video.h264", framerate: 15, timeout: 5000 // take a 5 second video }); camera.on("started", function( err, timestamp ){ console.log("video started at " + timestamp ); }); camera.on("read", function( err, timestamp, filename ){ console.log("video captured with filename: " + filename + " at " + timestamp ); }); camera.on("exit", function( timestamp ){ console.log("video child process has exited at " + timestamp ); }); camera.start();