Query for video in ZoneMinder
Query for video in ZoneMinder
Hello,
I'm trying to find out how you can query for video in ZM.
For example, I want to get the results of all the videos that have been recorded yesterday between 1:00 and 3:00, and then retrieve these.
Any Help.
I'm trying to find out how you can query for video in ZM.
For example, I want to get the results of all the videos that have been recorded yesterday between 1:00 and 3:00, and then retrieve these.
Any Help.
Hi, you can try this:
Code: Select all
@ $conn = mysql_pconnect( localhost, zmuser, zmpass );
mysql_select_db( zm, $conn);
$query = "SELECT * FROM Events WHERE StartTime BETWEEN (insert begin datetime here) AND (insert end datetime here)";
$result = mysql_query($query, $conn);
if ($result) {
$num = mysql_numrows($result);
}
Last edited by Laevi on Mon Oct 08, 2007 1:31 pm, edited 1 time in total.
Hi, thank you very much for your reply,
In fact the above will return all the events that started between the specified times, (or not?).
I was wondering if there was a way that I could get the events above and also the events that started earlier and continued after the start time of the query.
Thanks again!
In fact the above will return all the events that started between the specified times, (or not?).
I was wondering if there was a way that I could get the events above and also the events that started earlier and continued after the start time of the query.
Thanks again!
Sorry maybe I didn't describe it well.
I want to get everything that has been recorded in a time window.
An event that may has started in this window, has ended in this window, and an event that may has started and ended outside the time window but was being recorded during the window.
I hope I expressed it this time right.
Thanks for your time.
I want to get everything that has been recorded in a time window.
An event that may has started in this window, has ended in this window, and an event that may has started and ended outside the time window but was being recorded during the window.
I hope I expressed it this time right.
Thanks for your time.
So this should be what you're looking for then? all events that start and end in the time you enter..
Code: Select all
$query = "SELECT * FROM Events WHERE StartTime OR EndTime BETWEEN (insert begin datetime here) AND (insert end datetime here)";
Hi, please check this:
Thanks
Code: Select all
start
time
(event)
| |
--------------------------------------------------
| | |
|event | |
--------------------------------------------------
| |
start time (query) end time (query)
|---------------------------------|
|
|
I want this result and this part of the video
Sorry for your time, one final question,
If I'm getting it right you can only filter the events that have started or ended in a specific time window?
For example, ZM is recording all night long, and the next morning I want to get 3 specific minutes from last night's recorded video. Is there an automated way I can do this ?
Thank you very much
If I'm getting it right you can only filter the events that have started or ended in a specific time window?
For example, ZM is recording all night long, and the next morning I want to get 3 specific minutes from last night's recorded video. Is there an automated way I can do this ?
Thank you very much
You can query for the time frame using a simular query in the filter as above, but it will return the entire event(s) that fit that time frame, not just the three minutes. If for instance you have a 5 min event that falls in that time you would get the whole five minute event. If there are two events that lap in that time, then the query would return both events.