View unanswered posts | View active topics It is currently Thu Jul 31, 2014 2:30 pm



Reply to topic  [ 4 posts ] 
Frame Skip disable during alerts? 
Author Message

Joined: Sun Nov 21, 2010 7:25 pm
Posts: 37
Post Frame Skip disable during alerts?
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?


Sun May 06, 2012 11:50 pm
Profile

Joined: Sun Nov 21, 2010 7:25 pm
Posts: 37
Post Re: Frame Skip disable during alerts?
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?


Fri May 11, 2012 2:15 am
Profile

Joined: Sun Nov 21, 2010 7:25 pm
Posts: 37
Post Re: Frame Skip disable during alerts?
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:
                    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!


Fri May 11, 2012 2:44 am
Profile

Joined: Wed Apr 04, 2012 9:48 pm
Posts: 13
Post Re: Frame Skip disable during alerts?
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: viewtopic.php?f=29&t=19177


Sun May 13, 2012 7:44 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group