I hoping to make a plugin to run in vdmx to detect the amount of motion in a video stream, using a difference blend of the last two frames and then sampling the brightness of the resulting image. But im having issues with inconsistent results.
In the hope of getting to the bottom of this issue - i have rebuilt the plugin as a stand alone vuo patch that plots the output value, which is attached.
It rotates a square as a substitute input image - as this is at a constant speed i would expect a constant output value. But this value fluctuates between an expected reading and almost zero.
My guess is that my timing is off and the progression of the two comparison frames is out of sync - but being new to vuo iām unsure about this.
Also there is another glitch that gives higher than expected results - this is caused by actions is other apps. Minimizing a browser for example. I guess this is causing vuo to skip a beat and results in the comparison of frames with a greater difference in time.
Iām hoping this is a noob error - as i purchased vuo for this purpose and hope its capable of the task.
cheers Howie
I get a nice curve using the difference of 2 squares (see joined MotionDetect_deBug 1), but using video frames I see what you mean about skipping frames when the computer does other things (joined MotionDetect_deBug 2).
I guess resizing the movie down, to reduce hardware load is a way to go, but here Iām testing it with a small macOS movie so itās already small.
You can also right-click on time nodeās output ports, and choose event throttling āDrop Eventsā or āEnqueue Eventsā and check the best results.
But Iām letting the team answer more deeply about this, too technical for me ;)
EDIT : Added MotionDetect_deBug 3 with a Smooth over the resulting value.
Brilliant the throttling on the display refresh fixes the zeros in the debug patch. I hadnāt tried this as the final plugin dosnāt render anything - but if I drive the smooth node with a throttled display refresh it does keep the output value in sync.
Still the issue of dropped frames from external influences - but iām not sure that this can be fixed inside the patch.
Many Thanks.
Still the issue of dropped frames from external influences - but iām not sure that this can be fixed inside the patch.
@howie, are you still running into this problem with the latest version of your composition? (Based on your recent posts, Iām guessing itās evolved since the conversation here.) If so, could you post that version?
Hi Jaymie _ thanks for asking about this. The issue is still present but we have learned to live with it.
The vuo patch is attached along with a VDMX project - which sends the syphon and osc controls.
If its useful to look into this from a Vuo view then it would be great to hear your thoughts but its not a pressing issue.
Let me know if things need more explanation.
cheers_ Howie
Hello all,
Iām trying to trigger a movie recording using this motion detection patch and canāt figure out the event blocking process that is requiredā¦
How do I block the events coming from the camera input from reaching the Save Images to Movie node until it receives the trigger from the detected movement?
This is what Iāve been tryingā¦
Your approach should be working afaict, but perhaps you might share a .vuo file (or show more of the upstream?)
As for dropped frames, you might consider just holding the last value if the frame difference is practically 0.
Iāve done a bunch of experiments in this space, happy to help where I can.
As a sidenote, I think this is an example of where Save Images to Movie would be more intuitive to use with a āRecordā and āStopā. I know team Vuo has a philosophy on this, but this feels like a special kind of patch. Ā
Iād also love to hear what the output (difference) is used for in your plugin? Are plugins popular/in demand? Iāve done some research, but donāt have finger on the pulse, so to speak.
I did find the problem upstream. When the camera first sends a frame the difference calculation throws out a 1 and that was triggering a recording.
I added a couple of seconds delay when the composition starts up before it can start recording using a Measure Time and an All True so that it ignores the first trigger.
Iām not sure what @Howie is using this for but I am just making a very simple āsecurity cameraā type app for myself as I wanted to identify a nocturnal animal which has burrowed next to my home.
My Motion Triggered Video Recorder composition is attached.
Not sure itās all using the best methods but itās working, mostly as I want.
It saves movies to the desktop at 25fps when motion is being detected and waitās 4 seconds to stop recording after the motion stops. Also sequentially names the .movs
EDIT: trying it out now with a miniDV camera as input rather than isight/facetime camera. By having a look at the number coming out of the RGB addition I was able to set the sensitivity quite accurately.
No video of the suspected rat yet as the weather has been too cold and wet. Ā
Hello again,
Attached a revised and improved composition. Added a couple of UI elements to choose camera input and adjust sensitivity.
The composition saves movs to whatever folder the comp is within but when I try the same with an exported app it fails to save the movies anywhere.
What is the correct shortcut URL for saving files to within the enclosing folder for use within an exported app?
Very cool! I havenāt looked at the composition yet, but I believe the normal path to the enclosing (parent) folder is āā¦/myFileā (without the quotes)
However, running some tests on a sample app here shows that path doesnāt seem to work, instead only āmyFileā is working, which writes to the Desktop folder, regardless of how deeply nested my test app is. You can always write in the whole path, with ~ being the user directory. for example ā~/Desktop/mySubFolder/myOtherFolder/ā
Found the relevant bit about relative file paths in the manual: āIf the fileās location doesnāt start with file:// or /, then itās treated as a relative path. This is the option youād typically want when sharing the composition with others. If running the composition on a different computer than it was created on, the file needs to exist in the same location relative to the composition (.vuo) file. If running an application exported from the composition, the file needs to exist in the Contents/Resources folder inside the application packageā
So I should probably add a text/URL field/ save path⦠Ā