Timelapse image capture daemon for Raspberry Pi Camera Module, built with Go
It is for capturing images with some interval, using Raspberry Pi Camera Module.
These captured images can be used as each frame of a timelapse video.
You need:
You need to create your own config file.
Sample file is included, so feel free to copy it and change values as you want.
$ cp config.json.sample config.json
$ vi config.json
You can configure it to save files locally, send via SMTP, upload to Dropbox or S3 like this:
"storages": [
{
"type": "local",
"path": "/home/meinside/photos/timelapse"
},
{
"type": "smtp",
"smtp_recipients": "[email protected],[email protected]",
"smtp_email": "[email protected]",
"smtp_passwd": "sender-email-password",
"smtp_server": "sender.smtp-server.com:587"
},
{
"type": "dropbox",
"path": "/timelapse",
"dropbox_token": "Tttttttt_oOOOOOOO-kkkkkkkk-eeeeeee_NNNNNNNN"
},
{
"type": "s3",
"path": "/optional/directory/in/bucket",
"s3_bucket": "my-s3-bucket-name"
}
]
When not needed, just remove the unwanted one from storages.
$ go get -d github.com/meinside/rpi-camera-timelapse-go
$ cd $GOPATH/src/github.com/meinside/rpi-camera-timelapse-go
$ go build
$ docker-compose build
$ docker-compose build --build-arg RPI=raspberry-pi2
$ docker-compose build --build-arg RPI=raspberry-pi
Just execute the compiled binary:
$ ./rpi-camera-timelapse-go
If nothing goes wrong, images will be captured and stored periodically as you configured.
$ docker-compose up
$ sudo cp systemd/rpi-camera-timelapse-go.service /etc/systemd/system/
$ sudo vi /etc/systemd/system/rpi-camera-timelapse-go.service
and edit User, Group, WorkingDirectory, and ExecStart values.
You can simply start/stop it with:
$ sudo systemctl start rpi-camera-timelapse-go.service
$ sudo systemctl stop rpi-camera-timelapse-go.service
If you want to launch it automatically on boot:
$ sudo systemctl enable rpi-camera-timelapse-go.service
$ docker-compose up -d
Use ffmpeg:
$ ffmpeg -framerate 30 -pattern_type glob -i '*.jpg' -c:v libx264 timelapse.mp4
Please open an issue.
MIT