User avatar
HermannSW
Posts: 1651
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: v2 camera can capture 1000fps videos ...

Wed Apr 17, 2019 9:22 pm

yt38 wrote:
Wed Apr 17, 2019 12:54 pm
Hi, would a black and white capture change anything in resolution, size, fps?
I don't know black and white cameras, only monochrome cameras besides the raw Bayer color cameras.
This thread is about capturing with raspiraw, and only few cameras connected to CSI-2 interface are supported right now:
ov5647 (v1 camera), imx219 (v2 camera) and adv7282m.

Which camera do you talk about?
⇨https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/github_repo_i420toh264
https://github.com/Hermann-SW/fork-raspiraw
https://twitter.com/HermannSW

yt38
Posts: 2
Joined: Wed Apr 17, 2019 12:50 pm

Re: v2 camera can capture 1000fps videos ...

Thu May 02, 2019 7:27 pm

Having a very limited background with image capture, I assumed the amount of information would be less if monochrome. I don't know if the picamera v2 would have this option before capturing. So my question was for a PiCamera V2.

User avatar
HermannSW
Posts: 1651
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: v2 camera can capture 1000fps videos ...

Fri May 03, 2019 3:51 pm

> I don't know if the picamera v2 would have this option before capturing.
>
To my knowledge not.

> So my question was for a PiCamera V2.
>
The v2 camera transmits raw Bayer data, either 8, 10, 12 or 16 bit. And the pixels receive one color only per 2x2 subarea (red/green/blue):
rg
gb

ov7251 monochrome global shutter camera does sends 8 or 10 bit grey pixels:
https://www.ovt.com/sensors/OV7251
gg
gg

So in case of same bit depth (8 or 10 for v2/ov7251) the transferred data size is identical.
⇨https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/github_repo_i420toh264
https://github.com/Hermann-SW/fork-raspiraw
https://twitter.com/HermannSW

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7527
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: v2 camera can capture 1000fps videos ...

Fri May 03, 2019 5:15 pm

As Hermann says, the sensor is not a full RGB array, it has a Bayer colour filter on the front (see https://en.wikipedia.org/wiki/Bayer_filter). Image processing can convert that into a full RGB image. They also generally produce a 10bit/pixel value, as the image processing requires a little more precision to avoid losing detail in the conversion. (Some more recent sensors produce 12 or 14bits/pixel for greater colour accuracy).

It is possible to get sensors without a Bayer CFA, but none of the standard Pi cameras work that way.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

hojo
Posts: 11
Joined: Mon Apr 18, 2016 3:54 pm

Re: v2 camera can capture 1000fps videos ...

Sun Jun 30, 2019 10:32 pm

This is all very exciting. I just spent quite some time looking for the I2C information for GoPro, wanting to figure out how to inject my own time code (there is an existing solution one can buy, of course).

But, since my solution doesn't need gopro or even that high of resolution (and the time code isn't for syncing multiple video sources), I am wondering how I can either code or embed absolute timestamps into 100fps video. Meaning, read in system time (synced with chrony against gps clock) and code unixEpoch.mills into each frame.

Any thoughts on this? I have never touched the camera stuff on the pi so this is brand new to me.

User avatar
HermannSW
Posts: 1651
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: v2 camera can capture 1000fps videos ...

Sun Jun 30, 2019 10:46 pm

You can capture Raspberry v2 camera with up to 120fps (limit is 200fps) as .h264 video with raspivid. Using -pts option you will get a file of microsecond reolution timestamps for each and every frame. Using mkvmerge you can merge the .h264 video and timestamps file into a video where each frame knows exactly its timestamp.Then you can use a gstreamer pipeline with timeoverlay to get what you want. This is just one example how you can do that.
⇨https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/github_repo_i420toh264
https://github.com/Hermann-SW/fork-raspiraw
https://twitter.com/HermannSW

User avatar
HermannSW
Posts: 1651
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: v2 camera can capture 1000fps videos ...

Tue Jul 02, 2019 10:11 am

