Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Webcam Settings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Webcam Settings



(Sorry if this gets posted twice -- I had to delete the explanations at the end because the list server has a maximum massage size of 8k)

At 8:40 AM -0500 1/30/02, Gaetan Diamond wrote:
Is it possible to modify the SequenceGrabber's settings (like Flip Vertical,
Flip Horizontal, shutter, Gain, etc) of a Firewire Webcam (like PyroWebcam,
or IBot) without using the user interface (by calling SGSettingsDialog)?

There isn't a standard way to do flip/mirror because the Sequence Grabber doesn't pass the channel matrix to compressed source devices, but for any drivers we (IOXperts, Codewell, me) have written there is a semi-public API that our SGPanels use to talk to our drivers.

This includes all FireWire cameras except iRez, and any USB cameras based on Philips, ST, Divio, and a few other chipsets.

Mac OS X FireWire Drivers can be downloaded at:

<http://www.ioxperts.com/dcam.html>

The next FireWire release will include Mac OS 9 drivers in the installer as well -- we should have something for Philips- and Divio-based USB cameras on X shortly -- there's an announcement mailing list on the Resources page.

I'll post the API and some selectors below -- the calls work like the VDGetXXX()/VDSetXXX calls except they take an OSType selector instead of having a separate call for each property -- range is generally 0..65536 for continuous properties and 0..1 for booleans and 0..n for enumerations.

So to turn on horizontal flip:

UInt16 value = 1;

ComponentResult err = VDigSetProperty(vdig, 'FHor', &value);

Note that the VDigSetProperty has the same semantics as VDSetBrightness, etc -- it takes an address and returns the value that was actually set -- for instance there may be only 64 levels of brightness.

This means that if you want to increment the brightness, you may need to call it in a loop with increasing until the the value you get back changes.

Also, note that changing some parameters on some drivers may cause video to stop until you stop and restart the sequence grabber.

The header and Component glue are here:

<ftp://ftp.ioxperts.com/pub/tools/vdig/>

I _really_ wish we could open the vdig API for some new selectiors because there's a lot of information we can't return through the current API (supported video sizes, supported frame rates, etc.)

I'd like to update this with an Apple Event modeled API to make scriptable video applications easier to write -- please contact me or <email@hidden> if you'd like to contribute -- having multiple API standards is silly.

The calls below aren't likely to change because they're used by too many devices in the field, so they might as well be documented, but please let us know ifyou're using them.

Note that not all of the selectors below are used, but they suggest some properties that ought to be defined.

VDGetSettings(To|From)UserData tell the vdig to dump or restore all its setting w/o going through SGSetting -- this may also be useful.

Hope this helps,

-Steve

#ifndef __QUICKTIMECOMPONENTS__
#include <QuickTimeComponents.h>
#endif

enum {
kVDigGetPropertySelect = 801,
kVDigSetPropertySelect = 802,
kVDigGetPropertyFixedListSelect = 803,
kVDSetSettingsFromUserDataSelect = 804,
kVDGetSettingsToUserDataSelect = 805
};

EXTERN_API( VideoDigitizerError )
VDigGetProperty (VideoDigitizerComponent ci,

OSType property,

unsigned short * data)
FIVEWORDINLINE(0x2F3C, 0x0008, kVDigGetPropertySelect, 0x7000, 0xA82A);

EXTERN_API( VideoDigitizerError )
VDigSetProperty (VideoDigitizerComponent ci,

OSType property,

unsigned short * data)
FIVEWORDINLINE(0x2F3C, 0x0008, kVDigSetPropertySelect, 0x7000, 0xA82A);

EXTERN_API( VideoDigitizerError )
VDigGetPropertyFixedList (VideoDigitizerComponent ci,

OSType property,
Fixed * list,
long * size)
FIVEWORDINLINE(0x2F3C, 0x000C, kVDigGetPropertyFixedListSelect, 0x7000, 0xA82A);

EXTERN_API( ComponentResult )
VDGetSettingsToUserData(
VideoDigitizerComponent ci,
UserData ud,
long flags)
FIVEWORDINLINE(0x2F3C, 0x0008, kVDGetSettingsToUserDataSelect, 0x7000, 0xA82A);


EXTERN_API( ComponentResult )
VDSetSettingsFromUserData(
VideoDigitizerComponent ci,
UserData ud,
long flags)
FIVEWORDINLINE(0x2F3C, 0x0008, kVDSetSettingsFromUserDataSelect, 0x7000, 0xA82A);


kVdpLatchedButtons = 'BtnL'
kVdpSnapshotEnable = 'Snap'

kVdpUserDefaults = 'uDef',
kVdpFactoryDefaults = 'fDef',

kVdpBackLightCompensation = 'Back', // Boolean 0=off 1=on.
kVdpBlackWhiteMode = 'B&W ', // Boolean 0=off 1=on.

kVdpWhiteBalanceAuto = 'AuWB', // Boolean 0=off 1=on.
kVdpWhiteBalanceMode = 'WBmo',
/* Auto White balance control Integer.
0x00 Indoor (incandescent)
0x01 Outdoor
0x02 flourescent
0x03 Manual
0x04 Auto */
kVdpWhiteBalance = 'WBal', // this is for a single slider white balance control (for all colors)
kVdpWhiteBalanceRed = 'WBaR', // this is for manual white balance control
kVdpWhiteBalanceGreen = 'WBaG', // this is for manual white balance control
kVdpWhiteBalanceBlue = 'WBaB', // this is for manual white balance control
kVdpWhiteBalanceU = 'WBaU', // this is for manual white balance control
kVdpWhiteBalanceV = 'WBaV', // this is for manual white balance control

// Control of pixel intensity brightness

kVdpAutoExposureMode = 'xxxx', // switch between auto exposure algorithms.
kVdpAutoExposureRegion = 'xxxx', // Rect (?) The region of the display used for auto exposure calculations.

kVdpShutterSpeedAuto = 'AuSh', // Boolean 0=off 1=on. Allow automatic control of shutter speed.
kVdpExposureAuto = 'AuEx', // Boolean 0=off 1=on. Allow automatic control of shutter speed.
kVdpShutterSpeed = 'ShSp', // 0 -> switch on auto mode, otherwise Inverse of the exposure time
kVdpExposureTime = 'Expo', //

kVdpGainAuto = 'AuGa', // Boolean 0=off 1=on
kVdpGain = 'Gain', // Fixed

kVdpImageFormat = 'Fmat', // Integer (enum VFxImageFormat)

kVdpImageFormatPresets = 'FmaL', // list of sizes available from the camera.



// Image operations done in hardware by the camera

kVdpFlipHorizontal = 'FHor', // boolean 0=off 1=on
kVdpFlipVertical = 'FVrt', // boolean 0=off 1=on

//
kVdpGamma = 'Gama',
kVdpGammaStandard = 'GaSd', // standard gamma compensation for (0.45 analog equivalent) monitors.

kVdpBrightnessAuto = 'AuBr', // Boolean 0=off 1=on
kVdpBrightness = 'Brig', // Fixed




--
_________________________________________________________________________
Steve Sisak, CTO email@hidden
IOXperts, Inc. voice: +1 617 876-2572
87 Bristol St #3A fax: +1 617 876-2337
Cambridge, MA 02139 mobile: +1 617 388-6476




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.