Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using Quartz Composer to Switch Automatically between Two Video Sources



We're trying to build a QC that will take two video sources off of a server (the easy part) and composite them into one QT movie (another easy part). The hard part is switching between sources based on which source is moving. We'll also be taking ONLY the audio from the speaker camera. So, it really comes down to a way to choose which video stream to select based on which has more changing pixels.


Subtract successive frames (motion detection), then use a histogram. If the image is stationary, the low indexes of the histogram will have high values. If the image is moving, the low indexes will be lower. You'll have to do some tests to see what thresholds you should use -- I highly recommend testing _In The Environment You'll Be Deploying In_ to get accurate thresholds. smoothing and hysteresis are also good ideas, if you're feeling ambitious :)

Here's a lame example I whipped up -- no smoothing or anything, but it might be a start.

Attachment: MotionDetection.qtz
Description: application/quartzcomposer




Video Input is asynchronous, so instead of subtracting adjacent frames (t0 - t1), I added a couple frame delay with the queue; this seems to give better results on my machine since adjacent frames can sometimes be identical.


--
[ christopher wright ]
email@hidden
http://kineme.net/

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/email@hidden

This email sent to email@hidden

References: 
 >Using Quartz Composer to Switch Automatically between Two Video Sources (From: Jeffrey Weekley <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.