Raspberry Pi Ice Sculpture Time Lapse

I have done a few time lapse videos with the Raspberry Pi Camera of clouds but wanted to do something different. So I decided to do a time lapse video of an ice sculpture melting.

Model Making

The intention was to create an ice model from the waterproofed mould. Unfortunately the ice wouldn't release from the mould in one piece. So I went to plan A.1 and decided to make a rubber latex mould. To do this you paint layers of liquid latex on a model that then peels off when it is dry. The plasticine model was a tad useless now, in fact it was a multicoloured ball, so I made a wax model from 20 or so Tea lights using the plaster mould. Just hope we don't have a power cut any time soon.After several hours of painting layers of latex on the wax model then being left overnight to dry, it was ready to make the ice model.

Images: Raspberry Pi logo wax model and rubber latex mould

The ice model was made in stages. First water with food colouring was used for the berry's and leaves and left to freeze. Then I added thin layer of water to lock in the coloured ice and froze it again. Then topped it up with plain water and froze it again.

Making a Video from a Sequence of Images

Finally after several days of model making it was time to set up the Raspberry Pi Camera. The time lapse was set-up to take an image every 20 seconds for 3 hours. Using the command

This gives a HD size image with 25% sharpening, using ISO 400. The %4d adds a sequential number to each image, in this case 4 digits so the file names will be ice0001.jpg ice0002.jpg etc.

I wanted to reverse the video so you can watch the ice grow as I think it is more interesting that way, so I needed to rename the files in reverse order so ice0001.jpg becomes ice0640.jpg and vice versa.

The simplest way for me was to use Gthumb, a photo viewer, to list the images in reverse order and then use the rename option to rename all the images in one go as a sequence from 0001.

I used an Ubuntu Desktop machine for this stage but it can be done on a Raspberry Pi. You can install Gthumb using LXterminal with the command:

sudo apt-get install gthumb

To make a video from the image sequence you can use the command line video tool avconv. Again this was done on a desktop machine as hardware accelerated encoding is not available for avconv on the RPi. Though it can be done, my desktop machine took around a minute to convert 640 frames. The RPi done it in just over 3 hours which is still useful if the capture and conversion is being done via a script.

avconv can be installed with the command:

sudo apt-get install libav-tools

This command can be used to make a HD video.

avconv -f image2 -i image%4d.jpg -c:v libx264 -r25 video.mp4

my still images were saved to a memory stick at the path /media/FD4B-B87F the files were called ice0001.jpg ice0002.jpg, so the command i used was

ice%4d.jpg = the file name ice with 4 numbers for the sequence and the file type .jpg

-c:v libx264 = make a video using the libx264 codec (High definition video) other formats can be used, to see what is available enter avconv -formats replace libx264 with your choice from the list that is preceded by an E or DE.

-r 25= Frame rate at 25 frames per second

icevideo.mp4 = the name of the created video

Once complete your video can be played with OMXplayer with the following command, for my example

omxplayer /media/FD4B-B87F/icevideo.mp4

Not wanting to waste my newly acquired model making skills I also made raspberryconnect.com out of ice for this video. I don't think I will be giving up the day job any time soon.