Webcam stop motion

Submitted by whirlpool on Sun, 18/07/2004 - 12:52.

To me the coolest thing one can do with a 24 hour available internet connection is to continously download webcam shots from different parts of the world. Save the series of images locally and produce a video out of them. Pretty cool actually. You can have a look at my first sequence.

The webcam is here

I wrote a 10 line python script to grab the photos and by a simple mencoder command, I create the video.

The python script:

#!/usr/bin/python

import urllib, time, sys

i = 0
url = sys.argv[1]
duration = int(sys.argv[2])
while 1:
        j = str(i).zfill(6)
        filename = "webshot%s.jpg"%j
        urllib.urlretrieve(url, filename)
        time.sleep(duration)
        i = i + 1

This work by:

./webcamer.py URL seconds

The only issue with this script is that it doesn't check if the downloaded image is an undamaged jpeg. As you will find that sometimes the downloading of the image will happen at the same time it is being uploaded. However, this is not very frequent. I resolve them manually.

The mencoder command:

mencoder "mf://*.jpg" -mf fps=25 -o output.avi -ovc lavc

Ah, BTW I think those stop motion sequences could really be a good source of video for VJ's. They can be looped, ping ponged etc..

One more tip, try starting the sequence by night. This way when they loop you will not notice a change in the cloud pattern.


Reply





*

  • Allowed HTML tags: <a> <b> <dd> <dl> <dt> <i> <li> <ol> <ul> <pre> <blockquote> <img> <ins> <del> <br> <div> <span> <em> <h1> <h2> <h3> <h4> <h5> <h6> <code> <p> <hr>
  • You can insert tables with comma separated values (CSV) into the text, they will be automatically converted to appropriate HTML-tables.
  • You may link to images on this site using a special syntax
  • You can embed nodes within other nodes using the following syntax:
    [node:node_id,param_1="val1",param_2="val2"]
  • You may write mixed Arabic and English freely, line direction will be computed automaticaly
  • Glossary terms will be automatically marked with links to their descriptions