TeCoEd (Teaching Computing Education)
  • Home
    • Freelance
    • Book
    • Downloading
  • Python
    • Learn Python >
      • Python Modules
    • PyGame Zero
    • Python Programs >
      • Higher or Lower
      • Magic Calculator
      • Password Checker
      • Python Pit
    • What's News App
    • Pixels to Cells
    • Python Mosaics
    • Python OCR
    • L-1-AM
    • Web Scraping >
      • Scraping Trains
    • Weather App
    • Snakes and Windows
    • Python Web Server >
      • Flask
    • Python Picks
  • Ras Pi
    • All About the Pi
    • Getting Started
    • Remote Desktop and VNC
    • Static IP Address
    • Sonic Pi >
      • 3.14
    • Twitter Feed >
      • Tweepy
    • Android & Pi >
      • Advanced Apps
      • Odds
    • A.I on the the Pi
    • CRON
    • Pick Your Own
  • Pi Hardware
    • Pi HATS >
      • Sense Hat Hacks
      • AstroPi HAT
      • Unicorn-HAT >
        • Unicorn Alphabet Disco
        • Uni Codes / Programs
      • Skywriter
      • Piano HAT
    • STS Pi
    • Pi Camera >
      • Pi-Cam, Python & Email >
        • Time Lapse
      • Pi Noir
    • Pipsta >
      • Flask, Input & Printers
    • Raspberry Pi Power >
      • Energenie IR power
    • Pibrella
    • Distance Sensor
    • LCD Screen
    • Pi-Tooth
    • Robot Arm
    • PiGlow
    • PiFM
    • Accelerometer
    • PiFace >
      • Installing PiFace >
        • Python Commands
  • Pi-Hacks
    • Drone Hacks
    • Pi Glue Gun Hack
    • Blinkt!
    • Sonic Pixels
    • R2D2
    • Get to the chopper
    • Astro Bird
    • Twitter Translator
    • Hacking a Robot
    • Nature_Box >
      • Best Nature Photos
    • Wearable Tech >
      • Project New York
      • P.N.Y Part 2 Health
      • P.N.Y Part 3 Games
      • P.N.Y Part 4 Translation
    • Dino-Tweet
    • Other Links
  • Pi-Hacks 2
    • The Joker
    • Hologram Machine
    • Google Vision: Camera Tell
    • Yoda Tweets
    • Pi Phone
    • Darth Beats
    • Twitter Keyword Finder
    • Crimbo Lights Hack
    • Xmas Elf
    • Halloween 2016
    • Halloween Hack 2015
    • Socrative Zombie
    • Voice Translation
    • The Blue-Who Finder
    • GPIO, Twitter
    • Pi Chat Bot >
      • Dictionary Definitions
    • PiGlow & Email
    • Pibrella Alarm System
    • SMS with Python >
      • Spooking a Mobile
  • Pi-Hacks 3
    • LED Dance Suit
    • Ferminal
    • Crypto Tracker
    • David Bowie
    • Lamp Prank >
      • TEST
    • Yoda FM
    • Retro Player
    • LED Pixel Art
    • TARDIS
    • Battleships
    • LED Board
    • Night Vision
    • Enviro+ Weather
  • Minecraft
    • Minecraft API
    • Minecraft Sweeper
    • PiGlove: Minecraft Power Up
    • Minecraft Photo-booth
    • Rendering Pixels
    • Speed Cube
    • Lucky Dip
  • Computing
    • Why Computing?
    • Can You Compute
    • micro:bit
    • Coding Resources
    • Learn to Code >
      • Coding with iPads
      • Apps Creation Tools
      • sKratchInn
      • Sound Editing
    • Cheat Sheets
    • Theory
    • HOUR OF CODING
    • BEBRAS Computing Challange
    • Computer Facts
    • Free Software and Links
  • Contact Me
  • Random Hacks
    • Movile

What is it?


The Raspberry Pi Camera Module can be programmed to take a series of photographs over a period of time.  This creates a time lapse video of events that usually take a lot longer to complete and as humans, we would not normal see.  If your Camera is not set up or installed, click here first, here
Camera Commands
File Size: 245 kb
File Type: pdf
Download File


Installing the Stitching Software


Before making or stitching together the individual photographs together software will need installing.  This software will stitch the photos together and is very easy to use.  A simple program called Mencoder, prepares, converts and exports the photographs into a video.

To install the Mencoder software type:
sudo apt-get install mencoder

Part 1: The -tl Command


The time lapse camera feature code is broken down into several sections:

raspistill -o n00b_%5.jpeg -tl 100 -t 18000

raspistill -o n00b_%5.jpeg in this example the name of the files created will each called n00b, as it is my first attempt at time lapse photography!

_%5.jpeg this command adds 5 decimal places to the file name, so creates files from n00b.00001 to n00b.99999, 

-tl 100 is the time in milliseconds to take a picture, ie every 100 milliseconds, every second

-t 18000 is the total time that the camera will take pictures for, 18000 milliseconds, 3 minutes 

Part 2: Calculating the shooting times


The tricky part is calculating the times and the number of photos that you want taken.  In the example, I wanted to shoot for 3 minutes and take a photo every second.  Because the times are in milliseconds the overall time needs calculating, 3(min) x 60 x 100 = 18000

18000 / 100 = 180, ie 180 photos will be taken in total.  Therefore -tl = 100 and -t 18000, (the camera takes a picture every second for 3 minutes)

Combining these elements together gives the code,

raspistill -o n00b_%5.jpeg -tl 100 -t 18000

First Attempt


In this first attempt I shot a syrup bottle being turned upside down and the syrup falling to the top of the bottle.  The whole process took 2 minutes and 31 seconds.  The video below shows the process in just under 8 seconds.

Part 3: Create a Folder and Collate


Once up and running, the shots will soon fill up a folder.  It is good practice to make a new folder to store the photographs in.  

In the LX terminal type:  
mkdir pics

This makes a new directory in the /home/pi folder called pics (replace with your folder name), then all the photos can be moved / copied into this new folder.

Next, while in the LX terminal navigate to the new folder and create a list of all the files which will then be passed to the Menconder.

Move to the new folder:
cd /home/pi/name_of_your_new_folder

Then create the list with the code:
ls * .jpeg >timelapse.txt

Part 4: Stitching it all Together


The last part of the project is stitching together all the photos.  While you are still in the /home/pi/pics folder type the following code: (it is a handful!) All this goes in the LX terminal on the same line, as shown below, watch for all the colons, :  the file is called myfirstvid but can be changed to a more suitable file name.
mencoder -nosound -ovc lavc  -lavcopts vcodec=mpeg4:aspect=16/9:vbitrate=8000000 -vf scale=1920:1080 
-o myfirstvid.avi -mf type=jpeg:fps=24 mf://@timelapse.txt
Powered by Create your own unique website with customizable templates.