Stop Motion Animation Studio
Create your own stop motion animated videos using Raspberry Pi, PiCam, and Python for frame capture.
- Raspberry Pi
- Intermediate
- 60 minutes setup + filming time
- 6 steps
Shop this project
CartPrices from vilros.com. Tax and shipping at checkout.
Before you start, you'll need
- Raspberry Pi 4 (4GB recommended)
- Raspberry Pi Camera Module (PiCam)
- Push button
- Breadboard
- 2 male-to-female jumper wires
- Clay and figurines
- Camera stand or tripod
Set up the PiCam
About 10 minutes
Connect and test the camera module.
- Power off the Raspberry Pi.
- Connect the PiCam ribbon cable to the camera port (lift the tab, insert cable with contacts facing away from the port, press tab down).
- Boot up the Pi.
- Enable the camera: sudo raspi-config → Interface Options → Camera → Enable.
- Reboot: sudo reboot
- Test the camera: raspistill -o test.jpg
- Check the image in File Manager under /home/pi.
You should see
The camera captures a test image successfully.
Build your animation set
About 15 minutes
Create a filming environment.
- Mount the PiCam on a stand or tripod pointing down at your animation surface.
- Set up lighting (consistent lighting is crucial for stop motion).
- Create a simple backdrop and stage area.
- Prepare your clay figures or objects to animate.
- Make sure the camera view covers your entire animation area.
You should see
Your animation studio is ready with stable camera position and good lighting.
Write the capture script
About 15 minutes
Create Python code for frame-by-frame capture.
- Create a directory for frames: mkdir ~/animation
- Create the Python script: nano ~/animation/animate.py
- Copy the stop motion capture code below.
- Save and exit (Ctrl+X, Y, Enter).
import picamera
from RPi import GPIO
import time
button = 17
GPIO.setmode(GPIO.BCM)
GPIO.setup(button, GPIO.IN, GPIO.PUD_UP)
with picamera.PiCamera() as camera:
camera.resolution = (1920, 1080)
camera.framerate = 24
camera.start_preview()
frame = 1
print("Stop motion studio ready!")
print("Press the button to capture each frame.")
print("Press Ctrl+C to stop.")
try:
while True:
GPIO.wait_for_edge(button, GPIO.FALLING)
filename = '/home/pi/animation/frame%03d.jpg' % frame
camera.capture(filename)
print(f"Captured frame {frame}")
frame += 1
time.sleep(0.3)
except KeyboardInterrupt:
print(f"\nAnimation complete! {frame - 1} frames captured.")
camera.stop_preview()
GPIO.cleanup()Each button press captures one frame. Move your clay figures slightly between presses.
You should see
The script is saved and ready to run.
Capture your animation
About 30 minutes
Take photos for your stop motion video.
- Run the script: sudo python3 ~/animation/animate.py
- Position your clay figures for the first frame.
- Press the button to capture.
- Make small movements to your figures.
- Press the button again.
- Repeat for each frame (24 frames = 1 second of video).
- Press Ctrl+C when done.
You should see
All frames are captured in ~/animation/.
Create the final video
About 10 minutes
Stitch frames into a video file.
- Install ffmpeg: sudo apt-get install ffmpeg
- Compile the video: ffmpeg -y -f image2 -i /home/pi/animation/frame%03d.jpg -r 24 -vcodec libx264 -profile high -preset slow /home/pi/animation/animation.mp4
- Wait for processing to complete.
- Play your video: omxplayer ~/animation/animation.mp4
You should see
Your stop motion animation plays as a video!
It didn't work
Video looks choppy.
You may need more frames per second of action. Remember 24 frames = 1 second. Smaller movements between frames create smoother motion.
What to do next
Stuck? Contact Vilros Support with your board model and what you see on screen.