Make a Stop Motion Video Rig with a Raspberry Pi

Christian Cawley 03-11-2015

Wallace and Gromit, two of the world’s best-loved animated characters, started out life as primitive lumps of colored putty. But like other non-digital animation, they’re brought to life by painstakingly photographing a scene 24 times for every second of footage.


You don’t need high end equipment to make your own movie though: in this age of high resolution digital cameras or smartphones, anyone can have a go. Here at we’ve looked at various examples of stop-motion camera apps Create Stop Motion Animations With These 5 Fun Apps [iPhone & Android] In terms of awesome creative things you can do with a lot of free time, stop motion animations rank right up there with the best. For kids and adults alike, being able to take inanimate... Read More over the years for smartphones, and these are a great solution.

But what if you wanted something a little more permanent? If you own a Raspberry Pi with the PiCam camera module, you’re already well on the way to building your own stop-motion animation studio!

Get Your Bits Together

For this project, you’ll need a Raspberry Pi computer and the PiCam module, which is compatible with all versions of the Pi. If you don’t have one already, these are inexpensive digital camera modules with 1080p video capability available for just under $30 on Amazon.

That is just the basics, however. If you’re planning to build the full top down setup for table top animation (including cel animation, as used by cartoonists) then you’ll also need to put together a rostrum – essentially a stand or rig for holding our stop motion PiCam.

You may prefer to avoid this if you’re doing side-on, Wallace & Gromit style animation, for which you’ll just need a suitable grip for the Raspberry Pi and PiCam, and a tripod. Alternatively, a dashboard mount for a smartphone may prove invaluable.



What might also prove useful is a Raspberry Pi case that allows you to mount the camera, like the one pictured above. These can be picked up quite cheaply on Amazon.

Finally, you might appreciate the addition of a button to take the photos, rather than typing a command into your Pi over SSH VNC, SSH and HDMI: Three Options for Viewing Your Raspberry Pi The Raspberry Pi is a remarkable little computer, but it can be time consuming to set it up and connect it to your monitor. Read More . For this you’ll need a solder-free breadboard, two male-to-female wires, and a dual-state push button.

While you mull over that, here’s a video on how to build plasticine rabbits.


Setup the PiCam Module

If you haven’t yet setup the PiCam, then you’ll need to begin by connecting it to your Raspberry Pi.

You’ll find the destination socket a short distance from the Ethernet port, although its exact location depends on which Raspberry Pi module you’re using. Begin by raising the plastic clip on the socket, then slot the PiCam’s flex cable into position, the side with the metal connectors facing away from the Ethernet cable.

With a PiCam module attached you can engage in all manner of projects from using your Pi as a security camera, to turning into a video camera. We recently looked at a number of great Raspberry Pi camera projects 5 Things You Can Do with the Raspberry Pi Camera Module One of the first expansions you should buy for the Raspberry Pi is the camera module. With a dedicated connector, the camera can be used for a variety of tasks. Let's take a look. Read More which you might like to take a look at before proceeding.

Configuring the Raspberry Pi as a Camera

With the PiCam connected, it’s time to plugin and boot your Raspberry Pi as normal. You’ll be fine using the Raspbian operating system 5 Ways New Raspbian Jessie Makes Raspberry Pi Even Easier to Use Following the release of Debian Jessie in July, the Raspberry Pi community has been blessed with a new release of the Raspbian variant, based on the "parent" distro. Read More , which can be installed manually to your SD card How to Install an Operating System on a Raspberry Pi Here's how to install an OS on your Raspberry Pi and how to clone your perfect setup for quick disaster recovery. Read More or if you prefer a little hand holding, using the NOOBs tool How NOOBS For Raspberry Pi Can Help First Time Users There is something about the Raspberry Pi that might just put people off: until now, setting it up has not been particularly user friendly. NOOBS aims to change that! Read More .


Once booted up and correctly configured (typically with sudo raspi-config), it’s time to start testing the camera. Boot into the GUI (enter startx if you have booted to a screen of text) and in the command line, enter:

raspistill -o image1.jpg

A photo of whatever is in front of the camera will be snapped, which you will find by opening the File Manager and viewing the Home directory. Double click to open the image for further investigation – you’ll notice it is upside down.

(If you want to take more images now, just change the filename in the command, from image1.jpg to image2.jpg, etc.)

So, the PiCam is working.


Introducing Stop Motion

Next, it’s time to enter some Python code to begin capturing your animation subject.

Start a new Python project and enter the following:

import picamera
from RPi import GPIO

button = 17

GPIO.setup(button, GPIO.IN, GPIO.PUD_UP)

