summaryrefslogtreecommitdiffstats
path: root/tools/outro
blob: 1a653485cb94814dcae84c8f4a4fc7fad05e7e7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/bash
#
# Date:    2009-12-16
# Author:  Ole Kristian Lien
# License: GNU General Public License
#
# Generate outro-file with fade in/out from csv-file

EXT=`echo "$1"|awk -F . '{print $NF}'`
BASENAME=`basename $1 .$EXT`
COUNT=10

NAME=`./csv $2 $1 name`
LOCATION=`./csv $2 $1 location`
TAKK=`./csv $2 $1 takk`
URL=`./csv $2 $1 url`

if [ -z "$1" ]; then
	echo "Usage: $0 <video-file> <csv-file>"
	exit 1
fi

echo -n " * Generating outro-video..."

./image_text $1 outro-$COUNT black "TAKK TIL"
./fade $BASENAME-outro-$COUNT.png 3 black
rm $BASENAME-outro-$COUNT.png
COUNT=`expr $COUNT + 1`

./image_text $1 outro-$COUNT black "$NAME" Foredragsholder
./fade $BASENAME-outro-$COUNT.png 1 black
rm $BASENAME-outro-$COUNT.png
COUNT=`expr $COUNT + 1`

./image_text $1 outro-$COUNT black "$LOCATION" Lokaler
./fade $BASENAME-outro-$COUNT.png 1 black
rm $BASENAME-outro-$COUNT.png
COUNT=`expr $COUNT + 1`

# dirty hack
oldIFS=$IFS
IFS='
'
for i in $TAKK ; do
	HVA=`echo "$i" | cut -d ":" -f 1`
	HVEM=`echo "$i" | cut -d ":" -f 2`

	./image_text $1 outro-$COUNT black "$HVEM" "$HVA"
	./fade $BASENAME-outro-$COUNT.png 1 black
	rm $BASENAME-outro-$COUNT.png
	COUNT=`expr $COUNT + 1`
done
IFS=$IFS

for i in $URL ; do
	./image_text $1 outro-$COUNT black " "
	./fade $BASENAME-outro-$COUNT.png 1 black
	rm $BASENAME-outro-$COUNT.png
	COUNT=`expr $COUNT + 1`

	./image_text $1 outro-$COUNT black "$i"
	./fade $BASENAME-outro-$COUNT.png 2 black
	rm $BASENAME-outro-$COUNT.png
	COUNT=`expr $COUNT + 1`
done

./image2video $1 outro
rm $BASENAME-outro*.png

echo -e "OK!"