Hi, I'm having difficulty with ZM 1.19.4 and events.
I record some long events and so I have set ZM_EVENT_IMAGE_DIGITS to 4. When I view an event, it stops after a few frames. I changed to the stills view and noticed that some stills were missing from the view. I traced this back to the numbering of some of the event images.
Some images (generally near the start of the stream) are correctly recorded with 4 digits but the remaining are recorded with 3. The event view is trying to access the images with 4 digits of significance and so doesn't display the images with 3. Here is an example listing from one of the directories:
0003-capture.jpg
0004-capture.jpg
0005-capture.jpg
0006-capture.jpg
0007-capture.jpg
0008-capture.jpg
0009-capture.jpg
0010-capture.jpg
0011-capture.jpg
001-capture.jpg
002-capture.jpg
012-capture.jpg
013-capture.jpg
014-capture.jpg
015-capture.jpg
016-capture.jpg
017-capture.jpg
018-capture.jpg
019-capture.jpg
020-capture.jpg
and so on up to 999-capture. From there, the images are in the thousands where 4 digits of significance are required and so are numbered correctly.
The only other nondefault entry I have is ZM_OPT_FRAME_SERVER = true.
Has anyone else run into a similar problem? Am I doing something completely wrong?
David
Event image numbering
- zoneminder
- Site Admin
- Posts: 5215
- Joined: Wed Jul 09, 2003 2:07 pm
- Location: Bristol, UK
- Contact:
Hi,
Looks like you've found a bug there! The zmf daemon doesn't check the number of digits.
So you've two options. One, turn off zmf or two, apply the patch below. I admit I've not had chance to test it but it compiles so it's bound to work! The patch should work for 1.19.4 and 1.19.5.
Let me know how you get on.
Phil,
Looks like you've found a bug there! The zmf daemon doesn't check the number of digits.
So you've two options. One, turn off zmf or two, apply the patch below. I admit I've not had chance to test it but it compiles so it's bound to work! The patch should work for 1.19.4 and 1.19.5.
Let me know how you get on.
Phil,
Code: Select all
*** zmf.cpp 7 Sep 2004 08:45:00 -0000 1.10
--- zmf.cpp 7 Oct 2004 15:17:19 -0000
***************
*** 203,208 ****
--- 203,213 ----
exit( -1 );
}
+ char capt_path[PATH_MAX];
+ char anal_path[PATH_MAX];
+ snprintf( capt_path, sizeof(capt_path), "%s/%d/%%d/%%0%dd-capture.jpg", (const char *)config.Item( ZM_DIR_EVENTS ), monitor->Id(), (int)config.Item( ZM_EVENT_IMAGE_DIGITS ) );
+ snprintf( anal_path, sizeof(anal_path), "%s/%d/%%d/%%0%dd-analyse.jpg", (const char *)config.Item( ZM_DIR_EVENTS ), monitor->Id(), (int)config.Item( ZM_EVENT_IMAGE_DIGITS ) );
+
sigset_t block_set;
sigemptyset( &block_set );
struct sigaction action, old_action;
***************
*** 288,294 ****
continue;
}
static char path[PATH_MAX] = "";
! snprintf( path, sizeof(path), "%s/%d/%ld/%03ld-%s.jpg", (const char *)config.Item( ZM_DIR_EVENTS ), monitor->Id(), frame_header.event_id, frame_header.frame_id, frame_header.alarm_frame?"analyse":"capture" );
Debug( 1, ( "Got image, writing to %s", path ));
FILE *fd = 0;
--- 293,299 ----
continue;
}
static char path[PATH_MAX] = "";
! snprintf( path, sizeof(path), frame_header.alarm_frame?anal_path:capt_path, "%s/%d/%ld/%03ld-%s.jpg", frame_header.event_id, frame_header.frame_id );
Debug( 1, ( "Got image, writing to %s", path ));
FILE *fd = 0;
- zoneminder
- Site Admin
- Posts: 5215
- Joined: Wed Jul 09, 2003 2:07 pm
- Location: Bristol, UK
- Contact:
- zoneminder
- Site Admin
- Posts: 5215
- Joined: Wed Jul 09, 2003 2:07 pm
- Location: Bristol, UK
- Contact: