|
Q: How can I disable the audio or video stream when capturing from a muxed device?A: Muxed devices such as DV and HDV Cameras are represented in QTKit Capture by the media type To only capture a single stream from the device (for example video only), disable the audio connections on the device input for the capture device by using the Listing 1: Disable Audio Connections From A Muxed Device Input. QTCaptureDevice *theDefaultMuxedDevice; QTCaptureDeviceInput *theDeviceInput; BOOL success; NSError *error; ... // get the default muxed device theDefaultMuxedDevice = [QTCaptureDevice defaultInputDeviceWithMediaType:QTMediaTypeMuxed]; // open the device success = [theDefaultMuxedDevice open:&error]; if (YES == success) { // get the associated device input theDeviceInput = [QTCaptureDeviceInput deviceInputWithDevice:theDefaultMuxedDevice]; // get the list of owned connections NSArray *ownedConnections = [theDeviceInput connections]; // disable all the audio connections for (QTCaptureConnection *connection in ownedConnections) { if ( [[connection mediaType] isEqualToString:QTMediaTypeSound] ) { [connection setEnabled:NO]; } } } else { // do something with the error code } ... If you only want to capture audio, disable the References:Introduction to QTKit Capture Programming Guide Document Revision History
Posted: 2008-05-19 |
|