Code Monkey home page Code Monkey logo

pilapse's Introduction

pilapse

Python module to capture time lapse videos on Raspberry Pi

Examples

pilapse-demo

Installation

It's recommended to create a virtual environment:

python -m venv pilapse
cd pilapse
source bin/activate

For video compiling, simply install pilapse from PyPi:

pip install pilapserec

For recording or image capturing, you also need picamera module:

pip install pilapserec picamera

Usage

To capture an image only (can be used to check the camera beforehand):

pilapse capture

To record a long video:

pilapse record

To make a video out of captured images:

pilapse compile

However, you are advised against video compiling directly on Raspberry Pi, as the system resource may run low and you are almost certainly to be kicked out of the SSH session. For the same reason, you are advised against using the --auto-compile switch. After record session, you can plug the microSD card into your main work station and compile them there.

To manually clean up the working directory (if you specified --preserve while recording):

pilapse clean

For more options, refer to --help command:

(pilapse) aki@hakune:~/pilapse $ pilapse --help
piLapse - capture time lapse video on Raspberry Pi.

Usage:
    pilapse capture [-i <image-name>] [-s <save-dir>] [--no-time] [--verbose]
    pilapse record [-d <duration> | -c] [-f <frequency>] [-l <length>] [-w <width>] [-s <save-dir>] [-S <wait-time>] [--auto-compile] [-o <video-name>] [-F <fps>] [--no-time] [--preserve] [--verbose]
    pilapse compile [-s <save-dir>] [-o <video-name>] [-F <fps>] [--preserve] [--verbose]
    pilapse clean [-s <save-dir>]
    pilapse (-h | --help)
    pilapse --version

Actions:
capture     Take 1 image only.
record      Record a timelapse video.
compile     Compile labelled images into a video.

Options:
-h --help                   Show this screen.
-c --continuous             Set to continuously run mode.
-d --duration DURATION      Set recording duration (by seconds) [default: 600].
-f --frequency FREQUENCY    Set time interval between shots (by seconds) [default: 5].
-F --fps FPS                Set final video fps [default: 24].
-l --length LENGTH          Set image length dimension (by pixel) [default: 3280].
-w --width WIDTH            Set image width dimension (by pixel) [default: 2464].
-s --save-dir SAVINGDIR     Set working and saving directory [default: ~/Videos/pilapse].
-S --shutter-wait TIME      Set timer before start capturing (by seconds) [default: 0].
-i --image-name NAME        Set image name in capture mode [default: image.jpg].
-o --output-video NAME      Set output video name.
-a --auto-compile           Automatically compile images [default: True].
-p --preserve               Do not automatically clean up after recording.
-n --no-time                Do not add time in capture mode.
--verbose                   Set to verbose mode.
--version                   Show version.

Acknowledged issues

To keep the process running after log out of SSH, you can use screen or tmux:

sudo apt install tmux
tmux
pilapse record

If you encounter numpy error while making videos on Raspberry Pi, run this command and try to compile again:

sudo apt install libatlas-base-dev ffmpeg

Literally any other issue can be solved with:

pip install --upgrade moviepy

Development

Any contribution is deeply appreciated.

pilapse's People

Contributors

git-akihakune avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.