Motion - Config Option Sql Query

sql_query

  • Type: String
  • Range / Valid values: Max 4095 characters
  • Default: insert into security(camera, filename, frame, file_type, time_stamp, text_event) values('%t', '%f', '%q', '%n', '%Y-%m-%d %T', '%C')
  • Group: Database

SQL query string that is sent to the database. The values for each field are given by using convertion specifiers, SQL query string that is sent to the database. The values for each field are given by using convertion specifiers

Most common 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
  • %f = filename with full path
  • %n = number indicating filetype

Sample Query

insert into security(camera, filename, frame, file_type, time_stamp, text_event) values('%t', '%f', '%q', '%n', '%Y-%m-%d %T', '%C') insert or ignore into images (camera_nbr, file_name, year, month, day, hour, minute) values (8, '%f', '%Y','%m','%d','%H','%M')

The filetype is defined as bits in a binary number

Normal picture 1
Snapshot picture 2
Debug picture 4
Movie file 8
Debug Movie File 16
Timelapse 32
Topic revision: r5 - 07 Aug 2016, KennethLavrsen
Copyright © 1999-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Please do not email Kenneth for support questions (read why). Use the Support Requests page or join the Mailing List.
This website only use harmless session cookies. See Cookie Policy for details. By using this website you accept the use of these cookies.