Motion - Support Question 2006x 12x 22x 171343

motion stops logging to mysql after a while

Question

I have installed motion from SVN today( 3.2.8 ). motion.conf is configured to log events to mysql. The problem is that after a few hours motion is still running and saving images and movies as it should, but it stops writing to the db ( mysql is still running ). If i stop and run motion again it works for a few hours then it stops writing to mysql again.

I'm running Debian with kernel 2.6.17 recompiled by me.

Attatched see my motion.conf

# Minimal motion example config file provided by the
# Debian motion package - for basic webcam operation.
#
# You most certainly want to investigate
# /usr/share/doc/motion/examples/motion-dist.conf.gz
# for further configuration options. Also, refer to the
# motion man page and /usr/share/doc/motion/motion_guide.html
# for detailed information on configuration options.

daemon on
quiet on

# You may very well need to change this (check with 'dmesg'
# after plugging in your webcam).
# videodevice /dev/video0

# Image size in pixels (valid range is camera dependent).
#width 320
#height 240

#low_cpu 20
pre_capture 2
post_capture 20
framerate 25
quality 85
auto_brightness off

# General threshold level and noise threshold
# level (for distinguishing between noise and motion).
threshold 4500
noise_level 64

# Initial brightness, contrast, hue (NTSC), and saturation.
# 0 = disabled (valid range 0-255).
brightness 0
contrast 0
saturation 0
hue 0

output_normal first

# COMMENTARE PER DISATTIVARE ALLARME
#on_event_start /usr/local/etc/alarm/alarm.sh


# Encode movies in real-time (install ffmpeg before enabling).
ffmpeg_cap_new on

# Codec to be used by ffmpeg for the video compression.
# Supported formats: mpeg4, msmpeg4.
ffmpeg_video_codec msmpeg4

# Target base directory for pictures and films (you may need
# to change this (or change its permissions) depending on
# which system user runs motion).
target_dir /var/lib/motion/snapshots

# Define a port number (e.g. 8000) to enable the mini-http server.
# 0 = disabled.
webcam_port 8000

# Set to 'off' to allow anybody (not just localhost) to view the
# webcam via the mini-http server (http://hostname:port).
webcam_localhost on

webcam_quality 50
webcam_maxrate 8

#movie filename %v-%Y%m%d%H%M%S

############################################################
# Common Options For MySQL and PostgreSQL database features.
# Options require the MySQL/PostgreSQL options to be active also.
############################################################

# Log to the database when creating motion triggered image file  (default: on)
sql_log_image 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 mpeg file (default: off)
sql_log_mpeg on

# Log to the database when creating timelapse mpeg 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:
# insert into security(camera, filename, frame, file_type, time_stamp, text_event) values('%t', '%f', '%q', '%n', '%Y-%m-%d %T', '%C')
#sql_query 

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')




mysql_db motion
mysql_host localhost
mysql_user motion
mysql_password motion

thread /usr/local/etc/thread1.conf
thread /usr/local/etc/thread2.conf

-----------------------------------------------------


mysql> select * from security;
+--------+----------------------------------------------------+-------+-----------+---------------------+------------+------------------+----+
| camera | filename                                           | frame | file_type | time_stamp          | text_event | event_time_stamp | id |
+--------+----------------------------------------------------+-------+-----------+---------------------+------------+------------------+----+
| 1      | /var/lib/motion/snapshots/02-20061222174953.avi    | 05    | 8         | 2006-12-22 17:49:53 | NULL       | 20061222174953   | 81 |
| 1      | /var/lib/motion/snapshots/02-20061222174953-05.jpg | 05    | 1         | 2006-12-22 17:49:53 | NULL       | 20061222174953   | 82 |
| 2      | /var/lib/motion/snapshots/01-20061222180711.avi    | 00    | 8         | 2006-12-22 18:07:11 | NULL       | 20061222180711   | 83 |
| 2      | /var/lib/motion/snapshots/01-20061222180711-00.jpg | 00    | 1         | 2006-12-22 18:07:11 | NULL       | 20061222180711   | 84 |
| 1      | /var/lib/motion/snapshots/01-20061222182208.avi    | 12    | 8         | 2006-12-22 18:22:08 | NULL       | 20061222182208   | 85 |
| 1      | /var/lib/motion/snapshots/01-20061222182208-12.jpg | 12    | 1         | 2006-12-22 18:22:08 | NULL       | 20061222182208   | 86 |
+--------+----------------------------------------------------+-------+-----------+---------------------+------------+------------------+----+
6 rows in set (0.00 sec)

Environment

Motion version: 3.2.8
ffmpeg version:  
Libraries: ffmpeg, mysql, postgresql
Server OS: Linux

-- TommasoCalosi - 22 Dec 2006

Follow Up

I tried to reproduce your problem , but i cannot .

I've been running motion more that 2 days without any problem , i used the same motion.conf that you use in debian sarge with kernel 2.6.19.

Please give some more detailed information ( motion logs , mysql logs ).

-- AngelCarpintero - 25 Dec 2006

Answer

The problem could be the same that happens in this bug report :

http://www.lavrsen.dk/twiki/bin/view/Motion/BugReport2006x10x10x081903

Please update to svn version and try to reproduce your problem, reopen the support question or file a new bug report.

-- AngelCarpintero - 09 Jan 2007
Topic revision: r3 - 09 Jan 2007, AngelCarpintero
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.