/
tunnel
executable file
·69 lines (55 loc) · 1.66 KB
/
tunnel
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
#!/bin/bash
RUNNING_BEAR=./bin/tunnel-launcher
MODE="$1"
ARGS="--log-level=verbose --log-file=log.txt"
rm -f *.timelog
if [ "$MODE" == "gdb" ]
then
shift 1
gdb --args $RUNNING_BEAR $ARGS "$@"
elif [ "$MODE" == "valgrind" ]
then
shift 1
echo $ARGS "$MODE" "$@" | xargs valgrind --leak-check=full --show-reachable=yes --error-limit=no --track-origins=yes $RUNNING_BEAR 2>&1
else
echo $ARGS "$MODE" "$@" | xargs $RUNNING_BEAR
echo "The program emitted the following error messages:"
grep '\(erreur\)\|\(avertissement\)' log.txt | uniq -c
fi
if which transcode >/dev/null \
&& ls ~/.tunnel/*.seq >/dev/null 2>/dev/null
then
for SEQ in ~/.tunnel/*.seq
do
BASE=$(echo $SEQ | sed 's/\.seq$//')
FPS=60 #$(cat $SEQ | cut -d' ' -f1)
echo "$BASE" "$FPS"
# Lossless Mov
TMP=$(mktemp)
find ~/.tunnel/ -name "$(basename $BASE)-*.bmp" | sort > $TMP
transcode -i $TMP -x imlist,null -g 1280x720 --export_fps 60 -y mov,null \
-F yuv2 -f 1 -H 0 -V rgb24 -o $BASE.mov
rm "$TMP"
# High quality MJPEG
# mencoder mf://$BASE-*.bmp -mf w=1280:h=720:fps=60:type=bmp \
# -ovc lavc -lavcopts vcodec=mjpeg:vqscale=0 -oac copy -o $BASE.avi
# H.264
# mencoder mf://$BASE-*.bmp \
# -mf w=1280:h=720:fps=$FPS:type=bmp -ovc x264 \
# -oac copy -o $BASE.avi
done
fi
rm -f $HOME/.tunnel/s-*.bmp
rm -f $HOME/.tunnel/*.seq
if ls *.timelog >/dev/null 2>/dev/null && which gnuplot >/dev/null
then
( echo 'set term svg'
echo 'set output "timelog.svg'
echo -n "plot "
for f in *.timelog
do
echo '"'$f'" title "'$(basename $f .timelog)'" with lines, \'
done
echo "0 notitle with points 0"
) | gnuplot 2>/dev/null
fi