HNHacker News
TopNewBestAskShowJobs

HermannSW

8 karma · joined August 7, 2019

https://stamm-wilbrandt.de/en/Raspberry_camera.html
submissionscomments
HermannSW··on A Guide to Recording 660FPS Video on a $6 Raspberry Pi Camera
Thanks Robert for the youtube videos and the blog, hopefully many more people will play with high framerate video capturing by that.

But 660fps is not the end for v1 camera, I added section "kFPS videos from kEPS multiple exposure frames" to my github "v1 camera global external shutter" repo: https://github.com/Hermann-SW/Raspberry_v1_camera_global_ext...

In that section a 3000fps and a 9000fps animation are shown (and the tools needed to create them)!

The repo introduction now contains comparison of 20$ diy highspeed flashlight with commercially available one (and with the very costly one you cannot produce kEPS multiple exposures and kFPS framerate videos): https://github.com/Hermann-SW/Raspberry_v1_camera_global_ext...

HermannSW··on A Guide to Recording 660FPS Video on a $6 Raspberry Pi Camera
True, and he started with 1/100,000 second exposure time humming-bird images 83 years ago!

The MIT group used a flash with 0.5us exposure time. I asked for details without answer yet, but assume that it is costly (Vela One does cost 940£) and one-shot, no fast repeating flashes (Vela One has only 50Hz maximal continuous strobe frequency).

I used cheap 2$ 5000lm LEDs with 7$ led driver to convert mains to 38V/1.5A DC. I was able to do global external shutter captures with that led with 4us shutter time, did not try below yet. Most interestingly these LEDs allowed for 8.33us flashes at 9KHz frequency and used that to capture 109m/s flying airgun pellet 10 times in a single multiple exposure frame (9000eps, exposures per second). PI pwm should easily allow for 90,000eps frames for capturing 900m/s 0.50bmg bullets multiple times per frame in flight ...

You can do the same with 6$ Raspberry v1 camera clone (not with v2), bill of materials as well as global external shutter setup, software and example captured frames can be found here:

https://github.com/Hermann-SW/Raspberry_v1_camera_global_ext...

HermannSW··on A Guide to Recording 660FPS Video on a $6 Raspberry Pi Camera
Really? USB2 is 300Mbps for PI3 ethernet over USB2, is it faster with hdd? I ask because snail 35MB/s is 280Mbps.
HermannSW··on A Guide to Recording 660FPS Video on a $6 Raspberry Pi Camera
No answer on the networking forum yet. I cannot try because I don't have a Pi4 yet. It seems possible. An easy test would be to test whether this command will work on Pi4:

raspividyuv -md 7 -w 640 -h 480 -t 0 -fps 90 -o - | nc someIp somePort

and on someIp server service listeing on somePort just storing the data received. Because yuv has 12bits/pixel which is a bit more than the 10bit/pixel of raw Bayer, the command produces a 316Mbps stream of data for v1 camera (732Mbps for v2 camera when recording with "-fps 180"). For testing the service on someIp can be as easy as:

nc -l somePort > foobar

HermannSW··on A Guide to Recording 660FPS Video on a $6 Raspberry Pi Camera
> I'm just trying to find what shutter speed you can get with the Pi camera.

You can reduce the shutter time nearly arbitrarily, as long as you increase light intensity. I did place fast rotating propeller just above a 5000lm led, and did two 9us long flashes. See this image on how bright the two blades of propeller look, at both captured locations (the rest is dark, image was taken inside a closed cardbox, without flash everything was just black): https://raw.githubusercontent.com/Hermann-SW/Raspberry_v1_ca...

HermannSW··on A Guide to Recording 660FPS Video on a $6 Raspberry Pi Camera
A group of MIT students did synchronize 16 PIs with 16 cameras just over GPIOs to shoot at exactly the same point in time. And they built in microsecond delay for adjusting on when exactly the bullet has passed through apple and leaves: https://news.ycombinator.com/item?id=20635132
HermannSW··on A Guide to Recording 660FPS Video on a $6 Raspberry Pi Camera
There is no Pi with 10G ethernet. New Pi4 has only Gigabit ethernet, Pi 3B+ has Gigabit Ethernet over USB 2.0 (maximum throughput 300 Mbps).

The idea is interesting, did some calculation. For v1 camera capturing 640xH frames can be done at framerate "42755/H+13". Lets forget about the 13. raspiraw transfers raw10 Bayer data, that is 640xHx1.25 bytes, with maximal framerate that gives 42755x640x1.25=34204000 bytes/s=261Mbit/s(!).

So you definitely need Gigabit ethernet of the Pi4, not sure whether Pi4 can actually stream out 261Mbit without losing stuff though ...

Just asked on Raspberry networking forum (261Mbps for v1, 464Mbps for v2): https://www.raspberrypi.org/forums/viewtopic.php?f=36&t=2482...

