larapnr
Posts: 10
Joined: Wed Oct 24, 2018 7:02 am

HIGH SPEED 500-900FPS POSSIBLE??

Wed Oct 24, 2018 7:14 am

Hi there,

I'm a beginner at raspberry programming, but due to a project in our department, we need the camera modul v1 to take 500-900 fps, it's fine, if its low quality aswell.
I tried multiple methods, but even if I manage to shoot a video with the information " -fps 500 ", it only playes back a maximum of 120 fps on my windows laptop(after converting to mp4).
We have the raspberry pi B3 modell, a SD Card with 32GB storage, a screen attached to the raspberry pi, the camera, a USB stick and a windows laptop for playback.

I would really look forward for a solution for this problem, even an answer if this project is possible at all would help us very much.

Greetings,

Lara
Last edited by larapnr on Tue Nov 06, 2018 6:56 am, edited 2 times in total.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23709
Joined: Sat Jul 30, 2011 7:41 pm

Re: high speed camera modul v2 500-900fps

Wed Oct 24, 2018 8:22 am

500 is way beyond what our standard software can produce. There is a thread on here where someone has writen some custom parameters and got higher frame rates than standard, not sure he ever got to 900 though.

It's always a tradeoff with resolution - the less pixels you want to get from the sensor, the faster it can be run.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

larapnr
Posts: 10
Joined: Wed Oct 24, 2018 7:02 am

Re: high speed camera modul v2 500-900fps

Wed Oct 24, 2018 1:42 pm

jamesh wrote:
Wed Oct 24, 2018 8:22 am
500 is way beyond what our standard software can produce. There is a thread on here where someone has writen some custom parameters and got higher frame rates than standard, not sure he ever got to 900 though.

It's always a tradeoff with resolution - the less pixels you want to get from the sensor, the faster it can be run.
Thank you very much.
I red that post, but it didn't work very well. What do you think could be the highest possible frame rate that the standard software could produce and how could I achive this fps rate with 'standard' programming methods?
Greetings

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23709
Joined: Sat Jul 30, 2011 7:41 pm

Re: high speed camera modul v2 500-900fps

Wed Oct 24, 2018 1:57 pm

There is a table of standard modes on this page.

https://www.raspberrypi.org/documentati ... /camera.md
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

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

Re: HIGH SPEED 500-900FPS POSSIBLE??

Sat Oct 27, 2018 8:51 am

larapnr wrote:
Wed Oct 24, 2018 7:14 am
I'm a beginner at raspberry programming, but due to a project in our department, we need the camera modul v2 to take 500-900 fps, it's fine, if its low quality aswell.
With standard software (raspivid), the maximal framerate is 90fps with (5$) v1 Raspberry camera and 200fps with (25$) v2 camera (640x480).

With "raspiraw" you can achieve up to 750fps with v1 camera and 1007fps with v2 camera, see table below.
You need very bright light to accomodate the very short shutter times at high framerates.
So with v2 camera you can definitely get 500-900fps.
The deal is "reduce vertical 640xH resolution and increase framerate".
With v2 camera you can record [email protected] and [email protected] as well as [email protected]

This is [email protected] video played at 1fps, it allowed to calculate fast RC airplane propeller speed visually as 20139rpm (5000lm light):

Code: Select all

$ echo "1007/3*60" |bc -ql
20139.99999999999999999960
$ 
Image

viewtopic.php?f=43&t=212518#p1320034
Image


P.S:
For line scanner like applications v2 camera can do 3280x32[email protected] and [email protected] with frame skip rate less than 1%:
viewtopic.php?f=43&t=109137&p=1373915#p1373915
⇨https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://gitlab.freedesktop.org/HermannSW/gst-template
https://github.com/Hermann-SW/fork-raspiraw
https://twitter.com/HermannSW

larapnr
Posts: 10
Joined: Wed Oct 24, 2018 7:02 am

