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: Auto-exposure with UVC cameras




On 26/05/2008, at 11:32 PM, Steve Sisak wrote:
The only issue I'm seeing that would affect using QC Pro 9000 with our driver via the QTKit API is that there appears to be a "feature" of the QTKit that asks for the camera's native (maximum) pixel size and then requests video of that size, regardless of the video size requested by the application (and ignoring the fact that larger sizes result in lower frame rates).

This works fine for a VGA-sized camera, but for a 1600x1200 UVC camera, even if you request 640x480, QTKit will request 1600x1200 from the camera and scale it to 640x480, resulting in a frame rate of about 5fps (even though the camera is perfectly happy to provide 640x480, 30fps video on request).

There may be a work-around from the application side and I can certainly give you a call to force the driver to provide a particular size video regardless of what QTKit requests.

This behaviour confused me too, but the "workaround" (or maybe this is how Apple envisaged it to be used?) is to do something like this (I discovered this in a post on this mailing list):

NSDictionary *videoOutputSettings;
videoOutputSettings = [NSDictionary dictionaryWithObjectsAndKeys:
  [NSNumber numberWithInt:ImagePixelWidth], (id)kCVPixelBufferWidthKey,
  [NSNumber numberWithInt:ImagePixelHeight], (id)kCVPixelBufferHeightKey,
  [NSNumber numberWithUnsignedInt:kCVPixelFormatType_24RGB], (id)kCVPixelBufferPixelFormatTypeKey,
  nil];
[mCaptureDecompressedVideoOutput setPixelBufferAttributes:videoOutputSettings];

QTKit then requests frames from the corresponding video input device at the "best match" to the video settings you used for the output. The logic of changing camera settings by changing the output still has me scratching my head, but that's how it's done, at least for now.

Nick
 _______________________________________________
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.