@@ -141,6 +141,84 @@ <h3><a name="ffmpeg_input_device"></a>Use ffmpeg as input device</h3>
141141 < code > ffmpeg -re -i mymovie.mp4 -f v4l2 -pix_fmt gray /dev/video0 </ code >
142142 </ ul >
143143
144+ < h3 > < a name ="database_setup "> </ a > Database Setup</ h3 >
145+ < ul >
146+ If a database is specified in the MotionPlus configuration, upon start up, MotionPlus will check for a table in
147+ the database called "motionplus" and if it is not found, it will create it. This MotionPlus specific table is
148+ required so that movies can be displayed on the webcontrol page. It tracks the movies created by MotionPlus along
149+ with the various metadata about the movies. The following is a brief overview of how to create a simple database
150+ and specify it within the MotionPlus parameters so recordings can be downloaded from the webcontrol.
151+ < ul >
152+ < div >
153+ < i > < h4 > sqlite3</ h4 > </ i >
154+ This database type is by far the easiest to set up since it is file based. Simply provide the
155+ parameters in the MotionPlus configuration parameters
156+ < ul >
157+ < small > < small > < code >
158+ database_type sqlite3
159+ < br > database_dbname /full/path/and/file/name.db
160+ </ code > </ small > </ small >
161+ </ ul >
162+ While this is the easiest to set up, it has also been observed that it can at times be unstable. This
163+ is especially true if the database file is included as part of a archive process while in use by MotionPlus.
164+ </ div >
165+ < p > </ p >
166+
167+ < div >
168+ < i > < h4 > mariadb</ h4 > </ i >
169+ The following describes the process to set up a Mariadb database. If your machine already has a Mariadb database,
170+ adjust as appropriate to the situation that exists on your computer. Those with more experience with MariaDb are
171+ invited to provide suggestions and corrections to these steps.
172+ < small > < small > < code >
173+ < ul >
174+ sudo apt install libmariadb-dev libmariadb3 mariadb-client-10.5 mariadb-client-core-10.5 mariadb-common mariadb-server
175+ < br > sudo mariadb
176+ < ul >
177+ GRANT ALL ON *.* TO 'YourUserNameHere'@'localhost' IDENTIFIED BY 'YourPasswordHere' WITH GRANT OPTION;
178+ < br > FLUSH PRIVILEGES;
179+ < br > exit
180+ </ ul >
181+ mariadb -u YourUserNameHere -p
182+ < ul >
183+ {enter YourPasswordHere}
184+ < br > create database motionplus;
185+ < br > use motionplus;
186+ < br > quit;
187+ </ ul >
188+ </ code > </ small > </ small >
189+ </ ul >
190+
191+ Once the database is set up, check the status of Mariadb via systemctl.
192+ < ul >
193+ < small > < small > < code >
194+ sudo systemctl status mariadb
195+ </ code > </ small > </ small >
196+ </ ul >
197+
198+ Specify the following in the MotionPlus configuration parameters.
199+ < ul >
200+ < small > < small > < code >
201+ database_type mariadb
202+ < br > database_dbname motionplus
203+ < br > database_host localhost
204+ < br > database_port 3306
205+ < br > database_user YourUserNameHere
206+ < br > database_password YourPasswordHere
207+ </ code > </ small > </ small >
208+ </ ul >
209+ </ div >
210+ < p > </ p >
211+
212+ < div >
213+ < i > < h4 > pgsql</ h4 > </ i >
214+ ToDo
215+ < p > </ p >
216+
217+
218+ </ ul >
219+
220+ </ ul >
221+
144222 < h3 > < a name ="webcontrol_pages "> </ a > Webcontrol pages</ h3 >
145223 < ul >
146224 < li > < code > {IP}:{port0}/</ code > Home html page with streams for all cameras</ li >
0 commit comments