Capturing camera photos at regular intervals

In my research, I sometimes need to record video from an experiment. But in reality, I don't need multiple frames per second video, I just need a photo of the environment at a regular interval, like once per second. These photos allow me to go back in post-processing to figure out exactly where people were in the environment, for example. Here are the problems with using, for example, a Flip video recorder to record video:

  • Low quality: I need images that perhaps can go into publications. Even a HD video frame is not really a high quality image for a print publication.
  • Un-synchronized: I am typically collecting data simultaneously on my laptop. The video time stamps are not synchronized to my laptop's clock, so then the problem is that in post-processing I have to figure out what time each frame was taken in terms of my laptop's clock.

Another problem with my web cam is that it hard to point it in the right direction to capture a picture of the environment. Instead, I use a usb-connected camera with a stand that I can point in whatever direction I want.

The solution I use to capture images at a regular interval is to use the "streamer" program. It will allow me to collect images at a set rate (with the -r option). It allows me to change the video camera from the web cam, which appears as /dev/video0 on ubuntu, to the usb camera, which appears as /dev/video1. Also, it automatically increments the file name, and will stop after a known period of time. For example, here is my command to collect a picture once per second for 10 minutes:

streamer -c /dev/video1 -t 600 -r 1 -f jpeg -o temp000.jpeg

The files will have a unique number as the last three digits of the file name, and the "date modified" field will show my laptop's system time when it was created.