Come enter the BrewHardware Giveaway!


Home Brew Forums > Home Brewing Community > General Chit Chat > Time lapse geekery
Reply
 
LinkBack Thread Tools
Old 12-25-2007, 03:24 AM   #1
Yuri_Rage
Gritty.
HBT_MODERATOR.png
Feedback Score: 0 reviews
 
Yuri_Rage's Avatar
Recipes 
 
Join Date: Jul 2006
Location: Southwest
Posts: 14,011
Liked 639 Times on 401 Posts
Likes Given: 62

Default Time lapse geekery

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 "
  echo "Where  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 "
  echo "Where  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

Yuri_Rage is offline
 
Reply With Quote Quick reply to this message
Old 12-25-2007, 03:45 AM   #2
Bobby_M
Vendor and Brewer
HBT_SPONSOR.png
Vendor Ads 
Feedback Score: 3 reviews
 
Bobby_M's Avatar
Recipes 
 
Join Date: Aug 2006
Location: Whitehouse Station, NJ
Posts: 22,358
Liked 1108 Times on 735 Posts
Likes Given: 28

Default

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.

__________________
BrewHardware.com has a new website. Please check it out and let me know what you think!
New 100% Stainless Steel Heating Elements are IN!
Chugger Pumps, Pump Kits, Camlocks, Sightglasses, Clear USA made Silicone Tubing, RIMS, Electric Install Parts, etc. Did you know we are also now a full service homebrew shop selling malt, hops, yeast (Wyeast), etc?
Bobby_M is online now
 
Reply With Quote Quick reply to this message
Old 12-25-2007, 03:52 AM   #3
Yuri_Rage
Gritty.
HBT_MODERATOR.png
Feedback Score: 0 reviews
 
Yuri_Rage's Avatar
Recipes 
 
Join Date: Jul 2006
Location: Southwest
Posts: 14,011
Liked 639 Times on 401 Posts
Likes Given: 62

Default

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
Yuri_Rage is offline
 
Reply With Quote Quick reply to this message
Old 12-25-2007, 04:01 AM   #4
Bobby_M
Vendor and Brewer
HBT_SPONSOR.png
Vendor Ads 
Feedback Score: 3 reviews
 
Bobby_M's Avatar
Recipes 
 
Join Date: Aug 2006
Location: Whitehouse Station, NJ
Posts: 22,358
Liked 1108 Times on 735 Posts
Likes Given: 28

Default

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.

__________________
BrewHardware.com has a new website. Please check it out and let me know what you think!
New 100% Stainless Steel Heating Elements are IN!
Chugger Pumps, Pump Kits, Camlocks, Sightglasses, Clear USA made Silicone Tubing, RIMS, Electric Install Parts, etc. Did you know we are also now a full service homebrew shop selling malt, hops, yeast (Wyeast), etc?
Bobby_M is online now
 
Reply With Quote Quick reply to this message
Old 12-25-2007, 04:26 AM   #5
Kevin Dean
Feedback Score: 0 reviews
 
Kevin Dean's Avatar
Recipes 
 
Join Date: Jul 2007
Location: Frederick, MD
Posts: 1,377
Liked 4 Times on 4 Posts

Default

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
Kevin Dean is offline
 
Reply With Quote Quick reply to this message
Old 12-25-2007, 04:42 AM   #6
Yuri_Rage
Gritty.
HBT_MODERATOR.png
Feedback Score: 0 reviews
 
Yuri_Rage's Avatar
Recipes 
 
Join Date: Jul 2006
Location: Southwest
Posts: 14,011
Liked 639 Times on 401 Posts
Likes Given: 62

Default

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

Yuri_Rage is offline
 
Reply With Quote Quick reply to this message
Old 12-25-2007, 04:45 AM   #7
Kevin Dean
Feedback Score: 0 reviews
 
Kevin Dean's Avatar
Recipes 
 
Join Date: Jul 2007
Location: Frederick, MD
Posts: 1,377
Liked 4 Times on 4 Posts

Default

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
Kevin Dean is offline
 
Reply With Quote Quick reply to this message
Old 12-25-2007, 07:46 AM   #8
Dude
Will work for beer
HBT_LIFETIMESUPPORTER.png
Feedback Score: 0 reviews
 
Dude's Avatar
Recipes 
 
Join Date: Jan 2005
Location: Knob Noster, Missouri
Posts: 8,843
Liked 72 Times on 62 Posts
Likes Given: 6

Default

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
Dude is offline
 
Reply With Quote Quick reply to this message
Old 12-25-2007, 08:47 AM   #9
Kevin Dean
Feedback Score: 0 reviews
 
Kevin Dean's Avatar
Recipes 
 
Join Date: Jul 2007
Location: Frederick, MD
Posts: 1,377
Liked 4 Times on 4 Posts

Default

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
Kevin Dean is offline
 
Reply With Quote Quick reply to this message
Old 12-25-2007, 01:32 PM   #10
Bobby_M
Vendor and Brewer
HBT_SPONSOR.png
Vendor Ads 
Feedback Score: 3 reviews
 
Bobby_M's Avatar
Recipes 
 
Join Date: Aug 2006
Location: Whitehouse Station, NJ
Posts: 22,358
Liked 1108 Times on 735 Posts
Likes Given: 28

Default

Also if you "doubleclick" on the video it will open up youtube in a new window.

__________________
BrewHardware.com has a new website. Please check it out and let me know what you think!
New 100% Stainless Steel Heating Elements are IN!
Chugger Pumps, Pump Kits, Camlocks, Sightglasses, Clear USA made Silicone Tubing, RIMS, Electric Install Parts, etc. Did you know we are also now a full service homebrew shop selling malt, hops, yeast (Wyeast), etc?
Bobby_M is online now
 
Reply With Quote Quick reply to this message
Reply



Quick Reply
Message:
Options
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 04:33 AM
water chemistry - RA vs ions brew geekery jammer All Grain & Partial Mash Brewing 5 03-21-2007 04:09 AM



Newest Threads

LATEST SPONSOR DEALS