When a filter is applied, source over compositing resulting in (unexpected behavior) filter bleeding into the background (the color of the background image is changing to gray). I had to use CIBlendWithAlphaMask setting the foreground image as the mask to work around this issue.
CIFilter *tonalFilter = [CIFilter filterWithName:@"CIPhotoEffectTonal"];
[tonalFilter setValue:filterImage forKey:kCIInputImageKey];
video1FilteredImage = [tonalFilter valueForKey:@"outputImage"];
CIFilter *colorGenerator = [CIFilter filterWithName:@"CIConstantColorGenerator"];
CIColor *inputColor = [[CIColor alloc] initWithColor:currentInstruction.compositionBackgroundColor];
[colorGenerator setValue:inputColor forKey:@"inputColor"];
CIImage *colorBackgroundImage = [colorGenerator valueForKey:@"outputImage"];
CIFilter *sourceOverCompositing = [CIFilter filterWithName:@"CISourceOverCompositing"];
[sourceOverCompositing setValue:video1FilteredImage forKey:kCIInputImageKey];
[sourceOverCompositing setValue:colorBackgroundImage forKey:kCIInputBackgroundImageKey];
video1FilteredImage = [sourceOverCompositing valueForKey:@"outputImage"];
Post
Replies
Boosts
Views
Activity
Using the following code, RAW/DNG images loose their location data when exported to a different device or computer.
[[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{
PHAssetResourceCreationOptions *options = [[PHAssetResourceCreationOptions alloc] init];
options.shouldMoveFile = YES;
PHAssetCreationRequest *creationRequest = [PHAssetCreationRequest creationRequestForAsset];
creationRequest.location = locManager.location;
if(rawEmbedsJPEGOnOff == 0){
[creationRequest addResourceWithType:PHAssetResourceTypePhoto data:photoData options:nil];
[creationRequest addResourceWithType:PHAssetResourceTypeAlternatePhoto fileURL:temporaryFormatFileURL options:options]; // Add move (not copy) option
}
else if(rawEmbedsJPEGOnOff == 1){
[creationRequest addResourceWithType:PHAssetResourceTypePhoto fileURL:temporaryFormatFileURL options:options];
}
} completionHandler:^( BOOL success, NSError *error ){
if(!success){
NSLog( @"Error occurred while saving raw photo to photo library: %@", error );
}
else{
NSLog( @"Raw photo was saved to photo library" );
}];
AVFoundation setPreferredPolarPattern AVAudioSessionPolarPatternStereo returning no audio on iOS 15. AVAudioSessionPolarPatternOmnidirectional works as expected.
Is it possible to write a UIView to disk using NSSecureCoding. The below code results in an error.
NSData *data = [NSKeyedArchiver archivedDataWithRootObject:object requiringSecureCoding:YES error:&error];
Error: The data couldn’t be written because it isn’t in the correct format.
We also tried the following:
NSMutableData *data = [NSMutableData data];
NSKeyedArchiver *archiver = [[NSKeyedArchiver alloc] initRequiringSecureCoding:YES];
[archiver encodeObject:view forKey:@"view"];
[archiver finishEncoding];
Error: This decoder will only decode classes that adopt NSSecureCoding. Class 'UIView' does not adopt it.
Hi guys,
We're testing our video editing iPad app on an M1 iMac and the export session export process starts but freezes and fails soon after with the following error.
Compiler failed with XPC_ERROR_CONNECTION_INTERRUPTED
MTLCompiler: Compilation failed with XPC_ERROR_CONNECTION_INTERRUPTED on 1 try
Any ideas on how to resolve this? Thanks!
Jed
Update: Looks like AVVideoCompositionCoreAnimationTool is causing the issue. When we commented out that line, the export was successful.
iOS 14: copying videos from the Photos app using AVAssetExportSession resulting in audio getting out of sync. The audio track start time is off by ~0.09 sec. On iOS 13, while there is a lag, it's only ~0.04 sec, which is virtually unnoticeable. Is anyone else experiencing this issue and is there a solution?
On iOS 14, copying videos from the Photos app using AVAssetExportSession is resulting in audio getting out of sync. The audio track start time is off by ~0.09 sec. On iOS 13, while there is a lag, it's only ~0.04 sec, which is virtually unnoticeable. Is anyone else experiencing this issue and is there a solution?
Hi,
We're updating our video editing app to support HDR playback/export and ran into a snag. AVPlayer (with HDR color properties) maintains the integrity of the color of text and other layers (e.g. stickers), however, AVVideoCompositionCoreAnimationTool does not. When the composition is exported, the colors of layers are being converted to HDR as well (deeper colors), which shouldn't be the case. We're using videoCompositionCoreAnimationToolWithPostProcessingAsVideoLayer.
Any help would be much appreciated!
Thanks,
Ed