]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
Motion tuning (don't run as root, backup include, config...)
authorArne Fitzenreiter <arne_f@ipfire.org>
Tue, 7 Jul 2009 21:07:20 +0000 (23:07 +0200)
committerArne Fitzenreiter <arne_f@ipfire.org>
Tue, 7 Jul 2009 21:07:20 +0000 (23:07 +0200)
config/backup/includes/motion [new file with mode: 0644]
config/motion/motion.conf
config/rootfiles/packages/motion
lfs/motion
src/initscripts/init.d/motion
src/paks/motion/install.sh [new file with mode: 0644]
src/paks/motion/uninstall.sh [new file with mode: 0644]
src/paks/motion/update.sh [new file with mode: 0644]

diff --git a/config/backup/includes/motion b/config/backup/includes/motion
new file mode 100644 (file)
index 0000000..79652aa
--- /dev/null
@@ -0,0 +1 @@
+/etc/motion.conf
index 4d8777279d0a78d424c1b21b448bda3a9371a05a..a97762cc57df0eecbdba05e65c91100c1d1036f7 100644 (file)
@@ -109,13 +109,13 @@ netcam_tolerant_check off
 # The auto_brightness feature uses the brightness option as its target value.
 # If brightness is zero auto_brightness will adjust to average brightness value 128.
 # Only recommended for cameras without auto brightness
 # The auto_brightness feature uses the brightness option as its target value.
 # If brightness is zero auto_brightness will adjust to average brightness value 128.
 # Only recommended for cameras without auto brightness
-auto_brightness off
+auto_brightness on
 
 # Set the initial brightness of a video device.
 # If auto_brightness is enabled, this value defines the average brightness level
 # which Motion will try and adjust to.
 # Valid range 0-255, default 0 = disabled
 
 # Set the initial brightness of a video device.
 # If auto_brightness is enabled, this value defines the average brightness level
 # which Motion will try and adjust to.
 # Valid range 0-255, default 0 = disabled
-brightness 0
+brightness 128
 
 # Set the contrast of a video device.
 # Valid range 0-255, default 0 = disabled
 
 # Set the contrast of a video device.
 # Valid range 0-255, default 0 = disabled
@@ -195,20 +195,20 @@ minimum_motion_frames 1
 # Recommended range: 0 to 5 (default: 0)
 # Do not use large values! Large values will cause Motion to skip video frames and
 # cause unsmooth mpegs. To smooth mpegs use larger values of post_capture instead.
 # Recommended range: 0 to 5 (default: 0)
 # Do not use large values! Large values will cause Motion to skip video frames and
 # cause unsmooth mpegs. To smooth mpegs use larger values of post_capture instead.
-pre_capture 0
+pre_capture 5
 
 # Number of frames to capture after motion is no longer detected (default: 0)
 
 # Number of frames to capture after motion is no longer detected (default: 0)
-post_capture 0
+post_capture 5
 
 # Gap is the seconds of no motion detection that triggers the end of an event
 # An event is defined as a series of motion images taken within a short timeframe.
 # Recommended value is 60 seconds (Default). The value 0 is allowed and disables
 # events causing all Motion to be written to one single mpeg file and no pre_capture.
 
 # Gap is the seconds of no motion detection that triggers the end of an event
 # An event is defined as a series of motion images taken within a short timeframe.
 # Recommended value is 60 seconds (Default). The value 0 is allowed and disables
 # events causing all Motion to be written to one single mpeg file and no pre_capture.
-gap 60
+gap 0
 
 # Maximum length in seconds of an mpeg movie
 # When value is exceeded a new mpeg file is created. (Default: 0 = infinite)
 
 # Maximum length in seconds of an mpeg movie
 # When value is exceeded a new mpeg file is created. (Default: 0 = infinite)
-max_mpeg_time 0
+max_mpeg_time 86400
 
 # Always save images even if there was no motion (default: off)
 output_all off
 
 # Always save images even if there was no motion (default: off)
 output_all off
@@ -279,7 +279,7 @@ ffmpeg_variable_bitrate 0
 # flv - gives you a flash video with extension .flv
 # ffv1 - FF video codec 1 for Lossless Encoding ( experimental )
 # mov - QuickTime ( testing )
 # flv - gives you a flash video with extension .flv
 # ffv1 - FF video codec 1 for Lossless Encoding ( experimental )
 # mov - QuickTime ( testing )
-ffmpeg_video_codec mpeg4
+ffmpeg_video_codec msmpeg4
 
 # Use ffmpeg to deinterlace video. Necessary if you use an analog camera
 # and see horizontal combing on moving objects in video or pictures.
 
 # Use ffmpeg to deinterlace video. Necessary if you use an analog camera
 # and see horizontal combing on moving objects in video or pictures.
@@ -321,7 +321,7 @@ text_right %Y-%m-%d\n%T-%q
 # Draw a user defined text on the images using same options as C function strftime(3)
 # Default: Not defined = no text
 # Text is placed in lower left corner
 # Draw a user defined text on the images using same options as C function strftime(3)
 # Default: Not defined = no text
 # Text is placed in lower left corner
-; text_left CAMERA %t
+text_left CAMERA %t\nhttp://nwww.ipfire.org
 
 # Draw the number of changed pixed on the images (default: off)
 # Will normally be set to off except when you setup and adjust the motion settings
 
 # Draw the number of changed pixed on the images (default: off)
 # Will normally be set to off except when you setup and adjust the motion settings
@@ -356,7 +356,7 @@ text_double off
 
 # Target base directory for pictures and films
 # Recommended to use absolute path. (Default: current working directory)
 
 # Target base directory for pictures and films
 # Recommended to use absolute path. (Default: current working directory)
-target_dir /srv/motion/cam1
+target_dir /var/motion/cam1
 
 # File path for snapshots (jpeg or ppm) relative to target_dir
 # Default: %v-%Y%m%d%H%M%S-snapshot
 
 # File path for snapshots (jpeg or ppm) relative to target_dir
 # Default: %v-%Y%m%d%H%M%S-snapshot
@@ -397,7 +397,7 @@ timelapse_filename %Y%m%d-timelapse
 ############################################################
 
 # The mini-http server listens to this port for requests (default: 0 = disabled)
 ############################################################
 
 # The mini-http server listens to this port for requests (default: 0 = disabled)
-webcam_port 36000
+webcam_port 2500
 
 # Quality of the jpeg images produced (default: 50)
 webcam_quality 75
 
 # Quality of the jpeg images produced (default: 50)
 webcam_quality 75
index d3a6785003bc031113fb4aa924945c1beb6fd1c3..3e1c3f5fc93de98464b7864d220bb98e125886ff 100644 (file)
@@ -4,7 +4,7 @@ etc/rc.d/init.d/motion
 etc/rc.d/rc0.d/K01motion
 etc/rc.d/rc6.d/K01motion
 etc/rc.d/rc3.d/S99motion
 etc/rc.d/rc0.d/K01motion
 etc/rc.d/rc6.d/K01motion
 etc/rc.d/rc3.d/S99motion
-srv/motion/cam1/info
+var/ipfire/backup/addons/includes/motion
 #usr/share/doc/motion-3.2.11
 #usr/share/doc/motion-3.2.11/CHANGELOG
 #usr/share/doc/motion-3.2.11/COPYING
 #usr/share/doc/motion-3.2.11
 #usr/share/doc/motion-3.2.11/CHANGELOG
 #usr/share/doc/motion-3.2.11/COPYING
index d6d0bcc90cd0c3e1ad647995a29e2c98aedea8bc..d42abaf0ae9126e3f22266ee315f3ed6ccddb488 100644 (file)
@@ -81,7 +81,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        cd $(DIR_APP) && make $(MAKETUNING)
        cd $(DIR_APP) && make install
        cp -vf $(DIR_SRC)/config/motion/motion.conf /etc
        cd $(DIR_APP) && make $(MAKETUNING)
        cd $(DIR_APP) && make install
        cp -vf $(DIR_SRC)/config/motion/motion.conf /etc
-       mkdir -pv /srv/motion/cam1
-       echo Folder for cam1 images > /srv/motion/cam1/info
+       install -v -m 644 $(DIR_SRC)/config/backup/includes/motion \
+                        /var/ipfire/backup/addons/includes/motion
        @rm -rf $(DIR_APP)
        @$(POSTBUILD)
        @rm -rf $(DIR_APP)
        @$(POSTBUILD)
index 78633f21d407313e9cff17e87c6a9e8aefa76b55..642272c1449119b9fdd25aa3ae2e339a62e7dad7 100644 (file)
@@ -6,7 +6,10 @@
 case "$1" in
        start)
                boot_mesg "Starting motion webcam server..."
 case "$1" in
        start)
                boot_mesg "Starting motion webcam server..."
