wok rev 13652

Fix: motion build and improve package integration
author Christophe Lincoln <pankso@slitaz.org>
date Mon Nov 19 14:21:21 2012 +0100 (2012-11-19)
parents 61f494dbe8db
children 7bae4b5c4549
files motion/receipt motion/stuff/init.d/motion motion/stuff/motion.conf
line diff
     1.1 --- a/motion/receipt	Mon Nov 19 14:20:40 2012 +0100
     1.2 +++ b/motion/receipt	Mon Nov 19 14:21:21 2012 +0100
     1.3 @@ -5,16 +5,19 @@
     1.4  CATEGORY="multimedia"
     1.5  SHORT_DESC="Motion is a program that monitors the video signal from cameras."
     1.6  MAINTAINER="pankso@slitaz.org"
     1.7 -DEPENDS="libpthread-stubs jpeg ffmpeg"
     1.8 -BUILD_DEPENDS="$DEPENDS jpeg-dev ffmpeg-dev"
     1.9  TARBALL="$PACKAGE-$VERSION.tar.gz"
    1.10  WEB_SITE="http://www.lavrsen.dk/foswiki/bin/view/Motion"
    1.11  WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
    1.12  
    1.13 +DEPENDS="libpthread-stubs jpeg libv4l"
    1.14 +BUILD_DEPENDS="libpthread-stubs jpeg-dev libv4l-dev"
    1.15 +#ffmpeg --> breaks build
    1.16 +
    1.17  # Rules to configure and make the package.
    1.18  compile_rules()
    1.19  {
    1.20  	cd $src
    1.21 +	sed -i 's@<linux/videodev.h>@<libv4l1.h>\n#include <linux/videodev2.h>@' *.c *.h
    1.22  	./configure \
    1.23  		--sysconfdir=/etc/motion &&
    1.24  	make && make install
    1.25 @@ -23,8 +26,9 @@
    1.26  # Rules to gen a SliTaz package suitable for Tazpkg.
    1.27  genpkg_rules()
    1.28  {
    1.29 -	mkdir -p $fs/usr
    1.30 -	cp -a $_pkg/etc $fs
    1.31 -	cp -a $_pkg/usr/bin $fs/usr
    1.32 +	mkdir -p $fs/etc/motion $fs/usr
    1.33 +	cp -a $install/usr/bin $fs/usr
    1.34 +	cp -a $stuff/motion.conf $fs/etc/motion
    1.35 +	cp -a $stuff/init.d $fs/etc
    1.36  	chmod 0644 $fs/etc/motion/*
    1.37  }
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/motion/stuff/init.d/motion	Mon Nov 19 14:21:21 2012 +0100
     2.3 @@ -0,0 +1,48 @@
     2.4 +#!/bin/sh
     2.5 +# /etc/init.d/motion: Start, stop and restart Motion daemon on SliTaz,
     2.6 +# at boot time or with the command line. Daemons options are configured
     2.7 +# with /etc/daemons.conf
     2.8 +#
     2.9 +. /etc/init.d/rc.functions
    2.10 +
    2.11 +NAME=Motion
    2.12 +DESC="Video detection"
    2.13 +DAEMON=/usr/bin/motion
    2.14 +PIDFILE=/run/motion/motion.pid
    2.15 +
    2.16 +case "$1" in
    2.17 +	start)
    2.18 +		if active_pidfile $PIDFILE motion ; then
    2.19 +			echo "$NAME already running."
    2.20 +			exit 1
    2.21 +		fi
    2.22 +		echo "Starting $DESC: $NAME... "
    2.23 +		mkdir -p $(dirname $PIDFILE)
    2.24 +		$DAEMON -p $PIDFILE ;;
    2.25 +	stop)
    2.26 +		if ! active_pidfile $PIDFILE motion ; then
    2.27 +			echo "$NAME is not running."
    2.28 +			exit 1
    2.29 +		fi
    2.30 +		echo -n "Stopping $DESC: $NAME... "
    2.31 +		kill $(cat $PIDFILE)
    2.32 +		rm $PIDFILE
    2.33 +		status ;;
    2.34 +	restart)
    2.35 +		if ! active_pidfile $PIDFILE motion ; then
    2.36 +			echo "$NAME is not running."
    2.37 +			exit 1
    2.38 +		fi
    2.39 +		echo "Restarting $DESC: $NAME... "
    2.40 +		kill $(cat $PIDFILE)
    2.41 +		rm $PIDFILE
    2.42 +		sleep 2
    2.43 +		$DAEMON -p $PIDFILE ;;
    2.44 +	*)
    2.45 +		echo ""
    2.46 +		echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]"
    2.47 +		echo ""
    2.48 +		exit 1 ;;
    2.49 +esac
    2.50 +
    2.51 +exit 0
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/motion/stuff/motion.conf	Mon Nov 19 14:21:21 2012 +0100
     3.3 @@ -0,0 +1,637 @@
     3.4 +# Rename this distribution example file to motion.conf
     3.5 +#
     3.6 +# This config file was generated by motion 3.2.12
     3.7 +
     3.8 +
     3.9 +############################################################
    3.10 +# Daemon
    3.11 +############################################################
    3.12 +
    3.13 +# Start in daemon (background) mode and release terminal (default: off)
    3.14 +daemon on
    3.15 +
    3.16 +# File to store the process ID, also called pid file. (default: not defined)
    3.17 +process_id_file /run/motion/motion.pid 
    3.18 +
    3.19 +############################################################
    3.20 +# Basic Setup Mode
    3.21 +############################################################
    3.22 +
    3.23 +# Start in Setup-Mode, daemon disabled. (default: off)
    3.24 +setup_mode off
    3.25 +
    3.26 +###########################################################
    3.27 +# Capture device options
    3.28 +############################################################
    3.29 +
    3.30 +# Videodevice to be used for capturing  (default /dev/video0)
    3.31 +# for FreeBSD default is /dev/bktr0
    3.32 +videodevice /dev/video0
    3.33 +
    3.34 +# v4l2_palette allows to choose preferable palette to be use by motion
    3.35 +# to capture from those supported by your videodevice. (default: 8)
    3.36 +# E.g. if your videodevice supports both V4L2_PIX_FMT_SBGGR8 and
    3.37 +# V4L2_PIX_FMT_MJPEG then motion will by default use V4L2_PIX_FMT_MJPEG.
    3.38 +# Setting v4l2_palette to 1 forces motion to use V4L2_PIX_FMT_SBGGR8
    3.39 +# instead.
    3.40 +#
    3.41 +# Values :
    3.42 +# V4L2_PIX_FMT_SN9C10X : 0  'S910'
    3.43 +# V4L2_PIX_FMT_SBGGR8  : 1  'BA81'
    3.44 +# V4L2_PIX_FMT_MJPEG   : 2  'MJPEG'
    3.45 +# V4L2_PIX_FMT_JPEG    : 3  'JPEG'
    3.46 +# V4L2_PIX_FMT_RGB24   : 4  'RGB3'
    3.47 +# V4L2_PIX_FMT_UYVY    : 5  'UYVY'
    3.48 +# V4L2_PIX_FMT_YUYV    : 6  'YUYV'
    3.49 +# V4L2_PIX_FMT_YUV422P : 7  '422P'
    3.50 +# V4L2_PIX_FMT_YUV420  : 8  'YU12'
    3.51 +v4l2_palette 8
    3.52 +
    3.53 +# Tuner device to be used for capturing using tuner as source (default /dev/tuner0)
    3.54 +# This is ONLY used for FreeBSD. Leave it commented out for Linux
    3.55 +; tunerdevice /dev/tuner0
    3.56 +
    3.57 +# The video input to be used (default: 8)
    3.58 +# Should normally be set to 0 or 1 for video/TV cards, and 8 for USB cameras
    3.59 +input 8
    3.60 +
    3.61 +# The video norm to use (only for video capture and TV tuner cards)
    3.62 +# Values: 0 (PAL), 1 (NTSC), 2 (SECAM), 3 (PAL NC no colour). Default: 0 (PAL)
    3.63 +norm 0
    3.64 +
    3.65 +# The frequency to set the tuner to (kHz) (only for TV tuner cards) (default: 0)
    3.66 +frequency 0
    3.67 +
    3.68 +# Rotate image this number of degrees. The rotation affects all saved images as
    3.69 +# well as mpeg movies. Valid values: 0 (default = no rotation), 90, 180 and 270.
    3.70 +rotate 0
    3.71 +
    3.72 +# Image width (pixels). Valid range: Camera dependent, default: 352
    3.73 +width 320
    3.74 +
    3.75 +# Image height (pixels). Valid range: Camera dependent, default: 288
    3.76 +height 240
    3.77 +
    3.78 +# Maximum number of frames to be captured per second.
    3.79 +# Valid range: 2-100. Default: 100 (almost no limit).
    3.80 +framerate 2
    3.81 +
    3.82 +# Minimum time in seconds between capturing picture frames from the camera.
    3.83 +# Default: 0 = disabled - the capture rate is given by the camera framerate.
    3.84 +# This option is used when you want to capture images at a rate lower than 2 per second.
    3.85 +minimum_frame_time 0
    3.86 +
    3.87 +# URL to use if you are using a network camera, size will be autodetected (incl http:// ftp:// or file:///)
    3.88 +# Must be a URL that returns single jpeg pictures or a raw mjpeg stream. Default: Not defined
    3.89 +; netcam_url value
    3.90 +
    3.91 +# Username and password for network camera (only if required). Default: not defined
    3.92 +# Syntax is user:password
    3.93 +; netcam_userpass value
    3.94 +
    3.95 +# The setting for keep-alive of network socket, should improve performance on compatible net cameras.
    3.96 +# 1.0:         The historical implementation using HTTP/1.0, closing the socket after each http request.
    3.97 +# keep_alive:  Use HTTP/1.0 requests with keep alive header to reuse the same connection.
    3.98 +# 1.1:         Use HTTP/1.1 requests that support keep alive as default.
    3.99 +# Default: 1.0
   3.100 +; netcam_http 1.0
   3.101 +
   3.102 +# URL to use for a netcam proxy server, if required, e.g. "http://myproxy".
   3.103 +# If a port number other than 80 is needed, use "http://myproxy:1234".
   3.104 +# Default: not defined
   3.105 +; netcam_proxy value 
   3.106 +
   3.107 +# Set less strict jpeg checks for network cameras with a poor/buggy firmware.
   3.108 +# Default: off
   3.109 +netcam_tolerant_check off
   3.110 +
   3.111 +# Let motion regulate the brightness of a video device (default: off).
   3.112 +# The auto_brightness feature uses the brightness option as its target value.
   3.113 +# If brightness is zero auto_brightness will adjust to average brightness value 128.
   3.114 +# Only recommended for cameras without auto brightness
   3.115 +auto_brightness off
   3.116 +
   3.117 +# Set the initial brightness of a video device.
   3.118 +# If auto_brightness is enabled, this value defines the average brightness level
   3.119 +# which Motion will try and adjust to.
   3.120 +# Valid range 0-255, default 0 = disabled
   3.121 +brightness 0
   3.122 +
   3.123 +# Set the contrast of a video device.
   3.124 +# Valid range 0-255, default 0 = disabled
   3.125 +contrast 0
   3.126 +
   3.127 +# Set the saturation of a video device.
   3.128 +# Valid range 0-255, default 0 = disabled
   3.129 +saturation 0
   3.130 +
   3.131 +# Set the hue of a video device (NTSC feature).
   3.132 +# Valid range 0-255, default 0 = disabled
   3.133 +hue 0
   3.134 +
   3.135 +
   3.136 +############################################################
   3.137 +# Round Robin (multiple inputs on same video device name)
   3.138 +############################################################
   3.139 +
   3.140 +# Number of frames to capture in each roundrobin step (default: 1)
   3.141 +roundrobin_frames 1
   3.142 +
   3.143 +# Number of frames to skip before each roundrobin step (default: 1)
   3.144 +roundrobin_skip 1
   3.145 +
   3.146 +# Try to filter out noise generated by roundrobin (default: off)
   3.147 +switchfilter off
   3.148 +
   3.149 +
   3.150 +############################################################
   3.151 +# Motion Detection Settings:
   3.152 +############################################################
   3.153 +
   3.154 +# Threshold for number of changed pixels in an image that
   3.155 +# triggers motion detection (default: 1500)
   3.156 +threshold 1500
   3.157 +
   3.158 +# Automatically tune the threshold down if possible (default: off)
   3.159 +threshold_tune off
   3.160 +
   3.161 +# Noise threshold for the motion detection (default: 32)
   3.162 +noise_level 32
   3.163 +
   3.164 +# Automatically tune the noise threshold (default: on)
   3.165 +noise_tune on
   3.166 +
   3.167 +# Despeckle motion image using (e)rode or (d)ilate or (l)abel (Default: not defined)
   3.168 +# Recommended value is EedDl. Any combination (and number of) of E, e, d, and D is valid.
   3.169 +# (l)abeling must only be used once and the 'l' must be the last letter.
   3.170 +# Comment out to disable
   3.171 +despeckle EedDl
   3.172 +
   3.173 +# Detect motion in predefined areas (1 - 9). Areas are numbered like that:  1 2 3
   3.174 +# A script (on_area_detected) is started immediately when motion is         4 5 6
   3.175 +# detected in one of the given areas, but only once during an event.        7 8 9
   3.176 +# One or more areas can be specified with this option. (Default: not defined)
   3.177 +; area_detect value
   3.178 +
   3.179 +# PGM file to use as a sensitivity mask.
   3.180 +# Full path name to. (Default: not defined)
   3.181 +; mask_file value
   3.182 +
   3.183 +# Dynamically create a mask file during operation (default: 0)
   3.184 +# Adjust speed of mask changes from 0 (off) to 10 (fast)
   3.185 +smart_mask_speed 0
   3.186 +
   3.187 +# Ignore sudden massive light intensity changes given as a percentage of the picture
   3.188 +# area that changed intensity. Valid range: 0 - 100 , default: 0 = disabled
   3.189 +lightswitch 0
   3.190 +
   3.191 +# Picture frames must contain motion at least the specified number of frames
   3.192 +# in a row before they are detected as true motion. At the default of 1, all
   3.193 +# motion is detected. Valid range: 1 to thousands, recommended 1-5
   3.194 +minimum_motion_frames 1
   3.195 +
   3.196 +# Specifies the number of pre-captured (buffered) pictures from before motion
   3.197 +# was detected that will be output at motion detection.
   3.198 +# Recommended range: 0 to 5 (default: 0)
   3.199 +# Do not use large values! Large values will cause Motion to skip video frames and
   3.200 +# cause unsmooth mpegs. To smooth mpegs use larger values of post_capture instead.
   3.201 +pre_capture 0
   3.202 +
   3.203 +# Number of frames to capture after motion is no longer detected (default: 0)
   3.204 +post_capture 0
   3.205 +
   3.206 +# Gap is the seconds of no motion detection that triggers the end of an event
   3.207 +# An event is defined as a series of motion images taken within a short timeframe.
   3.208 +# Recommended value is 60 seconds (Default). The value 0 is allowed and disables
   3.209 +# events causing all Motion to be written to one single mpeg file and no pre_capture.
   3.210 +gap 60
   3.211 +
   3.212 +# Maximum length in seconds of an mpeg movie
   3.213 +# When value is exceeded a new mpeg file is created. (Default: 0 = infinite)
   3.214 +max_mpeg_time 0
   3.215 +
   3.216 +# Always save images even if there was no motion (default: off)
   3.217 +output_all off
   3.218 +
   3.219 +
   3.220 +############################################################
   3.221 +# Image File Output
   3.222 +############################################################
   3.223 +
   3.224 +# Output 'normal' pictures when motion is detected (default: on)
   3.225 +# Valid values: on, off, first, best, center
   3.226 +# When set to 'first', only the first picture of an event is saved.
   3.227 +# Picture with most motion of an event is saved when set to 'best'.
   3.228 +# Picture with motion nearest center of picture is saved when set to 'center'.
   3.229 +# Can be used as preview shot for the corresponding movie.
   3.230 +output_normal on
   3.231 +
   3.232 +# Output pictures with only the pixels moving object (ghost images) (default: off)
   3.233 +output_motion off
   3.234 +
   3.235 +# The quality (in percent) to be used by the jpeg compression (default: 75)
   3.236 +quality 75
   3.237 +
   3.238 +# Output ppm images instead of jpeg (default: off)
   3.239 +ppm off
   3.240 +
   3.241 +
   3.242 +############################################################
   3.243 +# FFMPEG related options
   3.244 +# Film (mpeg) file output, and deinterlacing of the video input
   3.245 +# The options movie_filename and timelapse_filename are also used
   3.246 +# by the ffmpeg feature
   3.247 +############################################################
   3.248 +
   3.249 +# Use ffmpeg to encode mpeg movies in realtime (default: off)
   3.250 +#ffmpeg_cap_new on
   3.251 +
   3.252 +# Use ffmpeg to make movies with only the pixels moving
   3.253 +# object (ghost images) (default: off)
   3.254 +#ffmpeg_cap_motion off
   3.255 +
   3.256 +# Use ffmpeg to encode a timelapse movie 
   3.257 +# Default value 0 = off - else save frame every Nth second
   3.258 +#ffmpeg_timelapse 0
   3.259 +
   3.260 +# The file rollover mode of the timelapse video
   3.261 +# Valid values: hourly, daily (default), weekly-sunday, weekly-monday, monthly, manual
   3.262 +#ffmpeg_timelapse_mode daily
   3.263 +
   3.264 +# Bitrate to be used by the ffmpeg encoder (default: 400000)
   3.265 +# This option is ignored if ffmpeg_variable_bitrate is not 0 (disabled)
   3.266 +#ffmpeg_bps 500000
   3.267 +
   3.268 +# Enables and defines variable bitrate for the ffmpeg encoder.
   3.269 +# ffmpeg_bps is ignored if variable bitrate is enabled.
   3.270 +# Valid values: 0 (default) = fixed bitrate defined by ffmpeg_bps,
   3.271 +# or the range 2 - 31 where 2 means best quality and 31 is worst.
   3.272 +#ffmpeg_variable_bitrate 0
   3.273 +
   3.274 +# Codec to used by ffmpeg for the video compression.
   3.275 +# Timelapse mpegs are always made in mpeg1 format independent from this option.
   3.276 +# Supported formats are: mpeg1 (ffmpeg-0.4.8 only), mpeg4 (default), and msmpeg4.
   3.277 +# mpeg1 - gives you files with extension .mpg
   3.278 +# mpeg4 or msmpeg4 - gives you files with extension .avi
   3.279 +# msmpeg4 is recommended for use with Windows Media Player because
   3.280 +# it requires no installation of codec on the Windows client.
   3.281 +# swf - gives you a flash film with extension .swf
   3.282 +# flv - gives you a flash video with extension .flv
   3.283 +# ffv1 - FF video codec 1 for Lossless Encoding ( experimental )
   3.284 +# mov - QuickTime ( testing )
   3.285 +#ffmpeg_video_codec mpeg4
   3.286 +
   3.287 +# Use ffmpeg to deinterlace video. Necessary if you use an analog camera
   3.288 +# and see horizontal combing on moving objects in video or pictures.
   3.289 +# (default: off)
   3.290 +#ffmpeg_deinterlace off
   3.291 +
   3.292 +
   3.293 +############################################################
   3.294 +# Snapshots (Traditional Periodic Webcam File Output)
   3.295 +############################################################
   3.296 +
   3.297 +# Make automated snapshot every N seconds (default: 0 = disabled)
   3.298 +snapshot_interval 0
   3.299 +
   3.300 +
   3.301 +############################################################
   3.302 +# Text Display
   3.303 +# %Y = year, %m = month, %d = date,
   3.304 +# %H = hour, %M = minute, %S = second, %T = HH:MM:SS,
   3.305 +# %v = event, %q = frame number, %t = thread (camera) number,
   3.306 +# %D = changed pixels, %N = noise level, \n = new line,
   3.307 +# %i and %J = width and height of motion area,
   3.308 +# %K and %L = X and Y coordinates of motion center
   3.309 +# %C = value defined by text_event - do not use with text_event!
   3.310 +# You can put quotation marks around the text to allow
   3.311 +# leading spaces
   3.312 +############################################################
   3.313 +
   3.314 +# Locate and draw a box around the moving object.
   3.315 +# Valid values: on, off and preview (default: off)
   3.316 +# Set to 'preview' will only draw a box in preview_shot pictures.
   3.317 +locate off
   3.318 +
   3.319 +# Draws the timestamp using same options as C function strftime(3)
   3.320 +# Default: %Y-%m-%d\n%T = date in ISO format and time in 24 hour clock
   3.321 +# Text is placed in lower right corner
   3.322 +text_right %Y-%m-%d\n%T-%q
   3.323 +
   3.324 +# Draw a user defined text on the images using same options as C function strftime(3)
   3.325 +# Default: Not defined = no text
   3.326 +# Text is placed in lower left corner
   3.327 +; text_left CAMERA %t
   3.328 +
   3.329 +# Draw the number of changed pixed on the images (default: off)
   3.330 +# Will normally be set to off except when you setup and adjust the motion settings
   3.331 +# Text is placed in upper right corner
   3.332 +text_changes off
   3.333 +
   3.334 +# This option defines the value of the special event conversion specifier %C
   3.335 +# You can use any conversion specifier in this option except %C. Date and time
   3.336 +# values are from the timestamp of the first image in the current event.
   3.337 +# Default: %Y%m%d%H%M%S
   3.338 +# The idea is that %C can be used filenames and text_left/right for creating
   3.339 +# a unique identifier for each event.
   3.340 +text_event %Y%m%d%H%M%S
   3.341 +
   3.342 +# Draw characters at twice normal size on images. (default: off)
   3.343 +text_double off
   3.344 +
   3.345 +
   3.346 +############################################################
   3.347 +# Target Directories and filenames For Images And Films
   3.348 +# For the options snapshot_, jpeg_, mpeg_ and timelapse_filename
   3.349 +# you can use conversion specifiers
   3.350 +# %Y = year, %m = month, %d = date,
   3.351 +# %H = hour, %M = minute, %S = second,
   3.352 +# %v = event, %q = frame number, %t = thread (camera) number,
   3.353 +# %D = changed pixels, %N = noise level,
   3.354 +# %i and %J = width and height of motion area,
   3.355 +# %K and %L = X and Y coordinates of motion center
   3.356 +# %C = value defined by text_event
   3.357 +# Quotation marks round string are allowed.
   3.358 +############################################################
   3.359 +
   3.360 +# Target base directory for pictures and films
   3.361 +# Recommended to use absolute path. (Default: current working directory)
   3.362 +target_dir /var/lib/motion/cam1
   3.363 +
   3.364 +# File path for snapshots (jpeg or ppm) relative to target_dir
   3.365 +# Default: %v-%Y%m%d%H%M%S-snapshot
   3.366 +# Default value is equivalent to legacy oldlayout option
   3.367 +# For Motion 3.0 compatible mode choose: %Y/%m/%d/%H/%M/%S-snapshot
   3.368 +# File extension .jpg or .ppm is automatically added so do not include this.
   3.369 +# Note: A symbolic link called lastsnap.jpg created in the target_dir will always
   3.370 +# point to the latest snapshot, unless snapshot_filename is exactly 'lastsnap'
   3.371 +snapshot_filename %v-%Y%m%d%H%M%S-snapshot
   3.372 +
   3.373 +# File path for motion triggered images (jpeg or ppm) relative to target_dir
   3.374 +# Default: %v-%Y%m%d%H%M%S-%q
   3.375 +# Default value is equivalent to legacy oldlayout option
   3.376 +# For Motion 3.0 compatible mode choose: %Y/%m/%d/%H/%M/%S-%q
   3.377 +# File extension .jpg or .ppm is automatically added so do not include this
   3.378 +# Set to 'preview' together with best-preview feature enables special naming
   3.379 +# convention for preview shots. See motion guide for details
   3.380 +jpeg_filename %v-%Y%m%d%H%M%S-%q
   3.381 +
   3.382 +# File path for motion triggered ffmpeg films (mpeg) relative to target_dir
   3.383 +# Default: %v-%Y%m%d%H%M%S
   3.384 +# Default value is equivalent to legacy oldlayout option
   3.385 +# For Motion 3.0 compatible mode choose: %Y/%m/%d/%H%M%S
   3.386 +# File extension .mpg or .avi is automatically added so do not include this
   3.387 +# This option was previously called ffmpeg_filename
   3.388 +#movie_filename %v-%Y%m%d%H%M%S
   3.389 +
   3.390 +# File path for timelapse mpegs relative to target_dir
   3.391 +# Default: %Y%m%d-timelapse
   3.392 +# Default value is near equivalent to legacy oldlayout option
   3.393 +# For Motion 3.0 compatible mode choose: %Y/%m/%d-timelapse
   3.394 +# File extension .mpg is automatically added so do not include this
   3.395 +#timelapse_filename %Y%m%d-timelapse
   3.396 +
   3.397 +
   3.398 +############################################################
   3.399 +# Live Webcam Server
   3.400 +############################################################
   3.401 +
   3.402 +# The mini-http server listens to this port for requests (default: 0 = disabled)
   3.403 +webcam_port 8081
   3.404 +
   3.405 +# Quality of the jpeg (in percent) images produced (default: 50) 
   3.406 +webcam_quality 50
   3.407 +
   3.408 +# Output frames at 1 fps when no motion is detected and increase to the
   3.409 +# rate given by webcam_maxrate when motion is detected (default: off)
   3.410 +webcam_motion off
   3.411 +
   3.412 +# Maximum framerate for webcam streams (default: 1)
   3.413 +webcam_maxrate 1
   3.414 +
   3.415 +# Restrict webcam connections to localhost only (default: on)
   3.416 +webcam_localhost on
   3.417 +
   3.418 +# Limits the number of images per connection (default: 0 = unlimited)
   3.419 +# Number can be defined by multiplying actual webcam rate by desired number of seconds
   3.420 +# Actual webcam rate is the smallest of the numbers framerate and webcam_maxrate
   3.421 +webcam_limit 0
   3.422 +
   3.423 +
   3.424 +############################################################
   3.425 +# HTTP Based Control
   3.426 +############################################################
   3.427 +
   3.428 +# TCP/IP port for the http server to listen on (default: 0 = disabled)
   3.429 +control_port 8080
   3.430 +
   3.431 +# Restrict control connections to localhost only (default: on)
   3.432 +control_localhost on
   3.433 +
   3.434 +# Output for http server, select off to choose raw text plain (default: on)
   3.435 +control_html_output on
   3.436 +
   3.437 +# Authentication for the http based control. Syntax username:password
   3.438 +# Default: not defined (Disabled)
   3.439 +; control_authentication username:password
   3.440 +
   3.441 +
   3.442 +############################################################
   3.443 +# Tracking (Pan/Tilt)
   3.444 +############################################################
   3.445 +
   3.446 +# Type of tracker (0=none (default), 1=stepper, 2=iomojo, 3=pwc, 4=generic, 5=uvcvideo)
   3.447 +# The generic type enables the definition of motion center and motion size to
   3.448 +# be used with the conversion specifiers for options like on_motion_detected
   3.449 +track_type 0
   3.450 +
   3.451 +# Enable auto tracking (default: off)
   3.452 +track_auto off
   3.453 +
   3.454 +# Serial port of motor (default: none)
   3.455 +; track_port value
   3.456 +
   3.457 +# Motor number for x-axis (default: 0)
   3.458 +track_motorx 0
   3.459 +
   3.460 +# Motor number for y-axis (default: 0)
   3.461 +track_motory 0
   3.462 +
   3.463 +# Maximum value on x-axis (default: 0)
   3.464 +track_maxx 0
   3.465 +
   3.466 +# Maximum value on y-axis (default: 0)
   3.467 +track_maxy 0
   3.468 +
   3.469 +# ID of an iomojo camera if used (default: 0)
   3.470 +track_iomojo_id 0
   3.471 +
   3.472 +# Angle in degrees the camera moves per step on the X-axis
   3.473 +# with auto-track (default: 10)
   3.474 +# Currently only used with pwc type cameras
   3.475 +track_step_angle_x 10
   3.476 +
   3.477 +# Angle in degrees the camera moves per step on the Y-axis
   3.478 +# with auto-track (default: 10)
   3.479 +# Currently only used with pwc type cameras
   3.480 +track_step_angle_y 10
   3.481 +
   3.482 +# Delay to wait for after tracking movement as number
   3.483 +# of picture frames (default: 10)
   3.484 +track_move_wait 10
   3.485 +
   3.486 +# Speed to set the motor to (stepper motor option) (default: 255)
   3.487 +track_speed 255
   3.488 +
   3.489 +# Number of steps to make (stepper motor option) (default: 40)
   3.490 +track_stepsize 40
   3.491 +
   3.492 +
   3.493 +############################################################
   3.494 +# External Commands, Warnings and Logging:
   3.495 +# You can use conversion specifiers for the on_xxxx commands
   3.496 +# %Y = year, %m = month, %d = date,
   3.497 +# %H = hour, %M = minute, %S = second,
   3.498 +# %v = event, %q = frame number, %t = thread (camera) number,
   3.499 +# %D = changed pixels, %N = noise level,
   3.500 +# %i and %J = width and height of motion area,
   3.501 +# %K and %L = X and Y coordinates of motion center
   3.502 +# %C = value defined by text_event
   3.503 +# %f = filename with full path
   3.504 +# %n = number indicating filetype
   3.505 +# Both %f and %n are only defined for on_picture_save,
   3.506 +# on_movie_start and on_movie_end
   3.507 +# Quotation marks round string are allowed.
   3.508 +############################################################
   3.509 +
   3.510 +# Do not sound beeps when detecting motion (default: on)
   3.511 +# Note: Motion never beeps when running in daemon mode.
   3.512 +quiet on
   3.513 +
   3.514 +# Command to be executed when an event starts. (default: none)
   3.515 +# An event starts at first motion detected after a period of no motion defined by gap 
   3.516 +; on_event_start value
   3.517 +
   3.518 +# Command to be executed when an event ends after a period of no motion
   3.519 +# (default: none). The period of no motion is defined by option gap.
   3.520 +; on_event_end value
   3.521 +
   3.522 +# Command to be executed when a picture (.ppm|.jpg) is saved (default: none)
   3.523 +# To give the filename as an argument to a command append it with %f
   3.524 +; on_picture_save value
   3.525 +
   3.526 +# Command to be executed when a motion frame is detected (default: none)
   3.527 +; on_motion_detected value
   3.528 +
   3.529 +# Command to be executed when motion in a predefined area is detected
   3.530 +# Check option 'area_detect'.   (default: none)
   3.531 +; on_area_detected value
   3.532 +
   3.533 +# Command to be executed when a movie file (.mpg|.avi) is created. (default: none)
   3.534 +# To give the filename as an argument to a command append it with %f
   3.535 +; on_movie_start value
   3.536 +
   3.537 +# Command to be executed when a movie file (.mpg|.avi) is closed. (default: none)
   3.538 +# To give the filename as an argument to a command append it with %f
   3.539 +; on_movie_end value
   3.540 +
   3.541 +# Command to be executed when a camera can't be opened or if it is lost
   3.542 +# NOTE: There is situations when motion doesn't detect a lost camera!
   3.543 +# It depends on the driver, some drivers don't detect a lost camera at all
   3.544 +# Some hang the motion thread. Some even hang the PC! (default: none)
   3.545 +; on_camera_lost value
   3.546 +
   3.547 +############################################################
   3.548 +# Common Options For MySQL and PostgreSQL database features.
   3.549 +# Options require the MySQL/PostgreSQL options to be active also.
   3.550 +############################################################
   3.551 +
   3.552 +# Log to the database when creating motion triggered image file  (default: on)
   3.553 +#sql_log_image on
   3.554 +
   3.555 +# Log to the database when creating a snapshot image file (default: on)
   3.556 +#sql_log_snapshot on
   3.557 +
   3.558 +# Log to the database when creating motion triggered mpeg file (default: off)
   3.559 +#sql_log_mpeg off
   3.560 +
   3.561 +# Log to the database when creating timelapse mpeg file (default: off)
   3.562 +#sql_log_timelapse off
   3.563 +
   3.564 +# SQL query string that is sent to the database
   3.565 +# Use same conversion specifiers has for text features
   3.566 +# Additional special conversion specifiers are
   3.567 +# %n = the number representing the file_type
   3.568 +# %f = filename with full path
   3.569 +# Default value:
   3.570 +# insert into security(camera, filename, frame, file_type, time_stamp, text_event) values('%t', '%f', '%q', '%n', '%Y-%m-%d %T', '%C')
   3.571 +#sql_query insert into security(camera, filename, frame, file_type, time_stamp, event_time_stamp) values('%t', '%f', '%q', '%n', '%Y-%m-%d %T', '%C')
   3.572 +
   3.573 +
   3.574 +############################################################
   3.575 +# Database Options For MySQL
   3.576 +############################################################
   3.577 +
   3.578 +# Mysql database to log to (default: not defined)
   3.579 +; mysql_db value
   3.580 +
   3.581 +# The host on which the database is located (default: localhost)
   3.582 +; mysql_host value
   3.583 +
   3.584 +# User account name for MySQL database (default: not defined)
   3.585 +; mysql_user value
   3.586 +
   3.587 +# User password for MySQL database (default: not defined)
   3.588 +; mysql_password value
   3.589 +
   3.590 +
   3.591 +############################################################
   3.592 +# Database Options For PostgreSQL
   3.593 +############################################################
   3.594 +
   3.595 +# PostgreSQL database to log to (default: not defined)
   3.596 +; pgsql_db value
   3.597 +
   3.598 +# The host on which the database is located (default: localhost)
   3.599 +; pgsql_host value
   3.600 +
   3.601 +# User account name for PostgreSQL database (default: not defined)
   3.602 +; pgsql_user value
   3.603 +
   3.604 +# User password for PostgreSQL database (default: not defined)
   3.605 +; pgsql_password value
   3.606 +
   3.607 +# Port on which the PostgreSQL database is located (default: 5432)
   3.608 +; pgsql_port 5432
   3.609 +
   3.610 +
   3.611 +############################################################
   3.612 +# Video Loopback Device (vloopback project)
   3.613 +############################################################
   3.614 +
   3.615 +# Output images to a video4linux loopback device
   3.616 +# The value '-' means next available (default: not defined)
   3.617 +; video_pipe value
   3.618 +
   3.619 +# Output motion images to a video4linux loopback device
   3.620 +# The value '-' means next available (default: not defined)
   3.621 +; motion_video_pipe value
   3.622 +
   3.623 +
   3.624 +##############################################################
   3.625 +# Thread config files - One for each camera.
   3.626 +# Except if only one camera - You only need this config file.
   3.627 +# If you have more than one camera you MUST define one thread
   3.628 +# config file for each camera in addition to this config file.
   3.629 +##############################################################
   3.630 +
   3.631 +# Remember: If you have more than one camera you must have one
   3.632 +# thread file for each camera. E.g. 2 cameras requires 3 files:
   3.633 +# This motion.conf file AND thread1.conf and thread2.conf.
   3.634 +# Only put the options that are unique to each camera in the
   3.635 +# thread config files. 
   3.636 +; thread /usr/local/etc/thread1.conf
   3.637 +; thread /usr/local/etc/thread2.conf
   3.638 +; thread /usr/local/etc/thread3.conf
   3.639 +; thread /usr/local/etc/thread4.conf
   3.640 +