forked from larsdehlwes/highspeed-raspiraw_rpi4
-
Notifications
You must be signed in to change notification settings - Fork 0
/
2592x1944_s
executable file
·25 lines (18 loc) · 890 Bytes
/
2592x1944_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
fps=30
echo "capturing frames for ${1}ms with ${fps}fps requested"
raspiraw -md 2 -t $1 -ts tstamps.csv -hd0 hd0.32k --height 972 --top 0 --vinc 31 --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 "^[1-24-9]" tstamps.csv
skips=`grep "^[1-24-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"