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: How to apply a CIFilter to a QTCaptureOutput



hi all,

so I was able to setup the OutputMovie, ICMCompressionSessionRef like the code in CaptureAndCompressIPBMovie. But now a have a new Problem: 

How do I get CIImage back into the CVImageBufferRef?

- (void)captureOutput:(QTCaptureOutput *)captureOutput didOutputVideoFrame:(CVImageBufferRef)videoFrame withSampleBuffer: (QTSampleBuffer *)sampleBuffer fromConnection:(QTCaptureConnection *)connection
{
OSStatus err = noErr;
if (isRecording) {
long presentationTime = [sampleBuffer presentationTime].timeValue;
long duration = [sampleBuffer duration].timeValue;
CIImage *inputImage = [CIImage imageWithCVImageBuffer:videoFrame];
[effectFilter setValue:inputImage forKey:@"inputImage"];
//How do I get CIImage back into the CVImageBufferRef?

err = ICMCompressionSessionEncodeFrame( compressionSession, videoFrame, presentationTime, duration, kICMValidTime_DisplayTimeStampIsValid, NULL, NULL, NULL );
}
}

Thanks for your time.

Regards.

Hannes Osius


Am 28.05.2008 um 22:14 schrieb David Underwood:

If you use the code in CaptureAndCompressIPBMovie you can still adapt it to using QTKit Capture for capturing the video frames themselves. Look at the documentation for QTCaptureDecompressedVideoOutput to to see how to get the raw frames acquired by a capture session.

Good luck.

David Underwood
QuickTime Engineering

On May 28, 2008, at 10:25 AM, Brad Ford wrote:


On May 28, 2008, at 3:31 AM, Hannes Osius wrote:

Hi,

I am new to developing in Mac osx application. I trying so write a small app, that records a Video from a camera via QTCaptureDevice, apply a CIFilter and write the movie to disk.

I picked the example  "MyRecorder" and setup a custom CIFilter for the QTCaptureView using the Delegates "view:willDisplayImage:" so now I see a Preview with the filter applied, but how to I write this to a movie file? 

There's currently no way to get the contents of your buffer to loop back into the path that would get the frames into the movie file.  You're hooking into a delegate method that lets you peek at the buffer, but not alter its contents inline.  If you want to add effects and write the result to a movie file, you'll need to write the file yourself.  There are examples of how to do this in CaptureAndCompressIPBMovie (disregard the Sequence Grabber sourcing code).

-Brad Ford
QuickTime Engineering
_______________________________________________
Do not post admin requests to the list. They will be ignored.
QuickTime-API mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quicktime-api/email@hidden




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

This email sent to 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.