0
AVFoundationのAVCaptureVideoDataOutputを使用して録画しているビデオにウォーターマークまたはロゴを追加しようとしています。 UIImageの透過部分が黒になってしまっていると私は間違っているのですか?CIContextレンダリング:toCVPixelBuffer:bounds:colorSpace:アルファチャンネルの画像では機能しません
CVPixelBufferRef pixelBuffer = CMSampleBufferGetImageBuffer(buffer);
....
....
CIImage *image = [[CIImage alloc] initWithData:logoData];
CVPixelBufferLockBaseAddress(pixelBuffer, 0);
CIContext *ciContext = [CIContext contextWithOptions:nil];
CGColorSpaceRef cSpace = CGColorSpaceCreateDeviceRGB();
[ciContext render:image toCVPixelBuffer:pixelBuffer bounds:CGRectMake(image.extent.origin.x, image.extent.origin.y - 2, image.extent.size.width, image.extent.size.height) colorSpace:cSpace];
CVPixelBufferUnlockBaseAddress(pixelBuffer, 0);
CGColorSpaceRelease(cSpace);
こんにちはbeyowulf答えがありがとう、それは私のために働く。 (AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)接続 "関数とそれ以降の"キャプチャを終了します。 "私はオーディオに問題があります。それはビデオと一致しません。 –