Didier Stevens

Nokia Time Lapse Photography

#!/usr/bin/python

__description__ = 'Tool to take pictures with a Nokia phone at regular intervals'
__author__ = 'Didier Stevens'
__version__ = '0.1.2'
__date__ = '2009/08/20'

"""

Source code put in public domain by Didier Stevens, no Copyright

https://DidierStevens.com

Use at your own risk

History:
 2009/06/17: start
 2009/06/22: refactoring
 2009/08/20: debugging path join

Todo:
 Get Threading to work
"""

import camera
import time
import os

timelapseFolder = 'e:\\timelapse\\'
sleepTime = 57

def TakeAndSavePicture():
    global timelapseFolder

    now = '%04d%02d%02d-%02d%02d%02d' % time.localtime()[0:6]
    pic = camera.take_photo()
    picname = os.path.join(timelapseFolder, now) + '.jpeg'
    pic.save(picname)
    print 'Picture taken: %s' % now
    print 'File: %s' % picname

def Main():
    global timelapseFolder
    global sleepTime

    print 'Timelapse photography started'
    if not os.path.isdir(timelapseFolder):
        os.mkdir(timelapseFolder)
        print 'Timelapse folder created: %s' % timelapseFolder
    print 'Wait between pictures %d' % sleepTime
    while True:
        TakeAndSavePicture()
        time.sleep(sleepTime)

if __name__ == '__main__':
    Main()

10 Comments »

  1. How does it work on Nokia phone.srry..i am newbie here.
    cya

    Comment by U:N:R — Sunday 13 September 2009 @ 1:43

  2. please oh please…

    can u explain to me how to do it step by step?
    how do i install this to my phone?

    Please answer mate.

    i copy paste that to where

    help mate

    Comment by peter — Tuesday 13 April 2010 @ 1:26

  3. Hi Didier, does this software allow the screen to turn off while it’s running? I am thinking of buying one of these phones for this specific purpose and I want the battery to last as long as possible. Thanks

    Comment by Andrew — Sunday 6 June 2010 @ 3:33

  4. @Andrew Yes, when I use this program, the backlight turns of on my Nokia like with any other program if I don’t press keys.

    Comment by Didier Stevens — Sunday 6 June 2010 @ 10:20

  5. @Andrew
    If u go for a nokia smart phone (a slider or a touch bar) it will have a lock/unlock key which will immediately turn off the screen.

    This is a python script. So the nokia device should have latest python framwork installed for this to work, but even I don’t know whether this needs compilation or just saving this code to a .py file is enought ;)

    Comment by Ganesh — Tuesday 20 July 2010 @ 6:27

  6. Interesting post … thanks!

    E: vishalpanjwani@hotmail.com

    Comment by Vish (vishalpanjwani@hotmail.com) — Thursday 21 October 2010 @ 5:13

  7. Hello all,

    it works like a charm but is there a possibility to change the resolution of the pics?

    tq,

    Comment by Waltörd Slånnkkz — Monday 13 June 2011 @ 10:33

  8. Not on the Nokia I have.

    Comment by Didier Stevens — Sunday 19 June 2011 @ 9:08

  9. Thanks for sharing this! It was really helpful!

    Comment by Actively Social — Thursday 21 July 2011 @ 6:52


RSS feed for comments on this post. TrackBack URI

Leave a Reply (comments are moderated)

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

The Rubric Theme. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 239 other followers

%d bloggers like this: