https://github.com/ronguest/window-on-weather
Collects time-lapse GIF and MP4 videos using Raspberry Pi and the Pi Camera. I use it to capture the sky/weather
https://github.com/ronguest/window-on-weather
camera gif mp4 raspberry-pi sky time-lapse weather
Last synced: 3 months ago
JSON representation
Collects time-lapse GIF and MP4 videos using Raspberry Pi and the Pi Camera. I use it to capture the sky/weather
- Host: GitHub
- URL: https://github.com/ronguest/window-on-weather
- Owner: ronguest
- License: gpl-3.0
- Created: 2019-02-11T18:35:42.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-02-13T22:22:35.000Z (over 6 years ago)
- Last Synced: 2025-01-15T07:55:14.742Z (4 months ago)
- Topics: camera, gif, mp4, raspberry-pi, sky, time-lapse, weather
- Language: Shell
- Size: 33.2 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Time-lapse Video Project for Raspberry Pi
This project was created in order to collect time-lapse videos of the sky outside my house on a continuous basis (24/7). It could be used to collect time-lapse video of anything but this is the purpose for which it was built.
## Required Hardware
* Raspberry Pi with WiFi or Ethernet (I used a Pi B2 with a TP-Link WiFi adapter)
* Raspberry Pi camera (I used a V1 camera but V2 should work as well)
* Micro SD card (I started with an 8GB card but it wasn't large enough. 16GB would have worked but I had a 32GB handy and used that)You should have a web server configured as well as having enabled the camera. I find it easiest to work with the Pi over SSH rather than using a display+keyboard+mouse. If you feel the same you will also need to enable SSH access. The Pi webserver is assumed to store it's files in /var/www/html. The "wx" directory needs to be created manually within that directory.
For camera installation instruction [refer to this web site](https://www.raspberrypi.org/documentation/usage/camera/README.md).
## Software Components
* crontab entries to launch the necessary scripts on a schedule
* Three shell scripts
* _capture_wx.sh_ - captures a series of GIF images then combines them into an animated GIF and calls video.py to create a separate MP4 time-lapse
* _compile_wx.sh_ - runs once an hour and combines the previous hour's MP4 time-lapse into a single file
* _delete_wx.sh_ - runs once a day and deletes the video files created 2 days prior
* One Python script
* _video.py_ - records time-lapse in MP4, called from capture_wx.sh
* Note: If raspivid is used directly the first frames are highly over-exposed while auto-exposure makes adjustments. video.py records and throws away a few seconds of video to avoid this issue before recording the time-lapse.## Installation
* In /home/pi create a directory named _wx_video_
* Make sure _/var/www/html/wx_ exists and the current user has read and write permission
* Place the three shell scripts and the video.py script in that directory
* Run _crontab -e_ and place the final three lines from _crontab.txt_ into the crontabOnce everything is installed and running visit your Pi's webserver IP and append one of these strings to access the files:
* _wx/current.gif_ will display the most recent GIF (recorded every 10 minutes if you use my crontab entries)
* _wx/current.mp4_ displays roughly 2 minutes of real time into a 10 second MP4 time lapse (also updated every 10 minutes)
* _wx/current_hour.mp4_ displays a compilation of the previous hour's MP4 files (five 10 minute time lapses)If your Pi has IP address 192.168.1.73 and your web server is using the default port then visiting _http://192.168.1.73/wx/current.gif_ with your browser should load the most recent GIF.