Frame Skip disable during alerts?

Forum for questions and support relating to the 1.25.x releases only.
Locked
Briago
Posts: 37
Joined: Sun Nov 21, 2010 6:25 pm

Frame Skip disable during alerts?

Post by Briago »

I like to use a script which produces a daily summary video for each camera. I like to use MoCord to get a view of the whole day, not just during alerts. As a result I need a big difference between frames per second during non-alerts and alerts.

To keep a full day's review to about 2 minutes (for camera monitoring a 'quiet' street), the video needs to progress at ~30 min (rec) per second (play) during non-alert and ~30 sec (rec) per second (play) during alert. I can't set the frame rate to be 60 x different, or my non-alert state would be one frame per ~3 seconds.

I want to use the frame skip feature to allow the motion detection to function during non-alert at ~5fps and drop down to 0.5fps. Then during an alert the fps would go up from 5 to 15 fps with zero frame drops.

This would allow the motion detection to work on 5 to 15 fps, but recording to vary from 0.5 to 15 fps.

Does anyone know how it might be possible to make this work in the code? I haven't quite figured out how all the scripts in ZM work yet, but if you could at least point me to the right script or function that determines if a frame will be dropped, I think I could work in a system flag and an if statement to check if the monitor is in alert.

Any ideas?
Briago
Posts: 37
Joined: Sun Nov 21, 2010 6:25 pm

Re: Frame Skip disable during alerts?

Post by Briago »

I assume this would have to be in the c code as apposed to the runtime scripts. I tried to look through zma and zmc, but I still can't find the function that checks if frame skips are enabled. I did find where it checks the frame rate setting (used for analysis), but nothing to have it skip frames being written to the disk.

Does anyone know where this function would be?
Briago
Posts: 37
Joined: Sun Nov 21, 2010 6:25 pm

Re: Frame Skip disable during alerts?

Post by Briago »

Humm.. Well maybe I've been wasting my time. I think I found the function and it seems like it already ignores the frame skip during an alert. Can someone confirm that I am reading the code correctly?

File:
zm_monitor.cpp
Function:
bool Monitor::Analyse()
Snippet:

Code: Select all

                    else if ( state == ALERT )
                    {
                        event->AddFrame( snap_image, *timestamp );
                        if ( noteSetMap.size() > 0 )
                            event->updateNotes( noteSetMap );
                    }
                    else if ( state == TAPE )
                    {
                        if ( !(image_count%(frame_skip+1)) )
                        {
                            if ( config.bulk_frame_interval > 1 )
                            {
                                event->AddFrame( snap_image, *timestamp, (event->Frames()<pre_event_count?0:-1) );
                            }
                            else
                            {
                                event->AddFrame( snap_image, *timestamp );
                            }
                        }
                    }
                }
It looks like if the state is Alert then it will simply record every frame. However, if the state is 'Tape' (I assume this would be a non-event recording situation), then it checks to see if it should skip the frame using a frame counter.

If someone could confirm my new understanding, I think this could help others seeking to understand how the frame skip value works.

Thanks!
_saiko
Posts: 16
Joined: Wed Apr 04, 2012 8:48 pm

Re: Frame Skip disable during alerts?

Post by _saiko »

I can confirm that frame skip isn't applied in mocord mode during alarm.
I did raise a question here recently regarding the issue as I wasn't sure if that was intentional or not...

Here's my other thread: http://www.zoneminder.com/forums/viewto ... 29&t=19177
Locked