Tuesday, December 21, 2010

Full planet weather timelapse

This is the most recent weather time-lapse video I made:




Now with music! =P
Making this was really simple thanks to the image filenames following a predictable pattern. At first I thought I would need to do something really complicated like image recognition, or something with image layers to automate this, but luckily it was not necessary.

Here is the complete script:

#!/bin/bash

wget --limit-rate=100k -e robots=off -U "Mozilla/5.0 (compatible; Konqueror/3.2; Linux)" -np -l1 -r  -A .jpg -N  http://goes.gsfc.nasa.gov/goescolor/goeswest/overview2/color_lrg/older_images/

wget --limit-rate=100k -e robots=off -U "Mozilla/5.0 (compatible; Konqueror/3.2; Linux)" -np -l1 -r  -A .jpg -N  http://goes.gsfc.nasa.gov/goescolor/goeswest/overview2/color_lrg/

wget --limit-rate=100k -e robots=off -U "Mozilla/5.0 (compatible; Konqueror/3.2; Linux)" -np -l1 -r  -A .jpg -N http://goes.gsfc.nasa.gov/goescolor/goeseast/overview2/color_lrg/older_images/

wget --limit-rate=100k -e robots=off -U "Mozilla/5.0 (compatible; Konqueror/3.2; Linux)" -np -l1 -r  -A .jpg -N http://goes.gsfc.nasa.gov/goescolor/goeseast/overview2/color_lrg/

mkdir temp
mkdir temp/west
mkdir temp/east

cp goes.gsfc.nasa.gov/goescolor/goeswest/overview2/color_lrg/older_images/*.jpg temp/west
cp goes.gsfc.nasa.gov/goescolor/goeswest/overview2/color_lrg/*.jpg temp/west

cp goes.gsfc.nasa.gov/goescolor/goeseast/overview2/color_lrg/older_images/*.jpg temp/east
cp goes.gsfc.nasa.gov/goescolor/goeseast/overview2/color_lrg/*.jpg temp/east

rm temp/west/latest*.jpg
rm temp/east/latest*.jpg

mkdir temp/west/lower
mkdir temp/west/upper
mkdir temp/west/full

mkdir temp/east/upperbig
mkdir temp/east/uppersmall
mkdir temp/east/full
mkdir temp/east/lower

mv temp/west/*22.jpg   temp/west/lower
mv temp/west/*52.jpg   temp/west/lower
mv temp/west/*30.jpg   temp/west/upper
mv temp/west/*45.jpg   temp/west/upper
mv temp/west/*15.jpg   temp/west/upper
mv temp/west/*0000.jpg temp/west/full
mv temp/west/*0300.jpg temp/west/full
mv temp/west/*0600.jpg temp/west/full
mv temp/west/*0900.jpg temp/west/full
mv temp/west/*1200.jpg temp/west/full
mv temp/west/*1500.jpg temp/west/full
mv temp/west/*1800.jpg temp/west/full
mv temp/west/*2100.jpg temp/west/full
mv temp/west/*00.jpg   temp/west/upper


mv temp/east/*0545.jpg temp/east/full
mv temp/east/*0845.jpg temp/east/full
mv temp/east/*1145.jpg temp/east/full
mv temp/east/*1445.jpg temp/east/full
mv temp/east/*1745.jpg temp/east/full
mv temp/east/*2045.jpg temp/east/full
mv temp/east/*2345.jpg temp/east/full
mv temp/east/*0245.jpg temp/east/full
mv temp/east/*45.jpg   temp/east/upperbig
mv temp/east/*15.jpg   temp/east/upperbig
mv temp/east/*9.jpg    temp/east/lower
mv temp/east/*1.jpg    temp/east/uppersmall

ls temp/west/lower/*.jpg -rt > filelist.txt
ls temp/west/upper/*.jpg -rt >> filelist.txt
ls temp/west/full/*.jpg  -rt >> filelist.txt

ls temp/east/upperbig/*.jpg   -rt >> filelist.txt
ls temp/east/uppersmall/*.jpg -rt >> filelist.txt
ls temp/east/full/*.jpg       -rt >> filelist.txt
ls temp/east/lower/*.jpg      -rt >> filelist.txt


mencoder "mf://@filelist.txt" -mf fps=12 -o no_sound.avi -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=4000 -vf scale=640:480
mencoder -oac copy -ovc copy  -o output_movie5.avi -audiofile music.mp3 no_sound.avi

I'ts really basic and intended for running it once, and then deleting all the folders. Enjoy!