How to use the node-raspistill.Raspistill function in node-raspistill

To help you get started, we’ve selected a few node-raspistill examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ibmtjbot / tjbotlib / lib / tjbot.js View on Github external
TJBot.prototype._setupCamera = function() {
    winston.verbose('TJBot initializing Camera');

    this._camera = new Raspistill({
        width: this.configuration.see.camera.width,
        height: this.configuration.see.camera.height,
        noPreview: true,
        encoding: 'jpg',
        outputDir: './',
        verticalFlip: this.configuration.see.camera.verticalFlip,
        horizontalFlip: this.configuration.see.camera.horizontalFlip,
        time: 1
    });

    // versions of node-raspistill < 0.0.11 don't have the `time` option, so
    // force it in if we don't find it
    if (!this._camera.options.hasOwnProperty('time')) {
        winston.silly('node-raspistill camera option for `time` not found, swizzling it in');
        var self = this._camera;
        self.processOptionsOriginal = self.processOptions;
github dlukanin / node-raspistill / examples / with_stop.js View on Github external
const Raspistill = require('node-raspistill').Raspistill;
const RaspistillInterruptError = require('node-raspistill').RaspistillInterruptError;

const raspistill = new Raspistill({
    fileName: 'image%04d',
    encoding: 'jpg',
    width: 640,
    height: 480
});

let i = 0;
raspistill.timelapse(1000, 30000, (image) => {
    i++;
    console.log('got ' + i + ' photo');
    if (i === 5) {
        console.log('trying to stop');
        raspistill.stop();
    }
})
    .then(() => {
github dlukanin / node-raspistill / examples / with_stop_no_file_save.js View on Github external
const Raspistill = require('node-raspistill').Raspistill;
const RaspistillInterruptError = require('node-raspistill').RaspistillInterruptError;

const raspistill = new Raspistill({
    fileName: 'image%04d',
    encoding: 'jpg',
    noFileSave: true,
    width: 640,
    height: 480
});

let i = 0;
raspistill.timelapse(1000, 30000, (image) => {
    i++;
    console.log('got ' + i + ' photo');
    if (i === 5) {
        console.log('trying to stop');
        raspistill.stop();
    }
})
github dlukanin / node-raspistill / examples / timelapse.js View on Github external
const Raspistill = require('node-raspistill').Raspistill;

const raspistill = new Raspistill({
    fileName: 'image%04d',
    encoding: 'jpg',
    width: 640,
    height: 480
});

let i = 0;
raspistill.timelapse(1000, 30000, (image) => {
    i++;
    console.log('photo ' + i + ' is now stored on drive ');
})
    .then(() => {
        console.log('timelapse ended')
    })
    .catch((err) => {
        console.log('something bad happened', err);
github dlukanin / node-raspistill / examples / no_file_save.js View on Github external
const Raspistill = require('node-raspistill').Raspistill;
const fs = require('fs');
const raspistill = new Raspistill({
    noFileSave: true,
    encoding: 'bmp'
});

raspistill.takePhoto()
    .then((photo) => {
        console.log('took photo');
        fs.writeFile('1.bmp', photo, {encoding: 'binary'}, function (err) {
            if (err) {
                throw err;
            }

            console.log('saved photo');
        })
    })
    .catch((error) => {

node-raspistill

Node wrapper for taking photos using Raspberry Pi raspistill app.

MIT
Latest version published 3 years ago

Package Health Score

48 / 100
Full package analysis