Time lapse geekery - Home Brew Forums
Register Now For Free!

Home Brew Forums > Home Brewing Community > General Chit Chat > Time lapse geekery

Reply
 
Thread Tools
Old 12-25-2007, 03:24 AM   #1
Yuri_Rage
Gritty.
HBT_MODERATOR.png
 
Yuri_Rage's Avatar
Recipes 
 
Jul 2006
Southwest
Posts: 14,291
Liked 813 Times on 514 Posts



I've seen a few folks post some time lapse footage here, and I wanted to give it a try. It turns out that it's quite easy under Ubuntu Linux using a webcam and video4linux. Software required includes mplayer and imagemagick.

The result: a boring movie where a candle burns and a beer is drained.
Captured every 5 seconds, replayed at 15 fps (75x speed).

[YOUTUBE]sMszDFgjQ9w[/YOUTUBE]

My shell scripts could probably be a little more elegant, but they work. Here are the details:

First, a script to start mplayer and capture images to be stored as png files in the current directory. Takes a single argument specifying the capture interval. To exit, close mplayer and hit Ctrl+c.
Code:
#!/bin/bash
# Time lapse script using mplayer

# Exit gracefully if no interval is specified
if [ "$1" = "" ]; then
  echo "Error: Please specify an image capture interval!"
  echo "USAGE: timelapse <interval>"
  echo "Where <interval> is an integer in seconds."
  exit
fi

# Make a FIFO file for use later
rm /tmp/timelapse.fifo
mkfifo /tmp/timelapse.fifo

mplayer -slave -quiet -input file=/tmp/timelapse.fifo -vf screenshot -tv driver=v4l:height=240:width=320 tv:// &

while true; do
  sleep "$1"
  echo "screenshot 0" > /tmp/timelapse.fifo
done
Next, a script to convert all the png images in the current directory to jpg format and encode them into a movie. Takes a single argument specifying the framerate.
Code:
#!/bin/bash
# Script to convert a series of png images to a movie

# Exit gracefully if no framerate is specified
if [ "$1" = "" ]; then
  echo "Error: Please specify an framerate!"
  echo "USAGE: capture2movie <framerate>"
  echo "Where <framerate> is an integer representing fps."
  exit
fi

echo "Converting png images to jpg format."
echo "This may take some time..."
for f in *png ; do
  convert -quality 100 $f `basename $f png`jpg
done

echo "Moving original captured images to folder ./backup."
mkdir backup
mv *.png backup

echo "Encoding movie..."
mencoder "mf://*.jpg" -mf fps="$1" -o test.avi -ovc lavc -lavcopts vcodec=msmpeg4v2:vbitrate=800
__________________
Homebrewed Blog..........YouTube Channel .......... Shirts, posters, etc


 
Reply With Quote
Old 12-25-2007, 03:45 AM   #2
Bobby_M
Vendor and Brewer
HBT_SPONSOR.png
 
Bobby_M's Avatar
Recipes 
 
Aug 2006
Whitehouse Station, NJ
Posts: 23,330
Liked 1765 Times on 1122 Posts


Hey, I don't know if it works in Linux but check out the free and very cool AnimatorDVsimple+

http://animatordv.com/download7

You'll see it in action when I post my dry yeast hydration video.
__________________
Welcome to BrewHardware.com. I love you.
New Stirplates are IN!
Chugger Pumps, Pump Kits, Camlocks, Sightglasses, Clear USA made Silicone Tubing, RIMS, Electric Install Parts, etc.

 
Reply With Quote
Old 12-25-2007, 03:52 AM   #3
Yuri_Rage
Gritty.
HBT_MODERATOR.png
 
Yuri_Rage's Avatar
Recipes 
 
Jul 2006
Southwest
Posts: 14,291
Liked 813 Times on 514 Posts


Thanks for the suggestion, but that software isn't gonna work in Linux, Bobby. It's Windows only, and v4l isn't supported under Wine (Windows emulator). I didn't find any time lapse software for Linux; that's why I wrote these scripts.

I wish I had a Canon digital camera. Many of them can be controlled remotely via USB, so you could potentially get very high res footage for these sorts of projects. I had to settle for the webcam for this one.

I can't wait to take some more interesting time lapse footage. I don't have a specific application in mind at the moment, it just seemed like a fun project on a lazy day.
__________________
Homebrewed Blog..........YouTube Channel .......... Shirts, posters, etc

 
Reply With Quote
Old 12-25-2007, 04:01 AM   #4
Bobby_M
Vendor and Brewer
HBT_SPONSOR.png
 
Bobby_M's Avatar
Recipes 
 
Aug 2006
Whitehouse Station, NJ
Posts: 23,330
Liked 1765 Times on 1122 Posts


