forked from raspberrypi/raspiraw
-
Notifications
You must be signed in to change notification settings - Fork 0
/
640x128_s
executable file
·25 lines (18 loc) · 971 Bytes
/
640x128_s
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
#!/bin/bash
if [ "$1" = "" ]; then echo "format: `basename $0` ms"; exit; fi
echo "removing /dev/shm/out.*.raw"
rm -f /dev/shm/out.*.raw
if [ "`cat /proc/cpuinfo | grep Revision | grep 9000`" = "" ]; then fps=659; else fps=499; fi
echo "capturing frames for ${1}ms with ${fps}fps requested"
raspiraw -md 7 -t $1 -ts tstamps.csv -hd0 hd0.32k --height 64 --top 0 --vinc 1F --fps $fps -sr 1 -o /dev/shm/out.%04d.raw 2>/dev/null >/dev/null
us=`cut -f1 -d, tstamps.csv | sort -n | uniq -c | sort -n | tail -1 | cut -b9-`
l=`ls -l /dev/shm/out.*.raw | wc --lines`
echo "$l frames were captured at $((1000000 / $us))fps"
echo "frame delta time[us] distribution"
cut -f1 -d, tstamps.csv | sort -n | uniq -c
echo "after skip frame indices (middle column)"
grep "^[2-9]" tstamps.csv
skips=`grep "^[2-9]" tstamps.csv | wc --lines | cut -f1 -d\ `
stamps=`wc --lines tstamps.csv | cut -f1 -d\ `
per=`expr \( 100 \* $skips \) / \( $skips + $stamps \)`
echo "$per% frame skips"