You could in theory use a QTPixelBufferContext (rather than the QTOpenGLTextureContext) and request RGB frames from it, and then pass the CVPixelBufferRef to QC as well, but I think that will be less optimized speed because QTOpenGLTexture Contexts (I believe) can optimize with YUV frames and YUV texture formats for lower bandwidth (and figure out what is 'right' per movie), and you may have some conversion overhead to your requested pixel buffer format. But that should work, and you can grab the CVPixelBufferRep and do whatever you want to it in serial/parallel to QCs processing. Just make sure to use the CVBufferRetain/Release stuff on it.

I also think there is a way to request both a CVPixelBufferRef and a CVOpenGLTextureRef. Another thing to be aware of is dealing with the working and output space, set those keys on your contexts when you make them, to make sure your color looks right in QC.

Hope this helps.


On Sep 22, 2009, at 11:43 AM, Chris Wood wrote:

2009/9/22 vade <[email protected]>:
I would highly highly highly suggest using a QTOpenGLTextureContext and insert frames with a CVOpenGLTextureRef, using QTCaptureVideoPreviewOutput, and using setVisualContext on it. NSImage is really not the way to go if you
are looking to avoid latency.

Ah, and CVOpenGLTextureRef is one of the supported types for a QC
input. Excellent! One question though: what's the best way of getting
the image from quicktime before it's set up as a texture? I'm going to
need to do some processing on the images on the CPU, in parallel with
the QC stuff, so it makes sense to grab it early and not waste
bandwidth on the bus.

Thanks!

Chris



On Sep 22, 2009, at 10:14 AM, Christopher Wright wrote:

Ah, that does sound promising. I'll try throwing a pre-loaded image at the input port when the capture session is stopped, see what happens.

Good idea -- let us know how that goes.

Is adding the CVImageRep to an NSImage then passing that to the
QCRenderer the most efficient way to handle it btw?

You're in tradeoff land here, if QTKit is in fact reclaiming the texture (still speculative) -- the CVImageRep may be the most efficient in terms of code, memory usage, and execution speed, but it's also non- functional with this use case (again, speculatively). I'm _guessing_ you can keep doing this, but have some method of cloning the texture when you stop the capture session so that it doesn't get freed. This should keep stuff running smoothly without requiring you to change up your pipeline. I don't know how
easy/impossible it is to copy CVImageReps...

Backtrace below (it does appear to crash when setting a port value
within QC - see thread 1).

(note: please include headers when posting crash logs -- a few weeks ago someone posted a crash log to the QT-dev mailing list, and the clue was actually in the header (they were using NSOperations on a 10.5.6 system, and NSOperation had a subtle race condition on x86 processors prior to 10.5.7 that could cause the app to crash with an unhandled exception -- the actual
backtraces weren't useful in that case))

Looks like a standard message-send-to-a-freed-object crash, so that's
promising.

unrelated: looks like you're building from a flash drive; how has that worked out for you? are builds noticeably faster/has drive reliability dropped any? (I do dozens to hundreds of builds a day, so if it saved a few
seconds, and didn't toast the flash drive, I might consider that for
myself... I always hear about how flash can sustain a bazillion writes now,
but I still have my doubts...)

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

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list ([email protected] )
Help/Unsubscribe/Update your Subscription:

http://lists.apple.com/mailman/options/quartzcomposer-dev/doktorp%40mac.com

This email sent to [email protected]



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to