Send Motion-user mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.sourceforge.net/lists/listinfo/motion-user
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Motion-user digest..."
Today's Topics:
1. Database Tables? (Muzaffar Mahmood)
2. Re: Database Tables? (David Powell)
----------------------------------------------------------------------
Message: 1
Date: Thu, 19 Sep 2019 11:20:42 +0500
From: Muzaffar Mahmood <[email protected]>
To: [email protected]
Subject: [Motion-user] Database Tables?
Message-ID:
<CAGnoFzZApgoV9sQ9tMpUPaV-jVLaKcKp8eX7p_iaSr+qt=e...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Hi,
I added following configurations for database logging but there are not
tables created yet although motion movie files are being generated and
their events are being logged in log file. Should i create tables itself
or i am to create tables myself? Some log content about db is this:
*Log:*
[1:ml1] [NTC] [DBL] [Sep 18 22:43:28] dbse_init: Database backend mysql
[1:ml1] [NTC] [ALL] [Sep 18 22:43:28] image_ring_resize: Resizing
pre_capture buffer to 4 items
[1:ml1] [WRN] [DBL] [Sep 18 22:43:57] do_sql_query: Ignoring empty sql query
[1:ml1] [NTC] [EVT] Above message repeats 1 times
[1:ml1] [NTC] [EVT] [Sep 18 22:43:57] event_newfile: File of type 8 saved
to: value/0-01-20190918224357.mkv
[1:ml1] [NTC] [ALL] [Sep 18 22:43:57] motion_detected: Motion detected -
starting event 1
[1:ml1] [WRN] [DBL] [Sep 18 22:44:57] do_sql_query: Ignoring empty sql query
[1:ml1] [NTC] [ALL] [Sep 18 22:44:57] mlp_actions: End of event 1
[1:ml1] [WRN] [DBL] [Sep 18 22:45:07] do_sql_query: Ignoring empty sql query
[1:ml1] [NTC] [EVT] Above message repeats 1 times
[1:ml1] [NTC] [EVT] [Sep 18 22:45:07] event_newfile: File of type 8 saved
to: value/0-02-20190918224507.mkv
[1:ml1] [NTC] [ALL] [Sep 18 22:45:07] motion_detected: Motion detected -
starting event 2
[1:ml1] [WRN] [DBL] [Sep 18 22:46:07] do_sql_query: Ignoring empty sql query
[1:ml1] [NTC] [ALL] [Sep 18 22:46:07] mlp_actions: End of event 2
[1:ml1] [WRN] [DBL] [Sep 18 22:46:39] do_sql_query: Ignoring empty sql query
[1:ml1] [NTC] [EVT] Above message repeats 1 times
[1:ml1] [NTC] [EVT] [Sep 18 22:46:39] event_newfile: File of type 8 saved
to: value/0-03-20190918224639.mkv
[1:ml1] [NTC] [ALL] [Sep 18 22:46:39] motion_detected: Motion detected -
starting event 3
[1:ml1] [WRN] [DBL] [Sep 18 22:47:39] do_sql_query: Ignoring empty sql query
[1:ml1] [NTC] [ALL] [Sep 18 22:47:39] mlp_actions: End of event 3
[1:ml1] [WRN] [DBL] [Sep 18 22:47:43] do_sql_query: Ignoring empty sql query
[1:ml1] [NTC] [EVT] Above message repeats 1 times
[1:ml1] [NTC] [EVT] [Sep 18 22:47:43] event_newfile: File of type 8 saved
to: value/0-04-20190918224743.mkv
*---------------------------------------------------------------------------------------------------------*
*Configurations:*
#####################################################################
# Common Options for database features.
# Options require database options to be active also.
#####################################################################
# Log to the database when creating motion triggered picture file
(default: on)
sql_log_picture on
# Log to the database when creating a snapshot image file (default: on)
sql_log_snapshot on
# Log to the database when creating motion triggered movie file (default:
off)
sql_log_movie on
# Log to the database when creating timelapse movies file (default: off)
sql_log_timelapse on
# SQL query string that is sent to the database
# Use same conversion specifiers has for text features
# Additional special conversion specifiers are
# %n = the number representing the file_type
# %f = filename with full path
# Default value:
# Create tables :
##
# Mysql
# CREATE TABLE security (camera int, filename char(80) not null, frame int,
file_type int, time_stamp timestamp(14), event_time_stamp timestamp(14));
#
# Postgresql
# 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);
#
# 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
############################################################
# database type : mysql, postgresql, sqlite3 (default : not defined)
database_type mysql
# database to log to (default: not defined)
# for sqlite3, the full path and name for the database.
database_dbname motion_db
# The host on which the database is located (default: localhost)
database_host localhost
# User account name for database (default: not defined)
database_user root
# User password for database (default: not defined)
database_password admin
# Port on which the database is located
# mysql 3306 , postgresql 5432 (default: not defined)
database_port 3306
# Database wait time in milliseconds for locked database to
# be unlocked before returning database locked error (default 0)
database_busy_timeout 10000
Thanks & Regards
Muzaffar Mahmood
-------------- next part --------------
An HTML attachment was scrubbed...
------------------------------
Message: 2
Date: Thu, 19 Sep 2019 06:55:27 -0500
From: David Powell <[email protected]>
To: Motion discussion list <[email protected]>
Subject: Re: [Motion-user] Database Tables?
Message-ID:
<[email protected]>
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
You have to create and set up the database. All Motion will do is run the
query you specify when an event occurs.
On September 19, 2019 1:28:11 AM Muzaffar Mahmood
<[email protected]> wrote:
> Hi,
>
>
> I added following configurations for database logging but there are not
> tables created yet although motion movie files are being generated and
> their events are being logged in log file. Should i create tables itself
> or i am to create tables myself? Some log content about db is this:
> Log:
>
>
> [1:ml1] [NTC] [DBL] [Sep 18 22:43:28] dbse_init: Database backend mysql
> [1:ml1] [NTC] [ALL] [Sep 18 22:43:28] image_ring_resize: Resizing
> pre_capture buffer to 4 items
> [1:ml1] [WRN] [DBL] [Sep 18 22:43:57] do_sql_query: Ignoring empty sql query
> [1:ml1] [NTC] [EVT] Above message repeats 1 times
> [1:ml1] [NTC] [EVT] [Sep 18 22:43:57] event_newfile: File of type 8 saved
> to: value/0-01-20190918224357.mkv
> [1:ml1] [NTC] [ALL] [Sep 18 22:43:57] motion_detected: Motion detected -
> starting event 1
> [1:ml1] [WRN] [DBL] [Sep 18 22:44:57] do_sql_query: Ignoring empty sql query
> [1:ml1] [NTC] [ALL] [Sep 18 22:44:57] mlp_actions: End of event 1
> [1:ml1] [WRN] [DBL] [Sep 18 22:45:07] do_sql_query: Ignoring empty sql query
> [1:ml1] [NTC] [EVT] Above message repeats 1 times
> [1:ml1] [NTC] [EVT] [Sep 18 22:45:07] event_newfile: File of type 8 saved
> to: value/0-02-20190918224507.mkv
> [1:ml1] [NTC] [ALL] [Sep 18 22:45:07] motion_detected: Motion detected -
> starting event 2
> [1:ml1] [WRN] [DBL] [Sep 18 22:46:07] do_sql_query: Ignoring empty sql query
> [1:ml1] [NTC] [ALL] [Sep 18 22:46:07] mlp_actions: End of event 2
> [1:ml1] [WRN] [DBL] [Sep 18 22:46:39] do_sql_query: Ignoring empty sql query
> [1:ml1] [NTC] [EVT] Above message repeats 1 times
> [1:ml1] [NTC] [EVT] [Sep 18 22:46:39] event_newfile: File of type 8 saved
> to: value/0-03-20190918224639.mkv
> [1:ml1] [NTC] [ALL] [Sep 18 22:46:39] motion_detected: Motion detected -
> starting event 3
> [1:ml1] [WRN] [DBL] [Sep 18 22:47:39] do_sql_query: Ignoring empty sql query
> [1:ml1] [NTC] [ALL] [Sep 18 22:47:39] mlp_actions: End of event 3
> [1:ml1] [WRN] [DBL] [Sep 18 22:47:43] do_sql_query: Ignoring empty sql query
> [1:ml1] [NTC] [EVT] Above message repeats 1 times
> [1:ml1] [NTC] [EVT] [Sep 18 22:47:43] event_newfile: File of type 8 saved
> to: value/0-04-20190918224743.mkv
>
> ---------------------------------------------------------------------------------------------------------
>
>
> Configurations:
> #####################################################################
> # Common Options for database features.
> # Options require database options to be active also.
> #####################################################################
>
> # Log to the database when creating motion triggered picture file
> (default: on)
> sql_log_picture on
>
> # Log to the database when creating a snapshot image file (default: on)
> sql_log_snapshot on
>
> # Log to the database when creating motion triggered movie file (default: off)
> sql_log_movie on
>
> # Log to the database when creating timelapse movies file (default: off)
> sql_log_timelapse on
>
> # SQL query string that is sent to the database
> # Use same conversion specifiers has for text features
> # Additional special conversion specifiers are
> # %n = the number representing the file_type
> # %f = filename with full path
> # Default value:
> # Create tables :
> ##
> # Mysql
> # CREATE TABLE security (camera int, filename char(80) not null, frame int,
> file_type int, time_stamp timestamp(14), event_time_stamp timestamp(14));
> #
> # Postgresql
> # 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);
> #
> # 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
> ############################################################
>
> # database type : mysql, postgresql, sqlite3 (default : not defined)
> database_type mysql
>
> # database to log to (default: not defined)
> # for sqlite3, the full path and name for the database.
> database_dbname motion_db
>
> # The host on which the database is located (default: localhost)
> database_host localhost
>
> # User account name for database (default: not defined)
> database_user root
>
> # User password for database (default: not defined)
> database_password admin
>
> # Port on which the database is located
> # mysql 3306 , postgresql 5432 (default: not defined)
> database_port 3306
>
> # Database wait time in milliseconds for locked database to
> # be unlocked before returning database locked error (default 0)
> database_busy_timeout 10000
>
>
> Thanks & Regards
> Muzaffar Mahmood
>
>
> _______________________________________________
> Motion-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/motion-user
> https://motion-project.github.io/
>
>
> Unsubscribe: https://lists.sourceforge.net/lists/options/motion-user
-------------- next part --------------
An HTML attachment was scrubbed...
------------------------------
------------------------------
Subject: Digest Footer
_______________________________________________
Motion-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/motion-user
------------------------------
End of Motion-user Digest, Vol 159, Issue 15
********************************************