diff --git a/CHANGELOG b/CHANGELOG index 8d417014..73ee7f97 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -19,6 +19,7 @@ Features * Split locate_motion into separate 'mode' and 'style' option to allow all possible combinations. (Joerg Weber) * Get rid of ffmpeg-config in configure.in for debian. (Angel Carpintero) + * Implement 'gapless' event mode to allow for recording of movies without 'holes'. (Joerg Weber) Bugfixes * Fix Problem Encoding 1280x1024 resolution videos diff --git a/CREDITS b/CREDITS index ba073b86..488847cb 100644 --- a/CREDITS +++ b/CREDITS @@ -1382,7 +1382,8 @@ Joerg Weber * Add draw a RED box around the movement as default. * Split locate_motion into separate 'mode' and 'style' option to allow all possible combinations. - + * Gapless_event mode. + Dirk Wesenberg * Track pan/tilt support for uvcvideo ( Michal Licko ,Dirk Wesenberg and Angel Carpintero ) http://www.lavrsen.dk/twiki/bin/view/Motion/LinuxUvcTrackingPatch diff --git a/motion-dist.conf.in b/motion-dist.conf.in index 18fc41b2..63403ea1 100644 --- a/motion-dist.conf.in +++ b/motion-dist.conf.in @@ -202,8 +202,10 @@ post_capture 0 # Event 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 movie file and no pre_capture. +# Recommended value is 60 seconds (Default). A value of 0 allows to generate 'gapless' +# movies - an event ends right after post_capture if any. The value -1 is allowed and +# disables events causing all Motion to be written to one single movie file and no +# pre_capture. event_gap 60 # Maximum length in seconds of a movie diff --git a/motion.c b/motion.c index fb0178b4..24c8b8d9 100644 --- a/motion.c +++ b/motion.c @@ -1418,6 +1418,8 @@ static void *motion_loop(void *arg) if (cnt->conf.despeckle_filter && cnt->current_image->diffs > 0) { olddiffs = cnt->current_image->diffs; cnt->current_image->diffs = alg_despeckle(cnt, olddiffs); + if (cnt->current_image->diffs > cnt->threshold) //jw + motion_log(LOG_DEBUG, 0, "Labels: %d Diffs: %d", cnt->current_image->total_labels, cnt->current_image->diffs); //jw } else if (cnt->imgs.labelsize_max) { cnt->imgs.labelsize_max = 0; /* Disable labeling if enabled */ } @@ -1497,6 +1499,9 @@ static void *motion_loop(void *arg) alg_update_reference_frame(cnt, RESET_REF_FRAME); cnt->current_image->diffs = 0; cnt->lightswitch_framecounter = 0; + motion_log(LOG_INFO, 0, "lightswitch_framecounter: %d previous_diffs: %d diffs: %d location.x: %d location.y: %d", + cnt->lightswitch_framecounter, previous_diffs, cnt->current_image->diffs, + cnt->current_image->location.x, cnt->current_image->location.y); //jw if (debug_level >= CAMERA_DEBUG) motion_log(-1, 0, "%s: micro-lightswitch!", __FUNCTION__); @@ -1654,6 +1659,9 @@ static void *motion_loop(void *arg) } else { /* Done with postcap, so just have the image in the precap buffer */ cnt->current_image->flags |= IMAGE_PRECAP; + /* gapless movie feature */ + if ((cnt->conf.event_gap == 0) && (cnt->detecting_motion == 1)) + cnt->makemovie = 1; cnt->detecting_motion = 0; }