-               loadproc /usr/bin/motion
+               chown :video /dev/video*
+               mkdir -p /var/motion/cam1
+               chown -R video: /var/motion/cam1
+               loadproc sudo -u video /usr/bin/motion
                ;;
 
        stop)
                ;;
 
        stop)
diff --git a/src/paks/motion/install.sh b/src/paks/motion/install.sh
new file mode 100644 (file)
index 0000000..f9c2000
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/bash
+############################################################################
+#                                                                          #
+# This file is part of the IPFire Firewall.                                #
+#                                                                          #
+# IPFire is free software; you can redistribute it and/or modify           #
+# it under the terms of the GNU General Public License as published by     #
+# the Free Software Foundation; either version 2 of the License, or        #
+# (at your option) any later version.                                      #
+#                                                                          #
+# IPFire is distributed in the hope that it will be useful,                #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of           #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            #
+# GNU General Public License for more details.                             #
+#                                                                          #
+# You should have received a copy of the GNU General Public License        #
+# along with IPFire; if not, write to the Free Software                    #
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA #
+#                                                                          #
+# Copyright (C) 2007 IPFire-Team <info@ipfire.org>.                        #
+#                                                                          #
+############################################################################
+#
+. /opt/pakfire/lib/functions.sh
+extract_files
+restore_backup ${NAME}
+useradd -s /bin/false video
diff --git a/src/paks/motion/uninstall.sh b/src/paks/motion/uninstall.sh
new file mode 100644 (file)
index 0000000..66f4344
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/bash
+############################################################################
+#                                                                          #
+# This file is part of the IPFire Firewall.                                #
+#                                                                          #
+# IPFire is free software; you can redistribute it and/or modify           #
+# it under the terms of the GNU General Public License as published by     #
+# the Free Software Foundation; either version 2 of the License, or        #
+# (at your option) any later version.                                      #
+#                                                                          #
+# IPFire is distributed in the hope that it will be useful,                #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of           #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            #
+# GNU General Public License for more details.                             #
+#                                                                          #
+# You should have received a copy of the GNU General Public License        #
+# along with IPFire; if not, write to the Free Software                    #
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA #
+#                                                                          #
+# Copyright (C) 2007 IPFire-Team <info@ipfire.org>.                        #
+#                                                                          #
+############################################################################
+#
+. /opt/pakfire/lib/functions.sh
+make_backup ${NAME}
+remove_files
diff --git a/src/paks/motion/update.sh b/src/paks/motion/update.sh
new file mode 100644 (file)
index 0000000..89c40d0
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/bash
+############################################################################
+#                                                                          #
+# This file is part of the IPFire Firewall.                                #
+#                                                                          #
+# IPFire is free software; you can redistribute it and/or modify           #
+# it under the terms of the GNU General Public License as published by     #
+# the Free Software Foundation; either version 2 of the License, or        #
+# (at your option) any later version.                                      #
+#                                                                          #
+# IPFire is distributed in the hope that it will be useful,                #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of           #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            #
+# GNU General Public License for more details.                             #
+#                                                                          #
+# You should have received a copy of the GNU General Public License        #
+# along with IPFire; if not, write to the Free Software                    #
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA #
+#                                                                          #
+# Copyright (C) 2007 IPFire-Team <info@ipfire.org>.                        #
+#                                                                          #
+############################################################################
+#
+. /opt/pakfire/lib/functions.sh
+./uninstall.sh
+./install.sh