Welcome Guest ( Log In | Register )


Important

The forums will be closing permanently the weekend of March 15th. Please see the notice in the announcements forum for details.

 
Movement Detection Filter
« Next Oldest | Next Newest » Track this topic | Email this topic | Print this topic
colinb
Posted: Jun 16 2003, 09:44 AM


Unregistered









I am currently using VirtualDub with a bullet camera as a basic cctv recorder, recording 2 frames per second.

A movement-detection filter would be very useful which would continuously cache (say) the last ten seconds of frames from the camera, but NOT write them to the disk. As each frame is grabbed from the camera it is compared to the previous frames and if the differences exceed a particular threshold (i.e. there is movement detected) then the 10-second cache is flushed-out to the AVI file followed by "current" frames as they are grabbed from the camera - this continues until (say) 5 minutes after the last movement was detected, then output to the AVI file stops and the 10-second cache starts to fill again.

I don't suppose such a filter exists, so I'm considering writing one but I do not know the limitations of the VirtualDub filter interface.

Is it possible to write something like this as a virtual dub filter, bearing in mind that most of the time it will be throwing frames away, and will need to be able to cache past frames and flush them out to the AVI file?

Colin
 
  Top
Kippesoep
Posted: Jun 16 2003, 08:07 PM


Moderator of the Virtualdub support forum


Group: Moderators
Posts: 447
Member No.: 441
Joined: 6-October 02



AFAIK, this would not be possible with the current filter interface. Filters are intended mostly for off-line processing. This would need to be used during capture only. Filters cannot, to my knowledge, drop frames or basically "pause" recording. The writing to disk is not handled by filters.
 
     Top
colinb
Posted: Jun 17 2003, 07:55 AM


Unregistered









QUOTE
Filters are intended mostly for off-line processing. This would need to be used during capture only.


Many (all?) filters can be applied while capturing by ticking "Enable RGB filtering". I have a timestamp filter loaded which adds the current date and time to the bottom left of each frame as it is captured.

I was rather hoping that the filter would have more control of the frame - e.g. a filter is handed a pointer to the frame data and can then process it, and then hands the frame back to the "system" which can then hand it on to the next filter or write it to the disk. In such a model the filter would be able to pass-on or throw away frames as required.

Has anyone written any filters and can confirm how the filters model works?

I guess I may have to download the filter SDK and have a good rummage around.
 
  Top
Kippesoep
Posted: Jun 17 2003, 09:38 AM


Moderator of the Virtualdub support forum


Group: Moderators
Posts: 447
Member No.: 441
Joined: 6-October 02



QUOTE (colinb @ Jun 17 2003, 08:55 AM)
Many (all?) filters can be applied while capturing by ticking "Enable RGB filtering".

Has anyone written any filters and can confirm how the filters model works?

I know they can be applied during capture. In the sentence you quoted, mark the words "mostly" and "intended". I've written 7 filters so far.

A filter gets a pointer to the current frame data (possibly processed by other filters) and must write its output to another pointer. There is however, no way to make "the system" do anything other than write this data to the file...
 
     Top
colinb
Posted: Jun 18 2003, 08:26 AM


Unregistered









Thanks for the reply. In the meantime I had downloaded the filter SDK and you're quite right. It says:

"Delay tricks will work, but will skew the video stream from the audio."

That is not a problem for me as I'm only capturing the video stream, BUT ...

"Frame count cannot change. Again, because of the one-out-per-one-in limitation, it is also not currently possible to create filters that alter the frame count by adding or dropping frames."

which makes it impossible to discard frames where no motion is detected, unless I make changes to VirtualDub itself.

 
  Top
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:
4 replies since Jun 16 2003, 09:44 AM Track this topic | Email this topic | Print this topic

<< Back to VirtualDub Filters and Filter Development