-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrenderdemos.sh
More file actions
executable file
·56 lines (45 loc) · 1.91 KB
/
renderdemos.sh
File metadata and controls
executable file
·56 lines (45 loc) · 1.91 KB
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
#loop through the all the .dmo files in demos/ and for each of them, start up sauer, record the demo, and then quit
#command to start sauer from inside sauer root directory:
# ./bin_unix/native_client -q/home/isaac/.sauerbraten
#how to specify which player to spec??
[ $# -ne 1 ] && echo "Script takes one argument, the name of the demo to render (without .dmo)" && exit 1
demosdir="/var/local/$(whoami)/sauer-recorder/demos"
sauerdir="/var/local/$(whoami)/sauer-recorder/sauerbraten"
pushd "$demosdir" >/dev/null
pushd "$sauerdir" >/dev/null
#for demo in $(ls *.dmo | cut -d'.' -f1); do
demo="$1"
#write out CS script
echo "Creating CS script ${demosdir}/record.cfg"
echo "//generated by ../renderdemos.sh
demo ${demo}
ragdollairfric 1
ragdollgroundfric .9999
screenres 1920 1080
gamespeed 50
moview 1920
movieh 1080
moviefps 16
name 'eS|TV
movieaccel 0
//pausegame 1
sleep 1000 [ pausegame 1 ];
sleep 1100 [ movie ${demo}.avi; clearconsole;
sleep 609000 [ gamespeed 100; showscores; movie;
sleep 100 [ quit;
];
];
];" > ../demos/record.cfg
sauerconout="/${demosdir}/../sauerconout.log"
echo "Rendering demo ${demo} with pov from ${player}..."
./bin_unix/native_client -g${sauerconout} -x"exec record.cfg" -q${demosdir} >& ${demosdir}/../sauerbraten-recent.log && echo "Demo rendering completed!" || echo "Unexpected failure while rendering demo, check /var/local/$(whoami)/sauer-recorder/sauerbraten.log"
popd
#back to var/local/usr/demos
cd ../demos
mencoder -speed 2 -o ../done/${demo}-reencoded.avi -ovc lavc -oac mp3lame ${demo}.avi > mencoder-latest.out
# mencoder -speed 2 -o acu-fast.avi -oac mp3lame -ovc lavc acu.avi
#echo mv ${demo} "../done"
rm ${demo}.avi
echo mv ${demo}-reencoded.avi "../done/${demo}.avi"
#done
popd