Fermentations are always fun to watch. I was able to use my miniDV cam to do the capturing while connected via firewire. Not digicam res, but a reasonable option.
__________________
Welcome to BrewHardware.com. I love you.
New Stirplates are IN!
Chugger Pumps, Pump Kits, Camlocks, Sightglasses, Clear USA made Silicone Tubing, RIMS, Electric Install Parts, etc.

 
Reply With Quote
Old 12-25-2007, 04:26 AM   #5
Kevin Dean
 
Kevin Dean's Avatar
Recipes 
 
Jul 2007
Frederick, MD
Posts: 1,352
Liked 8 Times on 7 Posts


I never thought I'd see the day when, while browsing a beer forum, I'd see a BASH script to turn a series of PNG images into a timeplapse movie.

I owe that man a sixer or something...

Any licenses on them there scripts?
__________________
Free State Project liaison to the homebrew hobby!

"What's your name? Well my mom calls me Son, and my cat calls me Meow, either will do." -- Sam Dodson of the Obscured Truth Network

 
Reply With Quote
Old 12-25-2007, 04:42 AM   #6
Yuri_Rage
Gritty.
HBT_MODERATOR.png
 
Yuri_Rage's Avatar
Recipes 
 
Jul 2006
Southwest
Posts: 14,291
Liked 813 Times on 514 Posts


Quote:
Originally Posted by Kevin Dean
Any licenses on them there scripts?
Nah, I snagged most of the good stuff from various sources on the web, anyway.

The mplayer command was one that someone was using to update a web page with webcam images. Instead of removing and replacing the image each time a capture occurs, I just let 'em pile up to be stitched together later.
__________________
Homebrewed Blog..........YouTube Channel .......... Shirts, posters, etc


 
Reply With Quote
Old 12-25-2007, 04:45 AM   #7
Kevin Dean
 
Kevin Dean's Avatar
Recipes 
 
Jul 2007
Frederick, MD
Posts: 1,352
Liked 8 Times on 7 Posts


Quote:
Originally Posted by yuri
Nah, I snagged most of the good stuff from various sources on the web, anyway.
Fair enough.
__________________
Free State Project liaison to the homebrew hobby!

"What's your name? Well my mom calls me Son, and my cat calls me Meow, either will do." -- Sam Dodson of the Obscured Truth Network

 
Reply With Quote
Old 12-25-2007, 07:46 AM   #8
Dude
Will work for beer
HBT_LIFETIMESUPPORTER.png
 
Dude's Avatar
Recipes 
 
Jan 2005
Knob Noster, Missouri
Posts: 8,770
Liked 88 Times on 70 Posts


Dumb question, but can you post the URL for the video?
__________________
On Tap: Lake Walk Pale Ale -- Eternity (Raspberry Stout) -- Nutrocker -- Donnybrook Dark
Primary: Lake Walk Pale Ale
Secondary: Summit IPA
Up Next: Smoked Porter -- Pub Ale -- Watermelon Wheat
Planning:
Gone But Not Forgotten:

www.IronOrrBrewery.com

 
Reply With Quote
Old 12-25-2007, 08:47 AM   #9
Kevin Dean
 
Kevin Dean's Avatar
Recipes 
 
Jul 2007
Frederick, MD
Posts: 1,352
Liked 8 Times on 7 Posts


Quote:
Originally Posted by El Duderino - Not into that whole brevity thing
Dumb question, but can you post the URL for the video?

If you hit "Quote" on Yuri's post you'll see "sMszDFgjQ9w" between YOUTUBE tags - tack those on the end of the YouTube link (watch?v=) and you've got the URL to the video.

Merry Christmas.
__________________
Free State Project liaison to the homebrew hobby!

"What's your name? Well my mom calls me Son, and my cat calls me Meow, either will do." -- Sam Dodson of the Obscured Truth Network

 
Reply With Quote
Old 12-25-2007, 01:32 PM   #10
Bobby_M
Vendor and Brewer
HBT_SPONSOR.png
 
Bobby_M's Avatar
Recipes 
 
Aug 2006
Whitehouse Station, NJ
Posts: 23,330
Liked 1765 Times on 1122 Posts


Also if you "doubleclick" on the video it will open up youtube in a new window.
__________________
Welcome to BrewHardware.com. I love you.
New Stirplates are IN!
Chugger Pumps, Pump Kits, Camlocks, Sightglasses, Clear USA made Silicone Tubing, RIMS, Electric Install Parts, etc.

 
Reply With Quote
Reply
Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Lapse in Dog's training. BleedsDogFish General Chit Chat 11 02-10-2009 07:07 PM
Time Lapse Beer Experiment Jmarsh544 Beginners Beer Brewing Forum 1 02-03-2009 02:04 PM
21 days at 70F, time lapse vid Poindexter Beginners Beer Brewing Forum 19 07-12-2008 03:33 AM
water chemistry - RA vs ions brew geekery jammer All Grain & Partial Mash Brewing 5 03-21-2007 03:09 AM


Forum Jump