Jun 022013
 

I just got back from a week in France. While I was away I had a Raspberry Pi camera shoot a photo of the garden every ten minutes. I set it on for ten days, the day before we left. It still has a day or so to run, but I FTPed the first 1300 .jpg files from my Pi while it’s still running and made them into a video using Videopad. (You can also do this natively on the Pi with FFMPEG, but I haven’t played with that yet.)

The subject matter isn’t the most exciting ever, but it does give you an idea of what the weather was like over the nine day period. Fortunately for us, it was a bit nicer in France while we were away. :) There’s no sound for the time-lapse part. It started on Friday 24th, so the first period of darkness is Friday night.

I used the paid version of Videopad, but I think you can also do this with the free version. The trick is to change the settings in Options > Default still image duration to 0.04s, which gives you 25 frames per second. Then you just import all your images and make the movie.

But first we have to shoot the stills for the movie.

How to shoot a ten-day time-lapse video

First, I started a “screen” session (which enables me to disconnect and leave it running, but also to log back in and check on it).

Then, I used this command to shoot the photos for a 1080p time-lapse video of 1440 frames over 10 days
raspistill -t 864000000 -vf -w 1920 -h 1080 -tl 600000 -o 6_%05d_ten-days.jpg

-t 864000000 is the number of milliseconds in 10 days. This is how long the program runs for.
-vf is vertical flip (otherwise, the image comes out reversed for me)
-w 1920 -h 1080 width and height for 1080p video output. I figured shooting it the size I want the output would be optimum.
-tl 600000 number of milliseconds between shots (10 minutes)
-o 6_%05d_ten-days.jpg Name of output file.

The %05d part gives you a 5 figure integer padded with leading zeros. So, the first one will be 00001, the thousandth would be 01000. This is ideal because, when assembling the video, the files can be bulk imported in numerical order which will be the order we want them in.

A ten minute time period was chosen because it would ensure that there would still be enough space on the SD card for all the images. Each image is ~2 Mb. It also means that the overall video would be about a minute long (at 25 fps).

I didn’t want it any longer than that because there are periods of darkness and we don’t want people getting bored. Next time-lapse video I want to make will be in a location with some movement and a more frequent shooting time-period.

  17 Responses to “Nine days’ weather in one minute. Time-lapse video with Raspberry Pi Camera”

  1. Very cool! Now I have just got to find something interesting for me to time lapse!

    The Raspberry Pi Guy

  2. Nice one Alex. It’s cool watching the shadows spin round :)

  3. Hi Alex – this is a very nice demonstration. I am currently running a time lapse test based on your work, so hopefully this will be the start of a few series. Can I ask how you get the images from the Pi to your PC. You say you FTP’d them, but how exactly?

    I have had to get the odd file from the Pi to my PC, and I have been emailing them!

    Congratulations on the whole RasPi.TV thing – it’s great.

    One more thing – when my time lapse pictures are taken, the latest one stays in the foreground and I can’t get rid of it so that I can keep an eye on the file manager index. Any suggestions?

  4. Hi, and thanks for all the great information, I am new to linux and also new to Raspberry pi but I have been playing with raspbmc with good results, and now I want to do some more stuff, I bought me the wi-pi and have already connected wi-pi to my router, I also bought the pi-camera and tested it and it works fine, Before I start to try to follow your instructions on how to make a time lapse I began to wonder if it would be possible to use 64Gb USB storage to store the time lapse images into?. Thanks for everything.

    • You should be able to do that with a USB stick or even a hard drive as long as it’s powered externally.

      • Ok does it have to be powered externally? or do you mean if I put external hard drive? I am planning to make a time lapse in the mountains so I need to make a solar sell power to power the raspberry-pi, I plan to put the raspberry-pi into a box with infrared cam and put it in a puffin hole and collect a time lapse over the summer, hopefully I will be able to witness young puffin start his life from his first feeding until he flies away on his own. I was hoping it would be ok to use one of the USB input on the raspberry-pi and put 64Gb storage straight into the raspberry-pi.
        What would the command line be if I would want to forward all snapshots from the camera to the 64Gb USB storage connected into the Raspberry-pi. Thank you for your response.

        • If it’s a memory stick it wont need external power. Only a HDD.

          For your command, instead of -o 6_%05d_ten-days.jpg
          you would need to put the full path to the memory stick as well

          -o /path/to/memory/stick/6_%05d_ten-days.jpg

          Plug in your memory stick and wait a few seconds. Then type df -h
          That should show you where it’s mounted.

          • Thanks so much Alex , Hopefully I can show you time lapse from my puffin watch work next autumn.
            I also want to be able to stream live video from my home, from another raspi, I think I need some help with that also if I may,
            Is it ok if I ask you some more question if I need some more help please?
            Thanks for everything, I am really grateful for your help and would never make this possible without your help.

  5. Thanks Alex

    • Hi again, I am able to stream live video to my VLC player but now I want to stream my live video to the internet, I was hoping I could open port 8090 on my router and stream through my static ip but there is something I am missing. Is there a simpler way to do that? many thanks.

  6. I have been trying to make timelapse for only few hours but I have a little problem, the raspi stops taking pictures after one hour, here is the command I used, raspistill -t 864000000 -vf -w 1920 -h 1080 -tl 6000 -o 6_%05d_prufa-veisla.jpg
    I figured out that it shouldn’t make any difference if I have the command for 10 days by keeping the -t 86000000 because I am always going to stop the time-lapse after 5 hours or so, I changed the command for time between shots to 6000 or down to 1 sec between shots. or 60 shots per minute in 5 hours or 3600 shots per hour. 18.000 images for 5 hours. Am I doing something wrong here. Any ideas? everything else is working fine. The only thing I have to do now is restarting the command every hour, it would be nice if I could skip that restarting command part every hour. Many thanks,

Leave a Reply