For simplicity a lot of things are hardcoded in these scripts, so you most certainly have to make changes. The scripts should be easy to understand, as they are quite short and simple. However if anything is unclear, just drop me a comment.
This blog is supposed to be a collection of random, unrelated, little ideas, thoughts, and discoveries, which I assume to be helpful to a negligible part of the world's population and wish to share out of pure altruism. If posts appear really weird, maybe you have the wrong kind of humor. Many of the posts are science/technology related. If you are opposed to that, stop reading here! Comments, criticism, corrections, amendments, questions are always welcome.
2012-07-09
Creating Timelapse Videos with a Webcam
Last week I had some fun creating timelapse videos using just an inexpensive webcam and a laptop. Timelapse videos are a nice way to visualize processes which are otherwise to slow to observe directly (eg. the movement of clouds or the growth of plants). Technically the the solution to all the world's problems seem to be little Python scripts, which can be
downloaded here. ;)
For simplicity a lot of things are hardcoded in these scripts, so you most certainly have to make changes. The scripts should be easy to understand, as they are quite short and simple. However if anything is unclear, just drop me a comment.
For simplicity a lot of things are hardcoded in these scripts, so you most certainly have to make changes. The scripts should be easy to understand, as they are quite short and simple. However if anything is unclear, just drop me a comment.
Labels:
ffmpeg,
gimp,
Python,
timelapse video,
webcam
Subscribe to:
Post Comments (Atom)
i am getting a error as follows :
ReplyDelete>>>
Traceback (most recent call last):
File "C:\Users\Acer\Desktop\timelapse\timelapse.py", line 24, in
subprocess.call(["ffmpeg", "-f", "video4linux2", "-s", "1280x720", "-r", "1", "-i", "/dev/video0", "-vframes", "1", "-f", "image2", "./jpgs/image_"+str(i)+".jpg"])
File "C:\Python26\lib\subprocess.py", line 444, in call
return Popen(*popenargs, **kwargs).wait()
File "C:\Python26\lib\subprocess.py", line 595, in __init__
errread, errwrite)
File "C:\Python26\lib\subprocess.py", line 821, in _execute_child
startupinfo)
WindowsError: [Error 2] The system cannot find the file specified
>>>
Do you have ffmpeg installed? Is it in your path variable?
DeleteI assume you are using Windows. Unfortunately I have no experience how easy or hard it is using ffmpeg on Windows. Maybe it is a good idea to download and install ffmpeg or any other program that can be used to acquire images from a webcam.
After that you can play a bit with this program to figure out how acquiring individual images works and then change the line in the script accordingly.
Sorry that I cannot be more precise.
Volker