Last active
September 7, 2021 20:09
-
-
Save Hermann-SW/f99af390fc75935c6cf21bae601684f3 to your computer and use it in GitHub Desktop.
Measure framerate really achieved by raspividyuv (varying mode, width, height, record time and requested framerate)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# mfpsyuv: measure framerate really achieved by raspividyuv, varying | |
# mode, width, height, record time and requested framerate | |
# | |
#!/bin/bash | |
align () { | |
let x=$(($1-1)) | |
echo $((x+$2-(x%$2))) | |
} | |
if [[ $# -lt 5 ]]; then echo "$0 mode w h t fps"; exit 1; fi | |
tst=`vcgencmd get_camera | grep detected=1` | |
if [[ $tst == "" ]]; then echo "no camera detected"; exit 1; fi | |
#time \ | |
raspividyuv -md $1 -o /dev/shm/t.yuv -t $4 -fps $5 -w $2 -h $3 | |
cmd=`wc --bytes /dev/shm/t.yuv | cut -f1 -d\ `\ | |
"/($(align $2 32)*$(align $3 16)*3/2)/($4/1000)" | |
echo $cmd | bc -ql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://www.raspberrypi.org/forums/viewtopic.php?f=43&t=319199