Here is a sample frame, dcraw processed and converted to .png:

Half an hour ago I asked myself how fast 640x64 can be captured.
I was even able to capture with 1000fps(!), but interleaved with many frame skips.
So I did what this thread is about, capturing with 900fps, looks still coloful for 1000/900=1.1ms shutter time:

Now frame skip and delta distribution analysis are possible, I captured 7171 frames in 8s with Pi 2B and v1 camera:
Code: Select all
$ rm /dev/shm/out.*.raw
$ raspiraw -md 7 -t 8000 -ts tstamps.csv -hd0 hd0.raw -h 32 --vinc 1F --fps 900 -r "380A,0020;3802,78;3806,05DF" -sr 1 -o /dev/shm/out.%04d.raw 2>/dev/null
Using i2C device /dev/i2c-0
$ ls -l /dev/shm/out.*.raw | wc --lines
7171
$
Although 7171 frames got captured in 8s, /dev/shm is filled <50%. So you can capture 16s of 900fps video!
Code: Select all
$ df /dev/shm
Filesystem 1K-blocks Used Available Use% Mounted on
tmpfs 448396 202888 245508 46% /dev/shm
$
Timestamp analysis can be done from tstamps.csv generated by above command line:
Code: Select all
$ cut -f1 -d, tstamps.csv | sort -n | uniq -c
1
4 1097
3 1098
3 1099
2825 1100
4228 1101
4 1102
2 1103
4 1104
1 2200
73 2201
22 2202
1 2203
$
So the frame delta time is 1101us ± 4us (908.2fps), with 1+73+22+1=97 frame skips.
Code: Select all
$ bc -ql
1000000/1101
908.26521344232515894641
This allows to find a longer range without skips:
Code: Select all
$ grep "^2" tstamps.csv
2200,2,26521736979
...
2201,77,26521847039
2201,921,26522777046
2201,2801,26524847274
2201,4699,26526937313
2201,6484,26528902984
...
2201,6600,26529104394
$
There are no frame skips for 1898 frames in range 2801-4698.
This is how above 640x64 frame was generated from raw Bayer:
Code: Select all
$ cat hd0.raw /dev/shm/out.3000.raw >out.3000.raw
$ dcraw out.3000.raw
$ double out.3000.ppm > out.3000.ppm.d
$ pnmtopng out.3000.ppm.d > out.3000.ppm.d.png
$
github repo contains lot of documentation, and tools to automatically create .ogg video and animated .gif from a given set of frames. You can see some animated .gifs created that way above in this thread.
P.S:
Even if taking the frame skips into account, the average framerate is still 896fps!
Code: Select all
$ echo "1000000/(((7171-97)*1101+97*2201)/7171)" | bc -ql
896.15421000650964618592
$
The timestamp file can be converted into a Matroska format. That allows to create a .mkv Matroska video from the .ogg video, where each frame gets exactly played at the correct timestamp. With such a .mkv video the frame skips can be neglected.