Script for å beregne soloppgang og solnedgang, til bruk med raspistill
[einar-bin] / mkintro.sh
1 #!/bin/bash
2
3 # This script will make a text based intro movie of 5 seconds lenght
4
5 if [ -f "$1" ]; then
6 filename=$1
7
8 # make the source image:
9 convert xc:black -resize 640x480! -antialias -gravity "Center" -fill white -font Helvetica -pointsize 34 -annotate 0 @$filename "$filename"000.jpg
10
11 # link it 125 times for 5 seconds:
12 for ((i=1;i<125;i+=1)); do
13 ln -s "$filename"000.jpg "$filename"`printf "%03d" "$i"`.jpg
14 done
15
16 # make the movie:
17 mencoder mf://*.jpg -mf w=640:h=480:fps=25:type=jpg -ovc lavc -lavcopts vcodec=mpeg1video -oac copy -o "$filename".avi
18 # mencoder mf://*.jpg -mf w=640:h=480:fps=25:type=jpg -ovc raw -oac copy -o "$filename".avi
19
20 # clean up after ourselves:
21 for ((i=1;i<125;i+=1)); do
22 rm "$filename"`printf "%03d" "$i"`.jpg
23 done
24
25 else
26 echo "Usage: mkintro.sh textfile" && exit
27 fi