Send Motion-user mailing list submissions to motion-user@lists.sourceforge.net
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 motion-user-requ...@lists.sourceforge.net You can reach the person managing the list at motion-user-ow...@lists.sourceforge.net When replying, please edit your Subject line so it is more specific than "Re: Contents of Motion-user digest..." Today's Topics: 1. Re: Database Tables? (Muzaffar Mahmood) 2. motion/movie start and end (Muzaffar Mahmood) ---------------------------------------------------------------------- Message: 1 Date: Fri, 20 Sep 2019 10:36:57 +0500 From: Muzaffar Mahmood <muzaffar.muhm...@gmail.com> To: Motion discussion list <motion-user@lists.sourceforge.net> Subject: Re: [Motion-user] Database Tables? Message-ID: <cagnofzzfcmzqan9p0315vdxnmd6ck4iogtw9xljntbnz0ff...@mail.gmail.com> Content-Type: text/plain; charset="utf-8" Ok thank you On Thu, Sep 19, 2019 at 4:56 PM David Powell <da...@depowell.com> wrote: > 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 < > muzaffar.muhm...@gmail.com> 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 >> Motion-user@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/motion-user >> https://motion-project.github.io/ >> >> Unsubscribe: https://lists.sourceforge.net/lists/options/motion-user >> > > _______________________________________________ > Motion-user mailing list > Motion-user@lists.sourceforge.net > 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... ------------------------------ Message: 2 Date: Fri, 20 Sep 2019 11:35:04 +0500 From: Muzaffar Mahmood <muzaffar.muhm...@gmail.com> To: Motion discussion list <motion-user@lists.sourceforge.net> Subject: [Motion-user] motion/movie start and end Message-ID: <cagnofzbtgv9fb2azzyg2jcssqewyhw9vxw_8n235grgdfd2...@mail.gmail.com> Content-Type: text/plain; charset="utf-8" Hi, I am to ask about on_event_start on_event_end on_movie_start on_movie_end configurations. Can we execute sql query on these like sql_query_start etc? On these we can give path of some script file it can be any script like php, python, perl or bash right? I want to save motion start time and motion end time in DB so what should be the best option or configuration for this? sql_query_stop(end of event) runs at-least one minute after sql_query_start(starting event) even though motion ends early. See in following logs. [1:ml1] [WRN] [DBL] [Sep 19 23:07:58] do_sql_query: Ignoring empty sql query [1:ml1] [NTC] [EVT] [Sep 19 23:07:58] event_newfile: File of type 8 saved to: value/0-01-20190919230758.mkv [1:ml1] [NTC] [ALL] [Sep 19 23:07:58] motion_detected: Motion detected - starting event 1 [1:ml1] [NTC] [ALL] [Sep 19 23:08:58] mlp_actions: End of event 1 [1:ml1] [WRN] [DBL] [Sep 19 23:10:11] do_sql_query: Ignoring empty sql query [1:ml1] [NTC] [EVT] [Sep 19 23:10:11] event_newfile: File of type 8 saved to: value/0-02-20190919231011.mkv [1:ml1] [NTC] [ALL] [Sep 19 23:10:11] motion_detected: Motion detected - starting event 2 [1:ml1] [NTC] [ALL] [Sep 19 23:11:11] mlp_actions: End of event 2 [1:ml1] [WRN] [DBL] [Sep 19 23:13:56] do_sql_query: Ignoring empty sql query [1:ml1] [NTC] [EVT] [Sep 19 23:13:56] event_newfile: File of type 8 saved to: value/0-03-20190919231356.mkv [1:ml1] [NTC] [ALL] [Sep 19 23:13:56] motion_detected: Motion detected - starting event 3 [1:ml1] [NTC] [ALL] [Sep 19 23:14:56] mlp_actions: End of event 3 [1:ml1] [WRN] [DBL] [Sep 19 23:15:23] do_sql_query: Ignoring empty sql query [1:ml1] [NTC] [EVT] [Sep 19 23:15:23] event_newfile: File of type 8 saved to: value/0-04-20190919231522.mkv [1:ml1] [NTC] [ALL] [Sep 19 23:15:23] motion_detected: Motion detected - starting event 4 [1:ml1] [NTC] [ALL] [Sep 19 23:16:23] mlp_actions: End of event 4 [1:ml1] [WRN] [DBL] [Sep 19 23:17:19] do_sql_query: Ignoring empty sql query [1:ml1] [NTC] [EVT] [Sep 19 23:17:19] event_newfile: File of type 8 saved to: value/0-05-20190919231719.mkv [1:ml1] [NTC] [ALL] [Sep 19 23:17:19] motion_detected: Motion detected - starting event 5 [1:ml1] [NTC] [ALL] [Sep 19 23:18:19] mlp_actions: End of event 5 [1:ml1] [WRN] [DBL] [Sep 19 23:18:26] do_sql_query: Ignoring empty sql query [1:ml1] [NTC] [EVT] [Sep 19 23:18:26] event_newfile: File of type 8 saved to: value/0-06-20190919231826.mkv [1:ml1] [NTC] [ALL] [Sep 19 23:18:26] motion_detected: Motion detected - starting event 6 [1:ml1] [NTC] [ALL] [Sep 19 23:19:26] mlp_actions: End of event 6 [1:ml1] [WRN] [DBL] [Sep 19 23:24:24] do_sql_query: Ignoring empty sql query [1:ml1] [NTC] [EVT] [Sep 19 23:24:24] event_newfile: File of type 8 saved to: value/0-07-20190919232424.mkv [1:ml1] [NTC] [ALL] [Sep 19 23:24:24] motion_detected: Motion detected - starting event 7 [1:ml1] [NTC] [ALL] [Sep 19 23:25:24] mlp_actions: End of event 7 [1:ml1] [WRN] [DBL] [Sep 19 23:27:12] do_sql_query: Ignoring empty sql query [1:ml1] [NTC] [EVT] [Sep 19 23:27:12] event_newfile: File of type 8 saved to: value/0-08-20190919232711.mkv [1:ml1] [NTC] [ALL] [Sep 19 23:27:12] motion_detected: Motion detected - starting event 8 [1:ml1] [NTC] [ALL] [Sep 19 23:28:12] mlp_actions: End of event 8 [1:ml1] [WRN] [DBL] [Sep 19 23:32:37] do_sql_query: Ignoring empty sql query [1:ml1] [NTC] [EVT] [Sep 19 23:32:37] event_newfile: File of type 8 saved to: value/0-09-20190919233236.mkv [1:ml1] [NTC] [ALL] [Sep 19 23:32:37] motion_detected: Motion detected - starting event 9 [1:ml1] [NTC] [ALL] [Sep 19 23:33:37] mlp_actions: End of event 9 [1:ml1] [WRN] [DBL] [Sep 19 23:33:39] do_sql_query: Ignoring empty sql query [1:ml1] [NTC] [EVT] [Sep 19 23:33:39] event_newfile: File of type 8 saved to: value/0-10-20190919233339.mkv [1:ml1] [NTC] [ALL] [Sep 19 23:33:39] motion_detected: Motion detected - starting event 10 [1:ml1] [NTC] [ALL] [Sep 19 23:34:39] mlp_actions: End of event 10 [1:ml1] [WRN] [DBL] [Sep 19 23:34:41] do_sql_query: Ignoring empty sql query [1:ml1] [NTC] [EVT] [Sep 19 23:34:41] event_newfile: File of type 8 saved to: value/0-11-20190919233441.mkv [1:ml1] [NTC] [ALL] [Sep 19 23:34:41] motion_detected: Motion detected - starting event 11 [1:ml1] [NTC] [ALL] [Sep 19 23:35:41] mlp_actions: End of event 11 [1:ml1] [WRN] [DBL] [Sep 19 23:35:41] do_sql_query: Ignoring empty sql query [1:ml1] [NTC] [EVT] [Sep 19 23:35:41] event_newfile: File of type 8 saved to: value/0-12-20190919233540.mkv [1:ml1] [NTC] [ALL] [Sep 19 23:35:41] motion_detected: Motion detected - starting event 12 [1:ml1] [NTC] [ALL] [Sep 19 23:36:41] mlp_actions: End of event 12 Thanks -------------- next part -------------- An HTML attachment was scrubbed... ------------------------------ ------------------------------ Subject: Digest Footer _______________________________________________ Motion-user mailing list Motion-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/motion-user ------------------------------ End of Motion-user Digest, Vol 159, Issue 16 ********************************************