LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Linux Answers > Applications / GUI / Multimedia
User Name
Password

Notices

By ////// at 2009-07-13 06:58
In this tutorial I quickly show how you can make timelapse movies.

1.

First you need nice webcam where you can download pictures.
Here is couple of Google searches that I use when I'm looking for cameras.

Google image search: /record/current.jpg
http://images.google.com/images?hl=e...gbv=2&aq=f&oq=

Google image search: intext:"Shift-Reload to Refresh Image"
http://images.google.com/images?imgs...alvPmdCQ&gbv=2

2.

Next you need some kind of dl script that downloads pictures from webcams.
http://www.rootsecure.net/content/do...downloader.txt
Code:
#!/usr/bin/perl -w
# loader.pl

$count=1;
while ($count<10000) {

    ##########Date/Time
    ( $s,$m,$h,$mday ) = localtime( time ); 
    if( $s <  10 ) { $s = "0$s" } 
    if( $m  <  10 ) { $m  = "0$m" } 
    if( $h  <  10 ) { $h  = "0$h" } 
    if( $mday <  10 ) { $mday = "0$mday" } 
 
    $date_time = "$mday~$h-$m-$s";
    ##########Date/Time

    system("lwp-download http://80.33.241.154/jpg/1/image.jpg /path/to/your/imagefolder/$date_time.jpg"); 
    sleep 60; # be polite and use reasonable time values ;)

    $count++;
}
3.

Just choose a cam you like and start loader.pl.
Code:
"perl /usr/bin/loader.pl&"
go to sleep, after a (about)thousand pictures you are ready to make your movie, it is simple.
just cd into your imagefolder and use mencoder to make your movie.
Code:
	
cd /path/to/your/imagefolder
mencoder "mf://*.jpg" -mf fps=10 -o test.avi -ovc lavc -lavcopts vcodec=msmpeg4v2:vbitrate=800
Thats it.

Here is rather boring timelapse movie made from 996 pictures.
http://www.youtube.com/watch?v=jafjX3D9v9c

sources:
http://www.rootsecure.net/content/downloads/perl_scripts
http://electron.mit.edu/~gsteele/ffmpeg/

by pwc101 on Mon, 2009-07-27 14:41
Thanks for the idea!

I wrote a simple bash script to grab the images and save them with the time and date:
Code:
#!/bin/bash

if [ \! -d $HOME/logs/webcams/soton/ ]; then
   mkdir $HOME/logs/webcams/soton/
fi
cd $HOME/logs/webcams/soton/

while true; do
   DATE=$(date "+%y-%m-%d-%H-%M-%s")
   wget --timeout=15 --quiet -nd -np \
   http://www.southampton.gov.uk/webcamimages/largesize.jpg && \
   mv largesize.jpg soton_high_street_${DATE}.jpg
   sleep 900; # be polite and use reasonable time values ;)
done
I'm looking into how to do this with my own USB webcam - I should think it's possible to grab an image from it relatively easily and it'd make an interesting video to see how we move around the flat

by ////// on Tue, 2009-09-29 07:10
I'm glad you find this tut useful, did you manage to make your own movie from your webcam ?

by pwc101 on Tue, 2009-09-29 07:34
In the end, I didn't.

I found a program called grabby that would take a single image from a webcam and then store it in a particular folder, but I only managed to get it to compile on Slackware after I contacted the author and he provided me with a few patches. Even then, after it successfully compiled, it wouldn't get the images from my webcam, so I gave up.


  



All times are GMT -5. The time now is 03:59 PM.

Main Menu
Advertisement

My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration