Shooting Slow Motion Videos using Raspberry Pi Camera

There was a time when I said “Even with the best of camera hardware, we are still slave to its features. Thanks to the raspberry pi camera, we will make a camera do whatever our heart desires.” This quote has been proven more true by the Team at Broadcom who released new camera modes for Raspberry Pi camera. One of the new modes is the ability to shoot videos at 90 fps albeit at a lower resolution. Just look around you, even with the best of hardware on Flagship smartphones and most of the high end DSLRs, there is no option to capture 90fps. Even Peter Jackson was able to shoot The Hobbit at just 60 fps HFR (although that was Full HD or maybe even higher). The point here is that now we have the capability to shoot videos in High frame rates but it is of no use as our eyes cannot perceive the differences with the higher frame rates. The way we can utilise the higher frame rates is for slowing it down for cool slow motion effects. The reason I thought of writing this article is because I thought achieving slow motion using Raspberry Pi would be difficult as it would involve capturing the video at 90 fps in H264 format, converting it to MP4 at the same fps and then slowing it down to run at 30fps. After trying it myself, I found out that it can be done pretty easily.

Installing New Camera Modes

In order to capture images and videos with the new modes, it is important to do an upgrade of the Pi. The same can be done as mentioned below

sudo rpi-update

Shooting Videos in 90fps 

Now in order to shoot VGA videos at 90fps for 10 seconds, hit the below command

raspivid -w 640 -h 480 -fps 90 -t 10000 -o sample90fps.h264

Converting video to Slow Motion

You will not be able to do much with the RAW h264 video, so now we will have to convert it to MP4. In order to do this, you will require a wrapping software called MP4Box. You can install this software as mentioned below
Note: If you have been playing with video recording on raspberry Pi, you might already have MP4Box.

sudo apt-get update
sudo apt-get install -y gpac

Once installed you can then use the following command to wrap your H264 video data in an MP4 container file.

MP4Box -fps 30 -add sample90fps.h264 sample.mp4

What the command does is takes the sample90fps.h264 file and converts it to a playable sample.mp4 with a frame rate of 30 fps. Since the original video was shot at 90fps and the resultant video is at 30 fps, what you get is a longer version of the original video but in Slow Motion. I could have posted a test video from my camera but it could not have been as interesting as Tobias Huebner’s juggling video.

Fun with New Modes

You can find the other shooting modes on the link mentioned below. Hope you can make something interesting out of it.

1 thought on “Shooting Slow Motion Videos using Raspberry Pi Camera

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.