Page 1 of 1

Choppy video / slow frame rate problem

Posted: Wed Jan 19, 2005 5:38 pm
by JasonH
Great software Phil!

I'm running a 4 port single chip capture card on a AthlonXP2000+ with 512MB ram. Everything works well except I've been having real problems with ZM being able to save the images fast enough. I'm capturing at 768x576 and 4frames per second but when an alarm is triggered the rate drops compared to the non-alarm frames.

To test further I captured from one camera only and set a really small active zone. CPU and memory were all ok. It captures fine at the non-alarm rate of 4fps but when triggered the frame rate either stayed the same or dropped.

I've tried to fix it by enabling ZM_OPT_FRAME_SERVER and turning stats off but this didn't seem to help. It seems worse when there is triggering of the alarm on a gross scale such as when a large car moves past. Sometimes when this happens, there will be a 5 second pause between the first alarmed frame and the next one captured! Another thing that sometimes happens is a frame will be captured which is composed of two frames several seconds apart, this can cause really weird things like a pair of legs walking up the drive with no body or head :lol:
However, the system runs acceptably if I peg the capture rate at 4 and disable ZM_NO_MAX_FPS_ON_ALARM.

I know there probably isn't enough information here to fix the problem but how do I investigate further?

thanks.

Posted: Wed Jan 19, 2005 7:34 pm
by zoneminder
I would recommend a couple of things.

1) do a zmu -m <your monitor id> -q -v and post the results, that will contain your zone settings
2) check the actual stats values associated with each alarm frame to see if they seem sensible, again post here if you like
3) switch on diagnostic images and see if they make sense also.

Phil

Posted: Sat Jan 22, 2005 3:20 pm
by JasonH
Here are the zone settings that I found to be most effective.

Code: Select all

Monitor 4(Cam3)
Id : 4
Name : Cam3
Type : Local
Device : 0
Channel : 3
Format : 0
Width : 768
Height : 576
Palette : 4
Colours : 3
Event Prefix : Event-
Label Format : %%s - %y/%m/%d %H:%M:%S
Label Coord : 0,0
Image Buffer Count : 30
Warmup Count : 25
Pre Event Count : 10
Post Event Count : 20
Alarm Frame Count : 1
Section Length : 600
Maximum FPS : 4.00
Reference Blend %ge : 10
Function: 3 - Motion Detection
Zones : 1
  Id : 5
  Label : All
  Type: 1 - Active
  Limits : 0,201 - 767,575
  Alarm RGB : ff0000
  Check Method: 3 - Blobs
  Min Pixel Threshold : 11
  Max Pixel Threshold : 0
  Min Alarm Pixels : 5000
  Max Alarm Pixels : 0
  Filter Box : 5,5
  Min Filter Pixels : 1500
  Max Filter Pixels : 0
  Min Blob Pixels : 1000
  Max Blob Pixels : 0
  Min Blobs : 1
  Max Blobs : 0

This event was recorded ok with very few skipped frames

Code: Select all

Alarm Px   17308 (6%)
Filter Px   10623 (3%)
Blob Px    9125 (3%)
Blobs    3
Blob Sizes    1125-6228 (0%-2%)
Alarm Limits    522,235-679,406
Score    3
However, there is an event with 26% 24% and 23% Alarm, Filter and Blob px respectively that it choked badly on. I tried enabling ZM_RECORD_DIAG_IMAGES but it overran the ring buffer and zma exitted.

It skips framed on my Axis 206W too but not as frequently. Any clues? In the meantime I'm going to try disabling analysis images and stats and see what happens.

Thanks.

Posted: Sat Feb 05, 2005 9:11 am
by JasonH
I think I've found out what's wrong.

I think that the pre event count of 10 is causing zma to spend too long writing pre-event images to the disk and database which can cause a gap of up to 5 seconds before any more alarm frames are written. By this time, zmc has written more images into the ring buffer (which is probably too small anyway) and images are lost following the alarm.

I've reduced it to 2 and turned off analysis images and stats and that has pretty much fixed things. This particular camera produces frames of about 90-100K each which I think explains why my Axis cam wasn't suffering as much with similar settings as those are about 40-50K.

I'm still mystified as to why large change events made it worse than events with small changes. Perhaps this is coincidence.