Skip to content

Add different frame skipping modes #82

@Breakthrough

Description

@Breakthrough

Currently, using --frame-skip acts on the entire video itself, including once we enter a motion event. This improves processing performance, but also reduces accuracy. Based on the fact that motion events likely take up a small proportion of the video, I would like to propose a hybrid solution, where frame skipping is only used outside of motion events. Then, once a motion event is detected, we start processing every frame individually.

This assumes for the most part that the motion score between two frames is always <= the score between skipped ones, but that is generally true since the further apart the frames are in time, the more likely there are to be large differences in pixel values when there is motion present. Since the background subtractors can only handle static backgrounds, there shouldn't be much interference there either.

As another benefit, the bounding boxes would also be updated each frame properly with this change, and it also reduces the variance in detection performance during events. Lastly, the performance loss is likely negligible to that which will be added in by #81, since video encoding is typically a more expensive operation (at least with the current encoder). Performing the encoding in a separate thread (#52) will also help offset any costs of this change.

As identified in the comments below, it also is possible for the more accurate scan to be done in a separate thread. This would require a different lookahead buffer size to be added to the configuration file, but that should be acceptable for most use cases in terms of accuracy (I suspect there would be almost no difference between a regular scan with frame skip 0). This would be a rather large change to the internal scanning logic, but is a promising performance improvement for nearly all common use cases (and would likely be much faster than the hybrid solution discussed above).


It might be better to allow different frame skip modes, so will treat this as less of a change and more of a feature.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions