Skip to content

Commit

Permalink
Implement gapless_event mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
JoergWeber authored and JoergWeber committed Sep 23, 2008
1 parent 0c45051 commit 0a5eebd
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion CREDITS
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions motion-dist.conf.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions motion.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
}
Expand Down Expand Up @@ -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__);
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 0a5eebd

Please sign in to comment.