HermannSW··on A Guide to Recording 660FPS Video on a $6 Raspberry Pi Camera
I was wrong, the 9$ are for NoIR camera with M12 lens mount and lens. I just ordered 4 new NoIR cameras for 2.84$(!) including shipping! https://www.aliexpress.com/item/32946093276.html
HermannSW··on A Guide to Recording 660FPS Video on a $6 Raspberry Pi Camera
There is a drawback with Raspbian, while Raspbian itself is open source, the GPU code is closed source and you cannot debug it. What you can do is to reverse engineer the I2C traffic from Raspberry GPU to camera (that is one-way): https://www.raspberrypi.org/forums/viewtopic.php?f=43&t=1091...

And you can hack the camera by injecting I2C commands to achieve effects impossible with the normal Raspbian camera software, like taking odd/even frames with different shutter speed: https://www.raspberrypi.org/forums/viewtopic.php?f=43&t=2126...

For reverse engineering camera I2C traffic, the v1 camera ov5647 datasheet is useful to have: https://cdn.sparkfun.com/datasheets/Dev/RaspberryPi/ov5647_f...

HermannSW··on A Guide to Recording 660FPS Video on a $6 Raspberry Pi Camera
Yes, there are NoIR versions of v1 camera, they just miss the infrared filter normal cameras have (around 9$ on aliexpress.com). And there are 12$ versions of v1 camera with (hardware) IR-cut filter, depending on photo sensor on camera IR filter is enabled at day, and removed at night.
HermannSW··on A Guide to Recording 660FPS Video on a $6 Raspberry Pi Camera
Yes, for objects moving with high speed vertically, rolling shutter capturing produces weird frames. But v1 camera can do "global external shutter" as well. See examples on "extreme rolling/global external" shutter for propellers here: https://github.com/Hermann-SW/Raspberry_camera_gallery/blob/...
HermannSW··on A Guide to Recording 660FPS Video on a $6 Raspberry Pi Camera
I think that would be possible, just a problem of adjusting all cameras to get overlapping FOV.

There was a MIT student project group that took 16 v1 cameras(!) global external shutter frames and created an animated .gif from that! "Ultra high-speed imaging, capturing matrix style bullet time" https://www.raspberrypi.org/forums/viewtopic.php?f=43&t=2404...

HermannSW··on A Guide to Recording 660FPS Video on a $6 Raspberry Pi Camera
Yes, you can do 320x240 with modified raspiraw parameters. But you will get the same framerate as for 640x240, for v1 as well as for v2 camera.

You can do the opposite and increase horizonatal resolution for line scanner type of application with still impressive framerates:

"v2 camera can do 3280x32@720fps and 3280x64@500fps with frame skip rate less than 1% (tools attached)."

https://www.raspberrypi.org/forums/viewtopic.php?f=43&t=1091...

You can do quite impressive gobal external shutter capturings (with v1 camera only!), eg. capturing a 109m/s airgun pellet in flight on a single multiple exposure frame 10x: https://github.com/Hermann-SW/Raspberry_v1_camera_global_ext...

HermannSW··on A Guide to Recording 660FPS Video on a $6 Raspberry Pi Camera
You can get Raspberry v1 camera clone now for less than 4$(!) with free shipping on aliexpress: https://www.aliexpress.com/wholesale?SearchText=raspberry+5M...

And unlike v2 camera, the cheap v1 camera allows (besides high framerate capturing) for global external shutter capturing as well(!). I did capture an in flight 109m/s airgun pellet 10 times in a single multiple exposure frame! https://stamm-wilbrandt.de/en/Raspberry_camera.html#global_e...

HermannSW··on A Guide to Recording 660FPS Video on a $6 Raspberry Pi Camera
Deal is "halve vertical resolution and get roughly double framerate", see here for more information: https://news.ycombinator.com/item?id=20633504
HermannSW··on A Guide to Recording 660FPS Video on a $6 Raspberry Pi Camera
Find diagram showing the achievable framerates for 640xH frames for v1 and v2 camera here: https://www.raspberrypi.org/forums/viewtopic.php?f=43&t=2125...

Deal is basically "halve vertical resolution, and get roughly double framerate" (up to cap imit of around 665fps for v1 and exactly 1007fps for v2 camera).

In addition "tools/*_s" tools double vertical FOV while keeping the framerate.

HermannSW··on A Guide to Recording 660FPS Video on a $6 Raspberry Pi Camera
Easiest way to avoid flicker is to light the scene with 1000lm or 5000lm cheap leds with led driver (they power the led with 38V/1.5A DC for 5000lm). Total cost of led+driver is less than 9$ with free shipping on aliexpress.
HermannSW··on A Guide to Recording 660FPS Video on a $6 Raspberry Pi Camera
You can do 640x64@665fps with v1 camera, and 640x128@667fps with v2 camera: https://www.raspberrypi.org/forums/viewtopic.php?f=43&t=2125...

In tools directory you can use *_s tools to get double FOV vertically while keeping the framerate. So you can get 640x128_s@665fps/640x256_s@667fps for v1/v2 camera.

There real limit for v2 camera is 1007fps, with can be achieved with 640x75 or 640x150_s tools. You can reduce vertical resolution below 75, but you will not get more than 1007fps (if you find out how to raise that limit, please shout! Deal for raspiraw high framerate capturing basically is "halve vertical resolution and get double framerate").