Easy Animation Script Using FSWebcam and Mencoder

My son loves making animations and recently did an after school club which he loved being involved in. I wanted to make it easy for him to come home and do the same thing in the living room using his own toys and things from around the house.

We had used my Panasonic Lumix camera in the past and then edited in Photoshop to create animations which was time consuming and not very easy for a seven year old. I found that he lost interest very quickly.

So… I have written a short script in bash that automates the whole process. The following is needed for the project:

  • Raspberry Pi or any Linux PC
  • A webcam (Hopefully compatible with the Pi)
  • Fswebcam software (Free)
  • Mecoder software (Free)
  • Difficulty level: Easy

    The code asks the user for their name and creates a folder using the name and the current date. You must also specify a resolution that your camera is able to capture. You then press [f] on your keyboard to take the photos in sequence. Once completed you can then press [x] to create your movie using mencoder. You can specify your own frame rate and the resulting file can then be watched using mplayer (bundled with mencoder).

    You need to install mencoder and fswebcam:

    sudo apt-get install mencoder
    sudo apt-get install fswebcam

    The script file can be downloaded here: animate.zip.

    Just unzip to your home directory and run by typing:


    Here is an example. My sons first football animation using the software:

    Any questions please post below. 😀

    This entry was posted in Animation, bash, Child Friendly, Projects, raspberry pi, Scripting, Timelapse, Tutorial, Webcam. Bookmark the permalink.

    Leave a Reply

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