with picamera.PiCamera() as camera:
	frame = 1
	while True:
		GPIO.wait_for_edge(button, GPIO.FALLING)
		camera.capture('/home/pi/animation/frame%03d.jpg' % frame)
		frame += 1

Save this as something recognizable, such as

Construct and Connect Your Button

We can now capture images, which are automatically saved into a folder on your Pi’s storage. To automate the process further, we can connect a button to the Pi’s GPIO array to snap each image in the animation sequence.

Connect a button to your non-solder breadboard as illustrated, connecting the two wires to pins 6 and 11 on the GPIO header (or GND and GPIO17).


Once connected, you’ll be able to press the button to take each shot on your stop motion camera. Rather than run in Python, however, you’ll need to open a new Terminal window and enter:

sudo python3

With this running, your stop-motion project will capture the desired image with each button press. However, when you’re all done, you’ll need to press CTRL+C to terminate the script.

Building Your Rostrum Rig

Various options are available for building a rostrum. You might, for instance, opt for a wooden DIY setup like this:

Alternatively, you could use LEGO, or perhaps Meccano:


Thanks to things like mobile phone holders and tripods, however, we don’t really need to worry too much about building a traditional rostrum, as technology has moved on considerably since the days those devices were used.

Stitching it All Together

At the moment, your stop-motion project will simply be a collection of images saved to the same directory (as specified in the script).

To turn these snaps into a film, you’ll need to use ffmpeg, which you can install with

sudo apt-get install ffmpeg

Open a Terminal window and enter the following script, taking care to appropriately alter the file path if you used something different.

ffmpeg -y -f image2 -i /home/pi/Desktop/stop-motion/frame%03d.jpg -r 24 -vcodec libx264 -profile high -preset slow /home/pi/Desktop/stop-motion/animation.mp4

When you’re ready, use the OMX Player to watch the animation:

omxplayer animation.mp4

Too Much Code? Try This

If you prefer a less manual approach that relies on mouse input, then the stopmotion package for the Raspberry Pi is ideal. This requires that you first install the raspicam-extras package, so use the following:

sudo apt-get install uv4l uv4l-raspicam uv4l-raspicam-extras
sudo apt-get install stopmotion


Stopmotion is a desktop application. All you need to do is ensure the camera is detected, line up your shot, and click the capture button. We had some problems with the export function (File > Export) but this should allow you to output the stitched-together images as an AVI file.

Two Ways to Make Stop-Motion Movies with Your Raspberry Pi

It is always good to have an alternative to fall back on. While we like the rawness of the manual switch stop-motion solution, it has to be said that the stop-motion app is very easy to use. In terms of results, there is very little to choose between the two, however, so we’ll leave it up to you to decide which one you’ll use.

Feel free to share the results of your stop-motion PiCam labors in the comments below!

Related topics: Computer Animation, Raspberry Pi, Record Video, Webcam.

Affiliate Disclosure: By buying the products we recommend, you help keep the site alive. Read more.

Whatsapp Pinterest

Leave a Reply

Your email address will not be published. Required fields are marked *

  1. Mark
    July 12, 2016 at 8:59 am

    Stop motion downloads ok but :-

    All fail to download.

  2. Mark
    July 10, 2016 at 6:39 pm

    Just tried to download the packages given above and none seem to exist !!

    • Christian Cawley
      July 10, 2016 at 8:10 pm


      Which ones did you try? It's possible they've been moved/updated since Raspbian Jessie was released. Sure we'll be able to track them down :)

  3. Anonymous
    November 7, 2015 at 12:39 pm

    Did this for my boys.
    Used two buttons, one for taking the picture and the other for making the animation.
    I have the Pi set up as a we server and view the video on the Pis WWW using an IPad.
    Works, but means I have to have network on the Pi...wireless doesn't always work.
    My hope is to add a screen (maybe touch), and more buttons, so that I could view the video and maybe scroll through the pictures and remove bad ones.

    For now it's just a fun toy.

  4. Anonymous
    November 7, 2015 at 2:49 am

    The main thing missing from this tutorial is a way to view and step back through recorded material. Without being able to step back and compare with the live view, there is zero chance you'll be able to remember the exact speed of motion and get even steps of motion. Otherwise you're really not doing anything that a Webcam and FRAPS can't do.

  5. Anonymous
    November 7, 2015 at 2:27 am

    Whoa. If you are doing clay animation solo,on the cheap, you have forgotten [or disregarded] one of the great features made possible with computers:

    KEYFRAME Animation.

    Animators used to draw the key frames, then use subordinates to draw the "in-between" frames. The same technique was used digitally in movies like "Terminator 2" to "morph" one character to another.

    In clay animation, key frames cut your need for creating and posing, at the expense of more time post-processing.