Motion - Feature Request 2005x 04x 21x 054916

Feature Request: SQL event logging


It would be good if an event id field was added to the SQL logging. The event id for a given event would be assigned to each image file entry in the database, so that all image entries for a given event would share a common event id. This would facilitate the creation of event indexes.

-- TimWegener - 21 Apr 2005

Follow up

The event ID is reset each time Motion starts. And I do not want Motion to be dependent on a data file which then has to be located a specific place and I do not want Motion to be dependent in an SQL database either. So I see little usage.

I plan to extend the conversion specifiers to include more data. This way the onxxxx commands can be used for anything including running a small script that adds SQL functionality.

The intention is to keep Motion as lean and fast as possible and enable external interfaces to implement special features only very few want.

-- KennethLavrsen - 02 May 2005


Also to include the changed pixels

-- RobertH - 02 May 2005
We can add all sorts of data to the database. But we also want to keep Motion fast and lean.

What exactly would you use the diffs number for? And what would others need it for?

-- KennethLavrsen - 02 May 2005

I am creating a rudimentary statistical program also an Image indexer whereby high pixel changes would be considered as keyframes. It could also be useful to create mpgs/avi etc using a filter based on the pixel diff count. As you say there are more important issues to deal with in motion so its not high priority would be helpful though.

-- RobertH - 03 May 2005

I think this is quite a useful use case, since it allows you to index events, rather than every single snapshot, providing a much more useful index.

It is non-trivial to group snapshots into events en masse after the fact, or even calling a script using an onxxxx command. It makes sense to me that since motion is the one that defines which images are part of an event, that it should mark them as such.

I agree that it is undesirable to add more data dependencies. Perhaps when motion detects the start of an event it could generate an event timestamp and this would be added as field of each image SQL record. This would not require any extra state to be saved between motion sessions.

-- TimWegener - 09 May 2005

Event timestamp.

That is a good idea. It would be same timestamp as the creation stamp for an mpeg I would say. That would make the code relatively simple.

I am working on other things at the moment but if any of you want to submit a patch that adds the event time stamp = time of first motion frame excluding pre_capture frames then I will gladly add this feature to 3.2.X.

-- KennethLavrsen - 09 May 2005

I've submitted a patch. It uses the existing cnt->eventtime for the timestamp. This minimizes the amount of modifications necessary.

-- TimWegener - 18 May 2005

I have implemented the new field AND and I have replaced text_left with user_text in the SQL database which you can configure to any value. Combined with the new event convertion specifier %C there is no limit what you can store in this text field in the SQL database.

New features are available in MotionRelease3x2x4snap2

-- KennethLavrsen - 04 Sep 2005
Topic revision: r10 - 04 Sep 2005, KennethLavrsen
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Please do not email Kenneth for support questions (read why). Use the Support Requests page or join the Mailing List.
This website only use harmless session cookies. See Cookie Policy for details. By using this website you accept the use of these cookies.