News

Slow-motion Raspberry Pi video

Use the Raspberry Pi camera to record slow-motion videos with the camera module

We made our own Angry Birds. You could do something actually productive!

The Raspberry Pi camera has been an interesting little add-on for the Raspberry Pi, allowing people to have slightly more control when it comes to projects that require pictures and video. The functionality of the camera is always being slightly enhanced and now a new function has made its way to the camera: slow-motion video. With this you can create short clips as slow as 33 per cent normal speed, with all the same control as you have with the normal camera functions.

The picamera Python module also supports this new framerate, so once you’ve figured out how to use it via this tutorial you can branch out to there.

We made our own Angry Birds. You could do something actually productive!
We made our own Angry Birds. You could do something actually productive!

What you’ll need

Latest Raspbian Image

Raspberry Pi camera board
Internet connection

Step-by-step

Step 01

The firmware updater

The first thing you need to do is make sure you update the firmware on your Raspberry Pi. Boot into Raspbian and open the LXTerminal. To install the firmware updater, simply type in the following command. For newer versions of Raspbian, it will likely be already installed.

$ sudo apt-get install rpi-update

Step 02 Update the firmware

Updating the firmware is very straightforward; back in the terminal just type in the following:

$ sudo rpi-update

And it should automatically download and install all the necessary files. Once this is complete, reboot your Raspberry Pi to activate the new firmware

Strong 03 Alternate updating

Problems have been known to occur with the firmware update and there are two main ways you can try and fix them. First of all, try updating Raspbian with apt-get update followed by apt-get upgrade. If that method doesn’t work, try using the firmware updater like so:

$ sudo UPDATE_SELF=0 rpi-update

Step 04 Camera setup

Just in case you’re using a new install of Raspbian, you’ll need to make sure that the camera module is enabled. Make sure that you’ve plugged in the camera while it’s off, and then in the LXTerminal use:

$ sudo raspi-config

Go to the Enable Camera option and enable it. You may need to restart in order for it to actually take effect.

Step 05 First tests

We can now do a quick test of the slow-motion capabilities by entering the following:

$ raspivid -w 640 -h 480 -fps 90 -t 5000 -o slowvideo.h264

We’ve told it to make a video at 640 x 480 resolution, to film it at 90 frames per second and to do so for five seconds. This is the maximum resolution for this speed of video.

Step 06 Other recording modes

As well as being able to record video at 90 frames per second, you can also go down to 60. You cannot increase the resolution though, so it’s stuck to 640 x 480 for both 90 fps and 60 fps video for the time being.

Step 07 Playing it back

Although your Pi has the means to record the video, it can’t play it back. You can either grab the video from the SD card, or install VLC using the following command, which should have no trouble viewing the video file.

$ sudo apt-get install vlc

Step 08 Other uses

If you do plan to use the slow-motion function, obviously you can use it as intended. However, you can also use it to create high frame rate videos. Video editors such as Kdenlive will let you increase the playback speed, and you can also view them in VLC at normal speed.

Step 09 Final warnings

Doing these slow-motion videos – even at the low resolution we’re using – is taxing on the processor. Try to only capture short clips while using it and definitely not a lot of them in rapid succession.

×