############################################################
# Daemon
############################################################

# Start in daemon (background) mode and release terminal (default: off)
daemon on

############################################################
# Basic Setup Mode
############################################################

# Start in Setup-Mode, daemon disabled. (default: off)
setup_mode off

###########################################################
# Capture device options
############################################################

; videodevice /dev/video0
; tunerdevice /dev/tuner0
; input 8
norm 0
;frequency 0
rotate 0
width 640
height 480
framerate 2
;netcam_url http://192.168.0.31/video.cgi
; netcam_userpass value
; netcam_proxy value 
auto_brightness off
brightness 0
contrast 0
saturation 0
hue 0

############################################################
# Round Robin (multiple inputs on same video device name)
############################################################
roundrobin_frames 1
roundrobin_skip 1
switchfilter off

############################################################
# Motion Detection Settings:
############################################################
threshold 2500
threshold_tune off
noise_level 32
noise_tune on
night_compensate off
despeckle EedDl
# Full path name to. (Default: not defined)
; mask_file value
# Dynamically create a mask file during operation (default: 0)
# Adjust speed of mask changes from 0 (off) to 10 (fast)
smart_mask_speed 0
# area that changed intensity. Valid range: 0 - 100 , default: 0 = disabled
lightswitch 0
minimum_motion_frames 1
pre_capture 0
post_capture 1
gap 60
minimum_gap 0
max_mpeg_time 0
low_cpu 0
output_all off

############################################################
# Image File Output
############################################################
output_normal on
output_motion off
quality 80
ppm off

############################################################
# Film (mpeg) File Output - ffmpeg based
############################################################
ffmpeg_cap_new on
ffmpeg_cap_motion off
ffmpeg_timelapse 0
ffmpeg_timelapse_mode daily
ffmpeg_bps 500000
ffmpeg_variable_bitrate 0
ffmpeg_video_codec msmpeg4

############################################################
# Snapshots (Traditional Periodic Webcam File Output)
############################################################
snapshot_interval 0

############################################################
# Text Display
# %Y = year, %m = month, %d = date,
# %H = hour, %M = minute, %S = second, %T = HH:MM:SS,
# %v = event, %q = frame number, %t = thread (camera) number,
# %D = changed pixels, %N = noise level, \n = new line,
# %i and %J = width and height of motion area,
# %K and %L = X and Y coordinates of motion center
# %C = value defined by text_event - do not use with text_event!
# You can put quotation marks around the text to allow
# leading spaces
############################################################
locate off
text_right %Y-%m-%d\n%T
; text_left CAMERA %t
text_changes off
text_event %Y%m%d%H%M%S-cam%t
text_double on

############################################################
# Target Directories and filenames For Images And Films
# For the options snapshot_, jpeg_, mpeg_ and timelapse_filename
# you can use conversion specifiers
# %Y = year, %m = month, %d = date,
# %H = hour, %M = minute, %S = second,
# %v = event, %q = frame number, %t = thread (camera) number,
# %D = changed pixels, %N = noise level,
# %i and %J = width and height of motion area,
# %K and %L = X and Y coordinates of motion center
# %C = value defined by text_event
# Quotation marks round string are allowed.
############################################################
target_dir /home/klaus/motion
snapshot_filename %v-%Y%m%d%H%M%S-snapshot
jpeg_filename %Y%m%d%H%M%S--%v-%q-cam%t
ffmpeg_filename %Y%m%d%H%M%S-%v-cam%t
timelapse_filename %Y%m%d-tl-cam%t

############################################################
# Live Webcam Server
############################################################
;webcam_port 8081
webcam_quality 50
webcam_motion off
webcam_maxrate 1
webcam_localhost off
webcam_limit 0

############################################################
# HTTP Based Control
############################################################
control_port 8080
control_localhost off
control_html_output on
control_authentication username:password

############################################################
# Tracking (Pan/Tilt)
############################################################
track_type 0
; track_port value
track_motorx -1
track_maxx 0
track_iomojo_id 0
track_speed 255
track_stepsize 40

############################################################
# External Commands, Warnings and Logging:
# You can use conversion specifiers for the on_xxxx commands
# %Y = year, %m = month, %d = date,
# %H = hour, %M = minute, %S = second,
# %v = event, %q = frame number, %t = thread (camera) number,
# %D = changed pixels, %N = noise level,
# %i and %J = width and height of motion area,
# %K and %L = X and Y coordinates of motion center
# %C = value defined by text_event
# %f = filename with full path
# %n = number indicating filetype
# Both %f and %n are only defined for on_picture_save,
# on_movie_start and on_movie_end
# Quotation marks round string are allowed.
############################################################
quiet on
; on_event_start value
; on_event_end value
; on_picture_save value
; on_motion_detected value
; on_movie_start value
; on_movie_end value

############################################################
# Common Options For MySQL and PostgreSQL database features.
# Options require the MySQL/PostgreSQL options to be active also.
############################################################
sql_log_image off
sql_log_snapshot off
sql_log_mpeg off
sql_log_timelapse off
# insert into security(camera, filename, frame, file_type, time_stamp, text_event) values('%t', '%f', '%q', '%n', '%Y-%m-%d %T', '%C')
;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')

############################################################
# Database Options For MySQL
############################################################
; mysql_db value
; mysql_host value
; mysql_user value
; mysql_password value

############################################################
# Video Loopback Device (vloopback project)
############################################################
# The value '-' means next available (default: not defined)
; video_pipe value
; motion_video_pipe value

##############################################################
# Thread config files - One for each camera.
# Except if only one camera - You only need this config file.
# If you have more than one camera you MUST define one thread
# config file for each camera in addition to this config file.
##############################################################
thread /usr/local/etc/cam1.conf
thread /usr/local/etc/cam2.conf
thread /usr/local/etc/cam3.conf
thread /usr/local/etc/cam4.conf
;thread /usr/local/etc/cam5.conf