Re: HIGH SPEED 500-900FPS POSSIBLE??

Mon Oct 29, 2018 9:48 am

HermannSW wrote:
Sat Oct 27, 2018 8:51 am
larapnr wrote:
Wed Oct 24, 2018 7:14 am
I'm a beginner at raspberry programming, but due to a project in our department, we need the camera modul v2 to take 500-900 fps, it's fine, if its low quality aswell.
With standard software (raspivid), the maximal framerate is 90fps with (5$) v1 Raspberry camera and 200fps with (25$) v2 camera (640x480).

With "raspiraw" you can achieve up to 750fps with v1 camera and 1007fps with v2 camera, see table below.
You need very bright light to accomodate the very short shutter times at high framerates.
So with v2 camera you can definitely get 500-900fps.
The deal is "reduce vertical 640xH resolution and increase framerate".
With v2 camera you can record [email protected] and [email protected] as well as [email protected]

This is [email protected] video played at 1fps, it allowed to calculate fast RC airplane propeller speed visually as 20139rpm (5000lm light):

Code: Select all

$ echo "1007/3*60" |bc -ql
20139.99999999999999999960
$ 
Image

viewtopic.php?f=43&t=212518#p1320034
Image


P.S:
For line scanner like applications v2 camera can do [email protected] and [email protected] with frame skip rate less than 1%:
viewtopic.php?f=43&t=109137&p=1373915#p1373915
Can you tell me how to use the --raw function or if I need any new updates or installations on my pi?
I tried, but it is not working and whenver I look for raspiraw, the web only tells me that it's used for pictures with raspistill (no raspivid).

Plus, the camera I use is V1

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

Re: HIGH SPEED 500-900FPS POSSIBLE??

Mon Oct 29, 2018 9:47 pm

Please see 1a on compile/prepare/use of raspiraw:
https://stamm-wilbrandt.de/en/Raspberry ... l#raspiraw

With v1 camera you can go up to 750fps, my favorite v1 camera resolution is [email protected] (_s means that only every other line is captured, and duplication of lines in post processing is needed).

It gets really nice with 640x128, but you get 350fps that way "only" with v1 camera (played 14 times slowed down):
Image
⇨https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://gitlab.freedesktop.org/HermannSW/gst-template
https://github.com/Hermann-SW/fork-raspiraw
https://twitter.com/HermannSW

larapnr
Posts: 10
Joined: Wed Oct 24, 2018 7:02 am

Re: HIGH SPEED 500-900FPS POSSIBLE??

Mon Nov 05, 2018 11:47 am

HermannSW wrote:
Mon Oct 29, 2018 9:47 pm
Please see 1a on compile/prepare/use of raspiraw:
https://stamm-wilbrandt.de/en/Raspberry ... l#raspiraw

With v1 camera you can go up to 750fps, my favorite v1 camera resolution is [email protected] (_s means that only every other line is captured, and duplication of lines in post processing is needed).

It gets really nice with 640x128, but you get 350fps that way "only" with v1 camera (played 14 times slowed down):
Image

The prepare/compile/use link and the programming codes don't work with my raspberrry.
What storage do I need to shoot high speed videos? Is it possible that my raspberry or the SD Card has too little storage?

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

Re: HIGH SPEED 500-900FPS POSSIBLE??

Mon Nov 05, 2018 12:08 pm

>The prepare/compile/use link and the programming codes don't work with my raspberrry.
>
should work on any Raspbian Stretch, lite or Desktop.
What do you mean with "don't work", what error messages do you see?

> What storage do I need to shoot high speed videos? Is it possible that my raspberry or the SD Card has too little storage?
>
With SD card you cannot store high framerate videos.
I use /dev/shm RAM memory with the tools.
That allows for restricted length video recording, but a few seconds are possible even at 1007fps.
⇨https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://gitlab.freedesktop.org/HermannSW/gst-template
https://github.com/Hermann-SW/fork-raspiraw
https://twitter.com/HermannSW

