Ss Brewing Technologies Giveaway!

Home Brew Forums > Home Brewing Community > General Chit Chat > Time lapse geekery
Reply
 
LinkBack Thread Tools
Old 12-25-2007, 02: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: 13,916
Liked 607 Times on 376 Posts
Likes Given: 54

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

Last edited by Yuri_Rage; 12-25-2007 at 02:27 AM.
Yuri_Rage is online now
 
Reply With Quote Quick reply to this message
Old 12-25-2007, 02:45 AM   #2
Bobby_M
Vendor and Brewer
HBT_SPONSOR.png
Vendor Ads 
Feedback Score: 2 reviews
 
Bobby_M's Avatar
Recipes 
 
Join Date: Aug 2006
Location: Whitehouse Station, NJ
Posts: 22,013
Liked 975 Times on 652 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
Sightglass, Refractometer, Ball Valve, Weldless bulkhead, Thermometer, Decals, Stainless Steel Fittings, Compression Fittings, Camlock Quick Disconnects, Scale, RIMS tube, Plate Chiller, Chugger Pump, Super Clear Silicone Tubing, and more!

New Stuff?
Bobby_M is online now
 
Reply With Quote Quick reply to this message
Old 12-25-2007, 02: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: 13,916
Liked 607 Times on 376 Posts
Likes Given: 54

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 online now
 
Reply With Quote Quick reply to this message
Old 12-25-2007, 03:01 AM   #4
Bobby_M
Vendor and Brewer
HBT_SPONSOR.png
Vendor Ads 
Feedback Score: 2 reviews
 
Bobby_M's Avatar
Recipes 
 
Join Date: Aug 2006
Location: Whitehouse Station, NJ
Posts: 22,013
Liked 975 Times on 652 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
Sightglass, Refractometer, Ball Valve, Weldless bulkhead, Thermometer, Decals, Stainless Steel Fittings, Compression Fittings, Camlock Quick Disconnects, Scale, RIMS tube, Plate Chiller, Chugger Pump, Super Clear Silicone Tubing, and more!

New Stuff?
Bobby_M is online now
 
Reply With Quote Quick reply to this message
Old 12-25-2007, 03: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, 03: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: 13,916
Liked 607 Times on 376 Posts
Likes Given: 54

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

Last edited by Yuri_Rage; 12-25-2007 at 03:46 AM.
Yuri_Rage is online now
 
Reply With Quote Quick reply to this message
Old 12-25-2007, 03: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, 06: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 55 Times on 45 Posts
Likes Given: 5

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 online now
 
Reply With Quote Quick reply to this message
Old 12-25-2007, 07: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, 12:32 PM   #10
Bobby_M
Vendor and Brewer
HBT_SPONSOR.png
Vendor Ads 
Feedback Score: 2 reviews
 
Bobby_M's Avatar
Recipes 
 
Join Date: Aug 2006
Location: Whitehouse Station, NJ
Posts: 22,013
Liked 975 Times on 652 Posts
Likes Given: 28

Default

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

__________________
BrewHardware.com
Sightglass, Refractometer, Ball Valve, Weldless bulkhead, Thermometer, Decals, Stainless Steel Fittings, Compression Fittings, Camlock Quick Disconnects, Scale, RIMS tube, Plate Chiller, Chugger Pump, Super Clear Silicone Tubing, and more!

New Stuff?
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 06:07 PM
Time Lapse Beer Experiment Jmarsh544 Beginners Beer Brewing Forum 1 02-03-2009 01: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