Create a time lapse video of germinating seedlings

Activity

A time lapse video can give you an insight into how plants grow by recording what happens over hours or days and displaying it in a matter of seconds or minutes.

  • Estimated time: 60 minutes
  • Location: Indoors
  • School term: All year round
  • Level of experience: No experience needed
  • Subject(s): Science

Learning objectives

  • Learn how to create a timelapse video using a Raspberry Pi computer.

Preparation

  • Make sure you know where you will want your pot or seed tray to be while the seeds are germinating. You will need to consider the power supplies for your Raspberry Pi computer and the monitor that you will be using.

Equipment

  • Your set up Raspberry Pi and Camera kit, which has been prepared to take photos
  • Seeds (fast germinating varieties work best)
  • A pot or seed tray
  • Compost

 


Step by step

Note: Any text that is shown in this resource like this should be typed onto the screen exactly as it appears.

  1. Fill your pot or seed tray with compost and sow your chosen seeds. Position your pot or seed tray in its final position.
  2. Set up your Raspberry Pi, monitor and camera next to it. Using the tripod, position the camera towards the soil surface.
  3. Turn on the Raspberry Pi and monitor and when you get to the log in screen, enter your username and password (the defaults are pi and raspberry respectively).
  4. Enter the following command to test that the camera is working and pointing in the correct direction:
    raspistill -o test.jpg -t 5000
  5. To test that the time lapse function is working, it is a good idea to try a smaller length of time, for example:
    raspistill -o test_%04d.jpg -tl 10000 -t 600000. This will automatically capture an image every 10 seconds for 10 minutes. Time must be specified in milliseconds, so 10 seconds is 10000 and ten minutes is 600000. Here are some useful times calculated in milliseconds for you already:

    Time Milliseconds
    5 seconds 5000
    10 seconds 10000
    30 seconds 30000
    1 minute 60000
    5 minutes 300000
    10 minutes 600000
    30 minutes 1800000
    1 hour 3600000
    5 hours 18000000
    24 hours 86400000
    48 hours 172800000
  6. The %04d will add a four digit sequential number at the end of each filename e.g. test_0001.jpg, test_0002.jpg
  7. While the time lapse is recording, the camera preview window will show up on the screen with periodic flashes of the still images as they are taken.
  8. Once the images have all been taken, you can create the time lapse video by entering the command:
    avconv -r 10 -i test_%04d.jpg -r 10 -vcodec libx264 -crf 20 -g 15 test_timelapse.mp4
  9. You can speed this up by scaling down each image as they're stitched into the final film. The command to do this is:
    avconv -r 10 -i test_%04d.jpg -r 10 -vcodec libx264 -crf 20 -g 15 -vf scale=1296:972 test_timelapse.mp4
  10. You will then need to move the file from the Pi to your PC by using WinSCP.

Hints & tips

  • If you cannot use WinSCP, you will be able to use the Raspberry Pi internet browser to connect to your emails and send the time lapse video as an attachment. To find the internet browser, type startx and press "Enter" on the command line.