I forgot that I posted the exact steps needed in this posting:
https://www.raspberrypi.org/forums/view ... e#p1294557

For timestamp 8467.329 from .pts file:
Image
⇨https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/github_repo_i420toh264
https://github.com/Hermann-SW/fork-raspiraw
https://twitter.com/HermannSW

hojo
Posts: 11
Joined: Mon Apr 18, 2016 3:54 pm

Re: v2 camera can capture 1000fps videos ...

Tue Jul 02, 2019 9:32 pm

Sweet. I'll have to look at that. This gives me a place to start as cameras and video are not my forte in any way.

In short, my goal is to build a system for race timing where the camera acts as a backup timer. Any issues with times and we can go back to the video and see who cross the finish line, in which order, and at what time. The main timing module is a GPS disiplined clock with thousandths resolution. 100 fps against this time source would be perfect.

This is not a unique solution as cameras for race timing are quite common in disciplines like Track where a beam isn't as usable. So I want to build my own solution for the challenge, education, and to fit low profile/power criteria. I time races in the middle of nowhere with low power, zero network connectivity, and I have to pack into/out of some challenging terrain.

Thanks for the info!

User avatar
HermannSW
Posts: 1651
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: v2 camera can capture 1000fps videos ...

Thu Jul 04, 2019 6:52 am

> The main timing module is a GPS disiplined clock with thousandths resolution. 100 fps against this time source would be perfect.
>
Be aware that while you could do gstreamer timeoverlay in pipeline while recording, it will drop raspivid's framerate significantly.
That was the reason that I did the recording step first separately, and then in post processing adding the time overlay.
That way the timestamps are precise at µs resolution (begin of receiving frame from camera over CSI-2 bus).

This is frame for timestamp for 8472.861 and shows (correct) rounding at millisecond, should be good enough for your application:
Image


This is animation created from youtube video "Spinning coin camera traversal at 200fps with millisecond gstreamer timeoverlay":
https://www.youtube.com/watch?v=OFzb4U6 ... &index=144
Image
⇨https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/github_repo_i420toh264
https://github.com/Hermann-SW/fork-raspiraw
https://twitter.com/HermannSW

Skeltek
Posts: 2
Joined: Wed Jul 17, 2019 11:03 pm

Re: v2 camera can capture 1000fps videos ...

Fri Jul 19, 2019 2:30 pm

This reminds me of my own hacks during university, when I wrote an arduino program outputting the first 5000 prime numbers within 0.27 seconds, when everyone else still believed 3,7 seconds was a nearly unbeatable record for the computation.
I will have a look at your work in more detail once I have time and maybe get to do similar things myself. I just bought my first Raspberry Cam few days ago and still got to get my knowledge up.
Just felt it being important to compliment you on your awesome work. Its rare to see someone else go so deep into some area of expertise just because its fun.

User avatar
HermannSW
Posts: 1651
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: v2 camera can capture 1000fps videos ...

Fri Sep 13, 2019 10:02 pm

1007fps is maximal Raspberry v2 camera framerate with raspiraw.
That is not the maximal framerate with Raspberry cameras, but for v2 camera.
Only v1 camera has global reset feature and allows for global (external) shutter capturing.

In this posting it is described how a 20000eps frame (exposures per second) was captured:
https://www.raspberrypi.org/forums/view ... 2#p1533932

Just completed to generate a 20000fps video from new 20000eps frame with white marker (7µs flashes at 20KHz frequency).
Will post description, tools, .... tomorrow in the other thread.
The animation here just demonstrates that much more than 1007fps can be captured with Raspberry v1 camera (and post processing).

20000fps video, played at 20fps, 1000× slower than real. White marker at blade tip rotates with 49.7m/s or 179km/h:
Image


P.S:
A tool is used to find a cover of the fast moving part, stamp the different white marker positions out and overlay them onto an "empty" image of the scene (created from 20000eps frame with gimp's "Filters->Enhance->Heal Selection"):
Image
⇨https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/github_repo_i420toh264
https://github.com/Hermann-SW/fork-raspiraw
https://twitter.com/HermannSW

Return to “Camera board”