cocoa - Set resolution in QTCapture? -
I'm recording from a webcam, though the camera looks very good in photobooth though, when I with QTCaptureView in my program Previewing it, or recording it in a file, it is very slow because the QuickTime is giving me the maximum possible resolution of 1600x1200 how can I apply more proper size for both my QTCaptureView and my recording file Am I
As you change the resolution of the video being captured, within your output from QTCaptureSession Can set pixel buffer properties For example:
[[[MyCaptureSession output] ObjectAntindex: 0] Set pixel buffer attributes: [NSDsdse dictionary with Object EndCAZ: [NSNM number numberless: 480], KCVPixelFreeHeightKey, [NSNumber numberHome: 640], Kcvpxbufferwidthak, void]]; The video output will be set for 640x480 for the first output in your capture session. It should also adjust the camera settings so that it has brought back the size of the image frame (if supported by the camera hardware).
You may want to use Base MPEG encoding instead of HAV 264. To make your real-time video recording it can be set using the following like code:
NSArray * outputConnections = [mCaptureMovieFileOutput connection]; QTCaptureConnection * Connection; (Connection to the output connection) {if ([[connection mediaType] isEqualToString: QTMediaTypeVideo) [mCaptureMovieFileOutput setCompressionOptions: [QTCompressionOptions compressionOptionsWithIdentifier: @ "QTCompressionOptionsSD480SizeMPEG4 video"] for connection: connection]; } h.264 encoding, especially Quicktime implementation, uses a lot of CPU power to encode the base from MPEG 4.
Comments
Post a Comment