Code: Select all
on Raspberry Pi do this:
# git clone https://github.com/raspberrypi/userland
# cd userland
# ./buildme
Basically the video is recorded continuously into a large memory buffer until it either receives a keypress or a SIGUSR1 signal from another application, it then writes the contents of the memory buffer into the file.
Why is it good, basically it means it doesn't keep writing video to the disk and therefore saves your SD card but gives you full speed H264 HD video terminating at the trigger time.
Usage:
Code: Select all
# raspivid -c -o [filename] {-k -s} -t [time_ms] -b [bitrate_bps]
Code: Select all
Record to circular buffer at rate of 10MBit and record 5 seconds, terminate by keypress
# raspivid -c -o out.h264 -k -t 5000 -b 10000000
So what you want to do is download the audio trigger software
Code: Select all
# git clone https://github.com/ghollingworth/audio_trigger
# make
# raspivid -c -o out.h264 -s &
# arecord -D hw:0,1 -f S16_LE | ./audio_trigger `pidof raspivid`
# omxplayer out.h264
What's it useful for:
1) Set up raspberry pi pointing at you on a golf range
2) start raspivid
3) hit the ball
4) watch the video
Just to note: It's not perfect yet, there are a few bugs in the way I track I-frames in the circular buffer but it works for five second clips (seems to have trouble with shorter clips...) Also I could do with fixing up audio_trigger to have a few more options such as a post trigger delay (to catch the follow through) and of course it's crying out for James to get the 90fps and 120fps options running!