This is a simple but powerful Linux bash script to create stop motion
time-lapse videos from an Internet URL or an attached video device (see
examples). Simply point it at an
image source, set the capture frequency, and starting recording
stillframes. You can view your stillframes as a video, or convert
to a true video format at any point. Bad frames can be
browsed/removed with the operating system file browser.
supports multiple frame capture mechanisms (Internet
webcam, attached video device, and screen capture)
selectable playback frame rate
configurable URL capture
supports multiple instances in the same directory
sequential or datestamped filenaming
video creation from still frames
OS level still frame editing/deletion
visual/audio frame capture feedback
pseduo-real-time display of captured frames
can be used to play/create movies from previously
captured still frames
test mode for capture and display of a single frame
supports HTTP authentication
Copy this short script into the directory where you
want to create your movie
Make sure it is executable (eg, you may have to do
"chmod +x stopmotion_xxxxxxxx.sh")
execute it from a shell (terminal) window
use the simple menu to point it toward a [U]RL (or
use "INTERNAL" to grab from an attached camera)
set the [D]elay between captures
[T]est the capture to make sure it is pulling in
If everything looks good, start the automated
[Q] the capture mode when you have enough frames
set the desired playback [F]ramerate
scan and delete any bad frames using your operating
view your video from the [S]till frames
[C]onvert your still frames to a video
[P]lay your video for confirmation that it was
[E]rase your still frames since you don't need them
anymore (answer "yes" at prompt)
You can run multiple instances within the same
directory, so that one instance is actively capturing images, and
another allows you to playback video of the captured frames to see how
your movie is progressing.
Beep==1 will beep immediately before and after a
ViewCap==1 will display the most recently capture
If CameraURL=="INTERNAL", then a frame capture from
the attached camera will occur via video4linux (V4L).
The CameraURL is of the form:
The URL must point to still frames (almost always
JPEGs). Video streams (eg, MJPG, MPEG, etc.) will *not* work.
This program runs in Linux! You might be able to get it to work
under windows using cygwin.
If you're capturing from an attached device, make
sure that "streamer"
is working properly before running this script.
If you want to use "fswebcam" instead of "streamer",
you will have to
adjust the script accordingly.
You may want to tweak mencoder for the desired
This script relies on some other programs to do the heavy lifting, like
capturing video, and creating/dislaying movies. You need these
programs installed if you're using the associated functions. The
following programs are used:
used to grab frames from Internet
used to grab frames via video4linux
creates movie from individual frames
plays movies and still frames
used to display captured frames
I came across a few oddities in creating this:
Streamer: requires the extension ".jpeg" in the
output file for still image capture
Display (from Image Magick): can't do timed
display for less than 3 seconds, and the "delay option" is a flaky for
If you enjoy this script, please drop me a note at webmaster(at)corticalcafe.com.
And please note that continuous frame-grabbing from random cameras
does consume bandwidth, so be respectful, and keep your image captures
to a reasonable level.
2008/03 Original release by AS
2012/04 Modified by AS, way more features and a much