My Timelapse Machine - Raspberry Pi Build Log
First, some basic things... I'm assuming you know your way around a Linux box. This won't be too detailed, but if you get stuck, leave a comment and I'll do my best to help. I'm sure there's a lot of improvement we can make on the actual /etc/motion.conf file. If you have a particular configuration you like, please share!
auto lo iface lo inet loopback iface eth0 inet static address 10.0.1.11 netmask 255.255.255.0 network 10.0.1.0 broadcast 10.0.1.255 gateway 10.0.1.1
daemon off process_id_file /var/run/motion/motion.pid setup_mode off videodevice /dev/video0 # Values : # V4L2_PIX_FMT_SN9C10X : 0 'S910' # V4L2_PIX_FMT_SBGGR8 : 1 'BA81' # V4L2_PIX_FMT_MJPEG : 2 'MJPEG' # V4L2_PIX_FMT_JPEG : 3 'JPEG' # V4L2_PIX_FMT_RGB24 : 4 'RGB3' # V4L2_PIX_FMT_UYVY : 5 'UYVY' # V4L2_PIX_FMT_YUYV : 6 'YUYV' # V4L2_PIX_FMT_YUV422P : 7 '422P' # V4L2_PIX_FMT_YUV420 : 8 'YU12' v4l2_palette 6 input 8 width 960 height 720 # Maximum number of frames to be captured per second. # Valid range: 2-100. Default: 100 (almost no limit). #framerate 1 # Minimum time in seconds between capturing picture frames from the camera. # Default: 0 = disabled - the capture rate is given by the camera framerate. # This option is used when you want to capture images at a rate lower than 2 per second. minimum_frame_time 0 # Let motion regulate the brightness of a video device (default: off). # The auto_brightness feature uses the brightness option as its target value. # If brightness is zero auto_brightness will adjust to average brightness value 128. # Only recommended for cameras without auto brightness auto_brightness off # Set the initial brightness of a video device. # If auto_brightness is enabled, this value defines the average brightness level # which Motion will try and adjust to. # Valid range 0-255, default 0 = disabled brightness 0 # Set the contrast of a video device. # Valid range 0-255, default 0 = disabled contrast 0 # Set the saturation of a video device. # Valid range 0-255, default 0 = disabled saturation 0 # Set the hue of a video device (NTSC feature). # Valid range 0-255, default 0 = disabled hue 0 output_all off output_normal off output_motion off ffmpeg_cap_new off ffmpeg_cap_motion off ffmpeg_timelapse 30 ffmpeg_timelapse_mode daily ffmpeg_bps 1288000 ffmpeg_variable_bitrate 2 snapshot_interval 0 # Draws the timestamp using same options as C function strftime(3) # Default: %Y-%m-%d\n%T = date in ISO format and time in 24 hour clock # Text is placed in lower right corner #text_right %Y-%m-%d\n%T-%q #text_changes off #text_event %Y%m%d%H%M%S #text_double off target_dir /mnt/motion snapshot_filename %v-%Y%m%d%H%M%S-snapshot jpeg_filename %v-%Y%m%d%H%M%S-%q movie_filename %v-%Y%m%d%H%M%S timelapse_filename %Y%m%d-timelapse webcam_port 0 webcam_quality 50 webcam_motion off webcam_maxrate 1 webcam_localhost off webcam_limit 0 control_port 0 control_localhost off control_html_output off quiet on
/dev/sda1 /mnt/motion vfat defaults,uid=106,gid=109,umask=000 0 0
Install the packages we need:
sudo apt-get install uvccapture uvcdynctrl motion
Prepare the pi for your USB stick (I'm using FAT32, use whatever you want!)
sudo mkdir /mnt/motion cd /mnt/motion/ sudo chmod 777 .
From here, you should be able to power off your pi, plug in your formatted USB stick, a USB webcam, and when you boot next, it will start taking pictures. Some webcams have a LED indicator. If you see it turn on, you know you're in business. My goal was to make this as zero-touch as possible.
Adjust the "ffmpeg_timelapse 30" setting in /etc/motion.conf to configure your capture interval, in seconds.