// if there is a frame available from a quicktime movie
if(QTVisualContextIsNewImageAvailable(_visualContext, NULL) &&
(QTVisualContextCopyImageForTime(_visualContext, NULL, NULL,
&imageBuffer) == kCVReturnSuccess)) {
// convert frame to a CIImage
CIImage* inputImage = [CIImage imageWithCVImageBuffer:imageBuffer];
// send the new CIImage to the renderer input
if(![_renderer setValue:inputImage forInputKey:kRendererImageInput])
NSLog(@"Could not pass frames cache to composition");
It's better to pass directly the CVImageBuffer (see http://
developer.apple.com/technotes/tn2005/tn2143.html)
// tell it to render
// ??? Can I pass 0 for the time ???
[_renderer renderAtTime:0 arguments:NULL];
Yes 0 is definitely a valid value
// get the output image
NSImage* outImage = [_renderer
valueForOutputKey:kRendererImageOutput];
if(!outImage)
NSLog(@"Could not get output image to composition");
The problem is that the output image is always NULL. Any ideas?
Can you post the composition somewhere - it's difficult to say
without seeing it?