Adding new encoding scripts and the template file.
[public/talk-scripts.git] / encode.sh
1 #!/bin/bash
2
3 #####
4 # TODO: b4taylor
5 # * Progress printing
6
7 if [ $# !=  "2" ] ; then
8     echo "Usage: encode input-video.format output_prefix";
9     exit 1;
10 fi
11
12 mkdir "encodes" 2> /dev/null
13 if [ ! -d "encodes" ] ; then
14     echo "Could not create directory: encodes"
15     exit 1
16 fi
17
18 mkdir "timings" 2> /dev/null
19 if [ ! -d "timings" ] ; then
20     echo "Could not create directory: timing"
21     exit 1
22 fi
23
24 TIC=`date +%s`
25
26 # Job1: avi (xvid, mp3)
27 ./make-avi.sh $1 $2 &
28
29 # Job2: mp4 (h264, aac)
30 ./make-mp4.sh $1 $2 &
31
32 # Job3: mpg (mpeg2, mp2)
33 ./make-mpg.sh $1 $2 &
34
35 # Job4: ogg (theora, vorbis)
36 ./make-ogg.sh $1 $2 &
37
38 # Job5: flv
39 ./make-flv.sh $1 $2 &
40
41 wait
42
43 ./make-thumbs.sh $1 $2
44
45 TOC=`date +%s`
46
47 LOG="$2.log"
48 for i in timings/$2*.log ; do
49     echo $i >> $LOG
50     cat $i >> $LOG
51     rm $i
52 done
53
54 {
55     echo "$1"
56     echo "Total: `expr $TOC - $TIC`"
57 } >> $LOG
58
59 mv $LOG "timings"
60