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: muxed media and QTKit



Your session setup and configuration looks good. In order to find muxed devices, you do need to search for QTCaptureDevices with QTMediaTypeMuxed in addition to QTMediaTypeVideo, but based on your previous email, it sounds like you may have already experimented with that and run into problems. Just be sure, to search for both kinds of devices, you would use code that looks like this:

BOOL success;
NSError *err;

dev = [QTCaptureDevice defaultInputDeviceWithMediaType: QTMediaTypeVideo];
success = [dev open:&err];
if (!success) {
dev = [QTCaptureDevice defaultInputDeviceWithMediaType: QTMediaTypeMuxed];
success = [dev open:&err];
}


If that approach doesn't work, there may be a problem specific to the device being used. For example, it may be an HDV camera on a system that does not have the HDV codec (which is only bundled as a part of Final Cut Pro). Without the codec, the captured video cannot be decompressed which would result in the noCodecErr that you are seeing.

David Underwood
QuickTime Engineering

On Jun 3, 2008, at 4:21 PM, Christopher Wright wrote:

Hypothetically, it shouldn't be necessary to disable the audio connection when there are no capture outputs expecting audio, The capture session should know to just ignore the extra stream in that case.

hmm... I guess that won't do much then :)

In the mean time, feel free to file a bug on this issue. Details on the specific device being used (if you can get them), your configuration of the capture session, and your configuration of the decompressed video output, including any pixel buffer attributes that you might be setting, would be especially helpful.


I don't think it's a bug, as much as it is my incompetence with QT. The camera works fine with existing software, so it must be doing something that I'm not.
I'm not configuring the decompressed video, nor am I setting any pixelbuffer attributes -- I just need the CVImageBufferRef to pass along to some other image processing stuff.


My code looks something like this (error handling removed for brevity:

if(deviceUID)
dev = [QTCaptureDevice deviceWithUniqueID: deviceUID];
else
dev = [QTCaptureDevice defaultInputDeviceWithMediaType: QTMediaTypeVideo];
[dev open: &err];
deviceInput = [[QTCaptureDeviceInput alloc] initWithDevice: dev];

// get the list of owned connections
NSArray *ownedConnections = [deviceInput connections];

// disable all the audio connections
for (QTCaptureConnection *connection in ownedConnections) {
if ( [[connection mediaType] isEqualToString: QTMediaTypeSound] ) {
[connection setEnabled:NO];
}
}

videoOutput = [[QTCaptureDecompressedVideoOutput alloc] init];
[videoOutput setDelegate: self];

captureSession = [[QTCaptureSession alloc] init];
[captureSession addInput: deviceInput error: &err];
[captureSession addOutput: videoOutput error: &err];
[captureSession startRunning];


This seems to work perfectly for video-only devices (built-in and external iSights), but not for DV-cams (The device in question is an HV20)

--
[ christopher wright ]
email@hidden
http://kineme.net/


_______________________________________________ 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
References: 
 >muxed media and QTKit (From: Christopher Wright <email@hidden>)
 >Re: muxed media and QTKit (From: David Underwood <email@hidden>)
 >Re: muxed media and QTKit (From: Christopher Wright <email@hidden>)
 >Re: muxed media and QTKit (From: David Underwood <email@hidden>)
 >Re: muxed media and QTKit (From: Christopher Wright <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.