Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
*.log
.svn/
*.o
.depend
Makefile
config.h
config.status
motion
motion-dist.conf
motion.init-Debian
motion.init-Fedora
motion.init-FreeBSD.sh
motion.spec
thread1.conf
thread2.conf
thread3.conf
thread4.conf
202 changes: 35 additions & 167 deletions conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,11 @@ struct config conf_template = {
ffmpeg_output: 0,
extpipe: NULL,
useextpipe: 0,
smooth_video: 0,
ffmpeg_output_debug: 0,
ffmpeg_bps: DEF_FFMPEG_BPS,
ffmpeg_vbr: DEF_FFMPEG_VBR,
ffmpeg_video_codec: DEF_FFMPEG_CODEC,
#ifdef HAVE_SDL
sdl_threadnr: 0,
#endif
ipv6_enabled: 0,
stream_port: 0,
stream_quality: 50,
Expand All @@ -103,9 +101,6 @@ struct config conf_template = {
tuner_number: 0,
timelapse: 0,
timelapse_mode: DEF_TIMELAPSE_MODE,
#if (defined(BSD))
tuner_device: NULL,
#endif
video_device: VIDEO_DEVICE,
v4l2_palette: DEF_PALETTE,
vidpipe: NULL,
Expand All @@ -118,22 +113,6 @@ struct config conf_template = {
on_event_end: NULL,
mask_file: NULL,
smart_mask_speed: 0,
#if defined(HAVE_MYSQL) || defined(HAVE_PGSQL) || defined(HAVE_SQLITE3)
sql_log_image: 1,
sql_log_snapshot: 1,
sql_log_movie: 0,
sql_log_timelapse: 0,
sql_query: DEF_SQL_QUERY,
database_type: NULL,
database_dbname: NULL,
database_host: "localhost",
database_user: NULL,
database_password: NULL,
database_port: 0,
#ifdef HAVE_SQLITE3
sqlite3_db: NULL,
#endif
#endif /* defined(HAVE_MYSQL) || defined(HAVE_PGSQL) || define(HAVE_SQLITE3) */
on_picture_save: NULL,
on_motion_detected: NULL,
on_area_detected: NULL,
Expand All @@ -143,6 +122,7 @@ struct config conf_template = {
motionvidpipe: NULL,
netcam_url: NULL,
netcam_userpass: NULL,
netcam_cookie: NULL,
netcam_keepalive: "off",
netcam_proxy: NULL,
netcam_tolerant_check: 0,
Expand Down Expand Up @@ -352,6 +332,17 @@ config_param config_params[] = {
print_int
},
{
"force_framerate",
"# Force the number of frames per second set in framerate.\n"
"# This is useful for capture cards on busy system where motion\n"
"# often failed to detect the correct framerate.\n"
"# Valid range: 2-100. Default: 100 (almost no limit).",
0,
CONF_OFFSET(force_framerate),
copy_bool,
print_bool
},
{
"minimum_frame_time",
"# Minimum time in seconds between capturing picture frames from the camera.\n"
"# Default: 0 = disabled - the capture rate is given by the camera framerate.\n"
Expand Down Expand Up @@ -380,6 +371,15 @@ config_param config_params[] = {
print_string
},
{
"netcam_cookie",
"# HTTP Cookie string for network camera (only if required). Default: not defined\n"
"# Syntax is name1=value1;name2=value2",
0,
CONF_OFFSET(netcam_cookie),
copy_string,
print_string
},
{
"netcam_keepalive",
"# The setting for keep-alive of network socket, should improve performance on compatible net cameras.\n"
"# off: The historical implementation using HTTP/1.0, closing the socket after each http request.\n"
Expand Down Expand Up @@ -675,7 +675,6 @@ config_param config_params[] = {
copy_string,
print_string
},
#ifdef HAVE_FFMPEG
{
"ffmpeg_output_movies",
"\n############################################################\n"
Expand Down Expand Up @@ -765,20 +764,6 @@ config_param config_params[] = {
copy_bool,
print_bool
},
#endif /* HAVE_FFMPEG */
#ifdef HAVE_SDL
{
"sdl_threadnr",
"\n############################################################\n"
"# SDL Window\n"
"############################################################\n\n"
"# Number of motion thread to show in SDL Window (default: 0 = disabled)",
1,
CONF_OFFSET(sdl_threadnr),
copy_int,
print_int
},
#endif /* HAVE_SDL */
{
"use_extpipe",
"\n############################################################\n"
Expand All @@ -803,6 +788,19 @@ config_param config_params[] = {
print_string
},
{
"smooth_video",
"\n############################################################\n"
"# Normally, video is recorded as __precap+motion+postcap____\n"
"# This option changes the default behavior of the video \n"
"# capturing so that it is __precap+event-start-->event-end__ \n"
"############################################################\n"
"# Use smooth_video on to enable this feature. \n",
0,
CONF_OFFSET(smooth_video),
copy_bool,
print_bool
},
{
"snapshot_interval",
"\n############################################################\n"
"# Snapshots (Traditional Periodic Webcam File Output)\n"
Expand Down Expand Up @@ -959,7 +957,6 @@ config_param config_params[] = {
copy_string,
print_string
},
#ifdef HAVE_FFMPEG
{
"movie_filename",
"# File path for motion triggered ffmpeg films (movies) relative to target_dir\n"
Expand All @@ -985,7 +982,6 @@ config_param config_params[] = {
copy_string,
print_string
},
#endif /* HAVE_FFMPEG */
{
"ipv6_enabled",
"\n############################################################\n"
Expand Down Expand Up @@ -1338,7 +1334,6 @@ config_param config_params[] = {
copy_string,
print_string
},
#ifdef HAVE_FFMPEG
{
"on_movie_start",
"# Command to be executed when a movie file (.mpg|.avi) is created. (default: none)\n"
Expand All @@ -1357,7 +1352,6 @@ config_param config_params[] = {
copy_string,
print_string
},
#endif /* HAVE_FFMPEG */
{
"on_camera_lost",
"# Command to be executed when a camera can't be opened or if it is lost\n"
Expand All @@ -1370,132 +1364,6 @@ config_param config_params[] = {
print_string
},

#if defined(HAVE_MYSQL) || defined(HAVE_PGSQL) || defined(HAVE_SQLITE3)
{
"sql_log_picture",
"\n############################################################\n"
"# Common Options for database features.\n"
"# Options require the database options to be active also.\n"
"############################################################\n\n"
"# Log to the database when creating motion triggered image file (default: on)",
0,
CONF_OFFSET(sql_log_image),
copy_bool,
print_bool
},
{
"sql_log_snapshot",
"# Log to the database when creating a snapshot image file (default: on)",
0,
CONF_OFFSET(sql_log_snapshot),
copy_bool,
print_bool
},
{
"sql_log_movie",
"# Log to the database when creating motion triggered movie file (default: off)",
0,
CONF_OFFSET(sql_log_movie),
copy_bool,
print_bool
},
{
"sql_log_timelapse",
"# Log to the database when creating timelapse movie file (default: off)",
0,
CONF_OFFSET(sql_log_timelapse),
copy_bool,
print_bool
},
{
"sql_query",
"# SQL query string that is sent to the database\n"
"# Use same conversion specifiers has for text features\n"
"# Additional special conversion specifiers are\n"
"# %n = the number representing the file_type\n"
"# %f = filename with full path\n"
"# Create tables :\n"
"##\n"
"# Mysql\n"
"# CREATE TABLE security (camera int, filename char(80) not null, frame int, file_type int, time_stamp timestamp(14), event_time_stamp timestamp(14));\n"
"#\n"
"# Postgresql\n"
"# CREATE TABLE security (camera int, filename char(80) not null, frame int, file_type int, time_stamp timestamp without time zone, event_time_stamp timestamp without time zone);\n"
"#\n"
"# Default value:\n"
"# insert into security(camera, filename, frame, file_type, time_stamp, text_event) values('%t', '%f', '%q', '%n', '%Y-%m-%d %T', '%C')",
0,
CONF_OFFSET(sql_query),
copy_string,
print_string
},
{
"database_type",
"\n############################################################\n"
"# Database Options \n"
"############################################################\n\n"
"# database type : mysql, postgresql, sqlite3 (default : not defined)",
0,
CONF_OFFSET(database_type),
copy_string,
print_string
},
{
"database_dbname",
"# database to log to (default: not defined)",
0,
CONF_OFFSET(database_dbname),
copy_string,
print_string
},
{
"database_host",
"# The host on which the database is located (default: not defined)",
0,
CONF_OFFSET(database_host),
copy_string,
print_string
},
{
"database_user",
"# User account name for database (default: not defined)",
0,
CONF_OFFSET(database_user),
copy_string,
print_string
},
{
"database_password",
"# User password for database (default: not defined)",
0,
CONF_OFFSET(database_password),
copy_string,
print_string
},
{
"database_port",
"# Port on which the database is located (default: not defined)\n"
"# mysql 3306 , postgresql 5432 (default: not defined)",
0,
CONF_OFFSET(database_port),
copy_int,
print_int
},
#ifdef HAVE_SQLITE3
{
"sqlite3_db",
"\n############################################################\n"
"# Database Options For SQLite3\n"
"############################################################\n\n"
"# SQLite3 database to log to (default: not defined)",
0,
CONF_OFFSET(sqlite3_db),
copy_string,
print_string
},
#endif /* HAVE_SQLITE3 */

#endif /* defined(HAVE_MYSQL) || defined(HAVE_PGSQL) || defined(HAVE_SQLITE3) */
{
"video_pipe",
"\n############################################################\n"
Expand Down
3 changes: 3 additions & 0 deletions conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ struct config {
int norm;
int frame_limit;
int quiet;
int force_framerate;
int useextpipe; /* ext_pipe on or off */
int smooth_video;
const char *extpipe; /* full Command-line for pipe -- must accept YUV420P images */
const char *picture_type;
int noise;
Expand Down Expand Up @@ -120,6 +122,7 @@ struct config {
const char *motionvidpipe;
const char *netcam_url;
const char *netcam_userpass;
const char *netcam_cookie;
const char *netcam_keepalive;
const char *netcam_proxy;
unsigned int netcam_tolerant_check;
Expand Down
Loading