Giter Club home page Giter Club logo

sunsetpi's Introduction

sunsetpi - A Raspberry Pi powered, automated time-lapse project

Photos are taken regularly throughout the day. At the end of the day a 4k time-lapse is generated and uploaded to YouTube.

Currently running at Nipomo Sunset Pi on YouTube.

Future Plans

  • Add configuration to save data to an external drive.
    • Daily backup to a network drive.
  • Use localized sunrise/sunset times to start and stop the time-lapse.
  • Slow down the time-lapse around the sunset.
    • Make a separate sunset-only time-lapse without affecting the day-long time-lapse.
  • Automatically add title and end screens
    • Uses a photo with a Ken Burns effect with the date and music information in the subtitle.
    • Make the title photo a picture of the daily sunset.
  • Make the YouTube thumbnail be about 15 minutes before sunset.
  • Automatically add royalty free music to the videos.
    • Would be cool to automatically scrape the YouTube audio library.
    • More likely I'll download a bunch of music, put it into a folder and cycle through them. (this is what I did)
  • Add image stabilization to remove wind shaking.
  • Make long term time-lapses of solar noon, and of each sunset showing how the sun moves across the horizon as the seasons pass.
    • Automatically make a monthly time-lapse.
    • Make a yearly time-lapse.
    • Make multi-year time-lapses.
  • Automatically maintain monthly playlists on YouTube (August 2020, September 2020, etc.).
  • Make the latest video always the featured video on the channel.
  • Integrate with weather API to show daily high and low teperatures and daily rainfall.
  • Add an AI voice over and shorten the title
  • Add links to previous year's videos
  • Automatically upload monthly time-lapses

Dependencies

Recommended Hardware

Installation Instructions

  1. Setup a Raspberry Pi (preferably in headless mode, but not required)
  2. Install an external hard drive and edit fstab so that it always mounts to the same location.
    • This may be optional if you don't care to save the raw data.
    • Carefully follow the instructions found here.
  3. Install dependencies:
sudo apt install ffmpeg
sudo apt install imagemagick
sudo apt install python3-pip

# I like to have an alias that forces the python3 and pip3... so that's what I do:
echo 'alias python=python3' >> ~/.bash_aliases
echo 'alias pip=pip3' >> ~/.bash_aliases
source ~/.bashrc

# install a virtual environment to install all the YouTube specific stuff we need
cd
pip install virtualenv
python -m virtualenv youtube
source youtube/bin/activate
python -m pip install google-api-python-client
python -m pip install oauth2client
deactivate
  1. clone this project:
cd
git clone https://github.com/kevinabrandon/sunsetpi.git
  1. Download the NOAA Solar Calculations for the year
    • Go to the NOAA Solar Calculator and enter in your gps location
    • Click the "Create Sunrise/Sunset Tables for the Year" button
    • Using the mouse select the text of each table and copy and paste them into a spreadsheet program (I used google sheets).
    • Export each table as a csv file called:
      • YYYY-sunrise.csv
      • YYYY-sunset.csv
      • YYYY-solarnoon.csv
    • Make the YYYY the current year
    • Save the csv files into ~/sunsetpi/solar-tables/
  2. setup crontab:
crontab -e

Add the following lines to the contab:

# trigger the camera every minute:
* * * * * . $HOME/sunsetpi/config.sh; $SUNSETPI_PATH/trigger_cam.sh
# trigger the camera on the 15, 30 and 45 seconds of each minute for the sunset portion:
* * * * * . $HOME/sunsetpi/config.sh; $SUNSETPI_PATH/trigger_cam.sh 15
* * * * * . $HOME/sunsetpi/config.sh; $SUNSETPI_PATH/trigger_cam.sh 30
* * * * * . $HOME/sunsetpi/config.sh; $SUNSETPI_PATH/trigger_cam.sh 45

# trigger the daily time-lapse creation at 9:15 pm every day:
15 21 * * * . $HOME/sunsetpi/config.sh; $SUNSETPI_PATH/make_daily_timelapse.sh
  1. Setup your project on Google API Console
  2. From the Google API Console create oauth2 credentials and put them in ~/sunsetpi/credentials.json
  3. After the first day of photos manually run the make_daily_timelapse.sh so that you are able to follow the youtube authorization instructions in the console.
  4. For now on the auth is saved and the make_daily_timelapse.sh can be run via cron each day.

sunsetpi's People

Contributors

kevinabrandon avatar

Stargazers

 avatar  avatar  avatar  avatar Dave Payne avatar Andrew Ferguson avatar  avatar  avatar  avatar Brian Ward avatar TimV avatar  avatar  avatar Player 1 avatar Christian Stewart avatar  avatar  avatar Dick avatar Tomer Shvueli avatar Ash avatar Vivek Maru avatar MDCOA avatar  avatar  avatar Jason avatar Kenneth Brandon avatar  avatar

Watchers

 avatar  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.