I do a lot of baking of fresh home made bread and I play around with time lapse photography from time to time. It seemed natural to put together a time lapse video of bread dough rising.
How it was done
I have used the Fire Storm fswebcam program for Linux to trigger web-cams to take periodic frames to monitor my house when I was away last winter. By being able to take periodic frames, fswebcam also makes it easy to do time lapse photography.
Basically for this GIF animation, the camera is triggered 10 times per hour. I run it under Linux using a Bash shell script that time and date stamps the images when they are saved and creates folders based on the date. Then I open up the GIMP graphics editor and use File-> Open as Layers to bring all the images in, 140 in this case. Then Filters-> Animation->Optimize (for GIF) creates the animation. I then save it as a GIF with 100ms delay between frames and allow looping. I did find another way to create videos found under the section How To Make a movie, under the section that talks about doing it via SSH on the Raspberry Pi, on the site, How To Capture Time-Lapse Photography With Your Raspberry Pi and DSLR or USB Webcam
The bread dough is a standard type of dough that I use often. It starts with 100g water and 100g white unbleached flour with a pinch f yeast as a poolish. This is left in a container overnight. Then 2 cups of flour, approximately 10 grams of salt and another pinch of yeast are added and thoroughly mixed. Water is added to the poolish, I start with about 1/2 cup. It is all mixed together adding more water if needed. It forms a dough ball that is worked for 1-2 minutes. Then I let it sit for 15 minutes. Water is contained in the starch bonds, this water is released during the working of the dough, it has a bit of a time delay and it will release even more water for a while after it has been worked. Allowing it to rest for 15-30 minutes allows the water to come out of the bonds and at that point you can judge whether or not the proper amount of water/flour ratio exists by the feel. Then I let the dough rise in a bowl that was coated with olive oil. My standard practice would not dictate letting it rise in open air overnight, effectively this dough has over proofed, but to take the pictures, I decide to just let it go and do it’s thing. Normally, it would be punched down a few times and if I am not ready to make it, it might go in the fridge overnight.
How did it come out by just letting it go and rise on it’s own? Surprisingly the end product was OK, I actually baked it as in the Pyrex bowl and it was a fairly good bread after all. Baked at 400 F for about 40 minutes. I preheated the oven with small bowls of water in it to add moisture as well, leaving them in while the bread baked. This enhances the crust of the bread.
Technical details on capturing the frames
I used Fswebcam to capture the images. It has to be compiled from the source code. Below are my notes related to fswebcam. I had a bit of a hard time getting it to run last year, but the essence of what I had to do is captured below.
fswebcam – Small and simple webcam software for *nix.
Created by Philip Heron <philATCHARACTERsanslogic.co.uk>
This is the program used to generate images for a webcam. It captures a number
of frames from any V4L or V4L2 compatible device, averages them to reduce noise
and draws the details on it using the GD Graphics Library which also handles
compressing the image to PNG or JPEG.
sudo apt-get install fswebcam
Alternatively install via the DEB packages below if you want a newer version that apt can install, especially if it installs the 2009 version, which it will do if you are using an older version of Ubuntu Linux. Try the latest one that will work, I was able to get a new version that did not complain about missing packages.
I first ran fswebcam on Ubuntu 10.04 and ran into issue with an old webcam (Using palette SGRBG8 was not supported and I got an unsupported palette error), plus all of the features advertised for the fswebcam such as labeling the photos and printing a time stamp on them was not working. It was probably in the works and didn’t make it into the release, or something on my installation was not supporting the label adding feature. But I was able to get the 20101118 installed via a DEB package above.
If using dpkg to install one of the deb packages fails. Or in the case you want to work through compiling this code, follow the guidelines below, which do not cover all cases.
I did compile from scratch years ago to get a newer version of fswebcam installed, beyond what the package manager would install. I have found out that dpkg will install version 20101118 on Ubuntu 10.04 without complaint. Beyond that version, dpkg will complain about missing dependencies. I was able to compile the version labelled 20110707 and that ran on 10.04. If you need to find the version of fswebcam use….
The versions currently run to 20140113, trusty release, as of 11/26/2014.
Installing GD Library, do this before installing fswebcam
This part gave a bit of a hard time as my notes below state that there was a few failed attempts to get fswebcam up and running.
sudo apt-get install libgd2-xpm-dev ./configure --prefix=/usr make sudo make install
NOT SURE IF THIS IS NEEDED
But I actually tried this first, instead of the command sequence above…
cd to the libgd-2.1.0 directory
./configure make sudo make install
Then tried to compile fswebcam again and it complained about missing JPEG GD package, so did the compile again for GD with this command sequence instead…
./configure --with-jpeg --with-png --with-freetype make clean make sudo make install
So I think the first method of config,make,install of libgd2-xpm-dev is the one to try, first!
I only put the failed stuff here because I am not sure if doing the failed stuff first put in JPG, freetype or something that made things work once ibgd2-xpm-dev was loaded in.
Compile and Install fswebcam
Download the source code from http://www.sanslogic.co.uk/fswebcam/ and unzip in a directory named something useful under you home folder. Use tar to extract it.
tar xvzf fswebcam-DATECODE.tar.gz
Best to use sudo make install so that the files wind up being able to be put where they need to be.
Run the following commands in the source folder to build and install fswebcam:
./configure --prefix=/usr make make install
It’s only requirements are that the GD library be installed with JPEG, PNG
and FreeType support.
Checking to see if the webcam is being read by the PC
Command to see what devices are hooked up to the USB for video…
There is also a porgram called Cheese that can be installed via the package installer for Ubuntu. This lets you see the video live from the web cam. It makes it easy to adjust distance, angles, lighting and focus the cam while setting up the shot.
I created autocam.sh to be called by watch periodically in order to snap a photo, name it the yr,month,day:time.jpg and put it in a created folder label for the date. Then I used to copy to Wuala mirrored path, which would automatically load it onto a Wuala cloud drive. The script below has the Wuala stuff ripped out. At the bottom of this post there is an explanation on how to use Wuala as an NFS drive.
For example, call bash script every 10 seconds…
watch -n 10 bash autocam.sh
Remember to chmod u+x autocam.sh so that it can be made into an executable script.
# this is the command to run this with watch -n 3579 bash autocam.sh for hourly rate at 255 frames to image # this is the command to run this with watch -n 350 bash autocam.sh for 10x hourly rate
#now is the filename for the date stamped jpg file now=$(date +"%Y-%m-%d-%H:%M:%S")
#dir is the directory that is dated as the date of the picture. I need an IF statement around this so it doesn't keep creating the same dir. dir=$(date +"%Y%m%d")
#pathnow, I don't think is needed anymore.
#filename="$now.jpg" # example filename: my_program.2012-01-23-47.log
#fswebcam -S 15 --flip h --jpeg 90 --shadow --title "erick cam" --subtitle "Home" --info "Monitor: Active @ 1 fph" --save $now.jpg --device /dev/video0 fswebcam -S 15 --jpeg 90 --shadow --title "erick webcam" --subtitle "Dough Rising" --info "Monitor: Active @ 10 fph" --save $now.jpg --device /dev/video0 -F 50
# Copy cam pic to file that the FTP program will send to the frontiernet.net site. cp $now.jpg cam1.jpg
#move local copy to local directory only and copy for FTP! mv $now.jpg $dir
#put on website to embed into page
HOST='ftp.ftplocation.net' USER='xxxxxxxxx' PASSWD='xxxxxxxx' FILE='cam1.jpg'
ftp -n $HOST <<END_SCRIPT quote USER $USER quote PASS $PASSWD cd public_html put $FILE quit END_SCRIPT
I was saving the pictures onto a Wuala cloud drive when I originally developed the autocam.sh script.
Might need this package so that Wuala can map as an NFS drive…
sudo apt-get install portmap nfs-common
Location of Wuala drive as it created by default…
Shows how-to install fswebcam via package installer, I have not tried this…
To make a movie via the Linux Command line, go to the section on How To Make a movie, under the section that talks about doing it via SSH on the Raspberry Pi, on the site…
From Some fun with a webcam , I like how the code to run the camera has it set the font as white against a transparent footer. The code in bold makes it happen…
exec fswebcam –quiet –skip 14 \
–font $font \–timestamp ‘%d %b %y %H:%M:%S (%Z)’ \
–no-title -r $height\x$width \
–banner-colour ‘#FF000000’ \
–line-colour ‘#FF000000’ \
–exec $capture \
–loop $interval $output
Very cool, a portable time lapse camera using a Raspberry Pi and a battery, stuffed in a tin can. This is the way to go!