larapnr
Posts: 10
Joined: Wed Oct 24, 2018 7:02 am

Re: HIGH SPEED 500-900FPS POSSIBLE??

Mon Nov 05, 2018 12:18 pm

[email protected]:~ $ unzip -x rawcam.zip
Archive: rawcam.zip
05c94c4ea1fc4ffd274dda2837e63e8e9d08a41b
replace userland-rawcam/.gitignore? [y]es, [n]o, [A]ll, [N]one, [r]ename: error: invalid response [cd userla]
replace userland-rawcam/.gitignore? [y]es, [n]o, [A]ll, [N]one, [r]ename: replace userland-rawcam/CMakeLists.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: error: invalid response [{ENTER}]
replace userland-rawcam/CMakeLists.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: error: invalid response [-get inst]
replace userland-rawcam/CMakeLists.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: error: invalid response [all build]
replace userland-rawcam/CMakeLists.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: error: invalid response [-essentia]
t]place userland-rawcam/CMakeLists.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: error: invalid response [l cmake
replace userland-rawcam/CMakeLists.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: error: invalid response [ime ( ./b]
replace userland-rawcam/CMakeLists.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: error: invalid response [uildme 2>]
replace userland-rawcam/CMakeLists.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: error: invalid response [err | tee]
su]lace userland-rawcam/CMakeLists.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: error: invalid response [ out )
replace userland-rawcam/CMakeLists.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: error: invalid response [do ln -s ]
replace userland-rawcam/CMakeLists.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: error: invalid response [/home/pi/]
replace userland-rawcam/CMakeLists.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: error: invalid response [userland-]
replace userland-rawcam/CMakeLists.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: new name: replace ild/bin/raspiraw /usr/bin? [y]es, [n]o, [A]ll, [N]one, [r]enam


That is what shows when I enter the compile code. I already did clone the github file.
After I enter 'A' and paste the prepare section it can't find the commands:
[email protected]:~ $ append dtparam=i2c_vc=on to /boot/config.txt
bash: append
and
[email protected]:~ $ add i2c-dev to /etc/modules-load.d/modules.conf

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

Re: HIGH SPEED 500-900FPS POSSIBLE??

Mon Nov 05, 2018 12:27 pm

Paste the commands one line at a time and respond to any prompts you get back.
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.

larapnr
Posts: 10
Joined: Wed Oct 24, 2018 7:02 am

Re: HIGH SPEED 500-900FPS POSSIBLE??

Mon Nov 05, 2018 12:53 pm

Compiling just worked now, but it couldn't find the append command,

also it couldn't find the"add" command and any commands for "use"

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

Re: HIGH SPEED 500-900FPS POSSIBLE??

Mon Nov 05, 2018 1:07 pm

larapnr wrote:
Mon Nov 05, 2018 12:53 pm
Compiling just worked now, but it couldn't find the append command,

also it couldn't find the"add" command and any commands for "use"
There isn't an append command. Hermann's put stuff in a code block when it shouldn't have been.

Use "sudo nano /boot/config.txt" to open an editor for /boot/config.txt. Scroll down to the bottom and add "dtparam=i2c_vc=on" (without the quotes). Ctrl-X to quit, and "Y" when prompted if you wish to save the file.
Use "sudo nano /etc/modules-load.d/modules.conf" to open an editor for modules.conf. Scroll to the bottom and add "i2c-dev" (again without the quotes). Quit and save again.
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.

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

Re: HIGH SPEED 500-900FPS POSSIBLE??

Mon Nov 05, 2018 1:23 pm

6by9 wrote:
Mon Nov 05, 2018 1:07 pm
There isn't an append command. Hermann's put stuff in a code block when it shouldn't have been.
I hope I did make it better adding " (using an editor)" two times:
viewtopic.php?f=43&t=189661&p=1218763#p1218763
⇨https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://gitlab.freedesktop.org/HermannSW/gst-template
https://github.com/Hermann-SW/fork-raspiraw
https://twitter.com/HermannSW

larapnr
Posts: 10
Joined: Wed Oct 24, 2018 7:02 am

Re: HIGH SPEED 500-900FPS POSSIBLE??

Mon Nov 05, 2018 1:29 pm

Thank you so much, I almost got it.

when I enter
sudo ./camera_i2c, I get the message

setting GPIO for board revsion: a020d3
Failed: don't know how to set GPIO for this board!

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

Re: HIGH SPEED 500-900FPS POSSIBLE??

Mon Nov 05, 2018 2:04 pm

larapnr wrote:
Mon Nov 05, 2018 1:29 pm
Thank you so much, I almost got it.

when I enter
sudo ./camera_i2c, I get the message

setting GPIO for board revsion: a020d3
Failed: don't know how to set GPIO for this board!
Those instructions are from over a year ago and point at an old repo (https://github.com/6by9/userland/). It's now at https://github.com/6by9/raspiraw.
Start again with

Code: Select all

wget https://github.com/6by9/raspiraw/archive/master.zip
unzip -x master.zip
cd raspiraw-master
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.

larapnr
Posts: 10
Joined: Wed Oct 24, 2018 7:02 am

Re: HIGH SPEED 500-900FPS POSSIBLE??

Tue Nov 06, 2018 6:34 am

so what is the code for taking high framerate videos now and saving them with dev/smh?
what programms do I have to install for playing them back?

when I enter rm /dev/shm/out.*.raw, it tells me that the file couldn't been found

how do I process a video with dcraw and why is that important?

And: do I use "raspiraw master" or "userland rawcam"

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

Re: HIGH SPEED 500-900FPS POSSIBLE??

Tue Nov 06, 2018 10:29 am

larapnr wrote:
Tue Nov 06, 2018 6:34 am
so what is the code for taking high framerate videos now and saving them with dev/smh?
what programms do I have to install for playing them back?

when I enter rm /dev/shm/out.*.raw, it tells me that the file couldn't been found
/dev/shm is a RAM disk and therefore everything in it is deleted on reboot. rm is telling you it found nothing, and that is to be expected when freshly booted.
larapnr wrote:how do I process a video with dcraw and why is that important?
The sensor produces a 10bit/pixel image via a Bayer colour filter. You want an 8bit/component RGB or YUV image to display on a screen. There are numerous steps involved in getting from Bayer to RGB, and that is what dcraw does.
larapnr wrote:And: do I use "raspiraw master" or "userland rawcam"
Hermann's instructions are meant to be taken as a basic set of instructions, and have become slightly out of date (it always happens).
Can I suggest you invest a little bit of time in finding out what github is and how it works. If you'd looked then you would have found the big text at https://github.com/6by9/userland/tree/rawcam and https://github.com/6by9/userland/tree/r ... s/raspicam
THIS RAWCAM BRANCH IS BEING DEPRECATED.
raspiraw has moved to https://github.com/6by9/raspiraw
If you are asking these sorts of questions then this probably isn't the tool for you. If you haven't got a basic grasp of how the camera modules work, their register config, or even storing files in the Linux filing system, then you will be struggling. It's not the sort of thing that is easy to hand-hold through a forum either.
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.

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

Re: HIGH SPEED 500-900FPS POSSIBLE??

Sun Aug 11, 2019 2:38 pm

There is a new blog post with associated youtube videos from Robert Elder that explain every step needed from freshly flashed SD card to a working high framerate video capturing system, see this posting for more details:
https://www.raspberrypi.org/forums/view ... 0#p1514950

660fps film clips from Robert's two youtube videos, nice!
Image Image
⇨https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://gitlab.freedesktop.org/HermannSW/gst-template
https://github.com/Hermann-SW/fork-raspiraw
https://twitter.com/HermannSW

Return to “Camera board”