Some users have reported an error editing portrait photo assets in my app:
The operation couldn’t be completed. (CINonLocalizedDescriptionKey error 3.)
What is that error? Will affected photos always encounter this error (due to data corruption for example) or can it be resolved in a future iOS update?
FB16241301
Photos & Camera
RSS for tagExplore technical aspects of capturing high-quality photos and videos, including exposure control, focus modes, and RAW capture options.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
iOS 26 added smoothness to CIRoundedRectangleGenerator, for use with CIFilter.roundedRectangleGenerator. What should the smoothness value be to achieve the same corner curve as CALayerCornerCurve.continuous? Does it need to be calculated based on the extent size, if so, how?
Can i use iokit usb lib to disable build-in camera?
Hi,
I'm developing a SwiftUI app using RealityKit and ARKit for an AR measuring feature. I’ve noticed that after navigating away from my AR view and performing extensive cleanup (including removing all anchors/entities, pausing the ARSession, and nil-ing out all references), memory usage remains elevated and sometimes grows with repeated AR sessions.
Each time I enter and exit the AR view, memory increases
The memory does not return to the baseline after cleanup, even though all custom objects are deallocated.
Are there best practices beyond what I’ve described to ensure all ARKit/RealityKit resources are released after an AR session?
i have a wallpaper app , i need a photos access when i try to add it in capabilities i don't find it.is there any solution?
Hi! I am making an app for Apple Vision pro (VisionOS 2.5) that is scanning the surroundings and recognises all the texts around you. I tried to use the AVCaptureSession library, but when I run the app from xcode on the real AVP device, the camera is not accessible. I enabled the camera access in my Info.plist: NSCameraUsageDescription Used for live text recognition and I checked camera settings in the AVP, there are no restrictions. However I have always a black square with a crossed camera icon displayed instead of the image from the camera.
I tried a couple of different apps from Github using the AVCaptureSession and they all display the black square instead of the picture.
What can be wrong with the camera?
Topic:
Media Technologies
SubTopic:
Photos & Camera
Does the library exists in xCode 16.4?
"import WorldCaptureKit" gives error "No such module 'WorldCaptureKit'".
And I do not find any information about the library in the apple documentation.
But AI keeps suggesting me to use the library
Topic:
Media Technologies
SubTopic:
Photos & Camera
Hi,
I’m building a PPG-based heart rate feature where the user places their finger over the rear telephoto camera. On iPhone 16 Pro Max, I'm explicitly selecting the telephoto lens like this:
videoDevice = AVCaptureDevice.default(.builtInTelephotoCamera, for: .video, position: .back)
And trying to lock it:
if #available(iOS 15.0, *),
device.activePrimaryConstituentDeviceSwitchingBehavior != .unsupported {
try? device.lockForConfiguration()
device.setPrimaryConstituentDeviceSwitchingBehavior(.locked, restrictedSwitchingBehaviorConditions: [])
device.unlockForConfiguration()
}
I also lock everything else to prevent dynamic changes:
try device.lockForConfiguration()
device.focusMode = .locked
device.exposureMode = .locked
device.whiteBalanceMode = .locked
device.videoZoomFactor = 1.0
device.automaticallyEnablesLowLightBoostWhenAvailable = false
device.automaticallyAdjustsVideoHDREnabled = false
device.unlockForConfiguration()
Despite this, the camera still switches to another lens, especially under different lighting, even though the user’s finger fully covers the lens.
Questions:
How can I completely prevent lens switching in this scenario?
Would using videoZoomFactor = 3.0 or 5.0 better enforce use of the telephoto lens?
Thanks!
Gal
I'm developing a video capture app using AVFoundation, designed specifically for use on a boat pylon to record slalom water skiing. This setup involves considerable vibration.
As you may know, the OIS that Apple began adding to lenses since the iPhone 7 is actually very problematic in high vibration circumstances, ironically creating very shaky video, whereas lenses without OIS produce perfectly stable video. Because of this, up until iPhone 14, the solution for my app was simply to use the Selfie lens, which did not have OIS.
Starting with iPhone 14 through iPhone 16 (non-Pro models), technical specs suggest the selfie lens still does not include OIS. However, I’m still seeing the same kind of shaky video behavior I see on OIS-equipped lenses. The one hardware change I see in this camera module is the addition of PDAF (Phase Detection Autofocus), so that is my best guess as to what is causing the unstable video.
1- Does that make any sense - that in high vibration settings, PDAF could create unstable video in the same way that OIS does? Or could it be something else that was changed between the iPhone 13 and 14 Selfie lens?
Thinking that the issue was PDAF, I figured that if I enabled my app to set a Manual Focus level, that ought to circumvent PDAF (expecting that if a lens is manually focusing, it can’t also be autofocusing via PDAF).
However, even with manual focus locked via AVCaptureDevice in my app, on the Selfie lens of an iPhone 16, the video still comes out very shaky, basically unusable. I also tested with the built-in Apple Camera app (using the press-and-hold to lock focus and exposure) and another 3rd party camera app to lock focus, all with the same results, so it's not that my app just isn't correctly doing manual focus.
So I'm stuck with these questions:
2- Does the selfie camera on iPhones 14–16 use PDAF even when focus is set to locked/manual mode?
3- Is there any way in AVFoundation to disable or suppress PDAF during video recording (e.g., a flag, device format setting, or private API)?
4- Is PDAF behavior or suppression documented or controllable via AVCaptureDevice or any related class?
5- If no control of PDAF is available, are there any best practices for stabilizing or smoothing this effect programmatically?
Note that I also have set my app to use the most aggressive form of stabilization available, so it defaults to .cinematicExtendedEnhanced, if that’s not available, then .cinematicExtended, etc. On the 16 Selfie lens, it is using .cinematicExtended. As an additional question:
6- Would those be the most appropriate stabilization settings for a high vibration environment, and if not, what would be best?
Xcode Version 16.3 (16E140)
App developed in Flutter Flutter 3.29.3
Test iPhone device: iPhone 16 Pro running iOS 18.5
I have an app that requires Camera access. This used to work before with iOS 18.4.x. I have dumbed down my app to just get Camera permission. Even then it fails
flutter: Camera permission: PermissionStatus.denied
flutter: Photos permission: PermissionStatus.denied
flutter: Microphone permission: PermissionStatus.denied
flutter: --- End Debug Info ---
flutter: Loaded translations from asset for en_US
container_create_or_lookup_app_group_path_by_app_group_identifier: client is not entitled
container_create_or_lookup_app_group_path_by_app_group_identifier: client is not entitled
container_create_or_lookup_app_group_path_by_app_group_identifier: client is not entitled
container_create_or_lookup_app_group_path_by_app_group_identifier: client is not entitled
container_create_or_lookup_app_group_path_by_app_group_identifier: client is not entitled
container_create_or_lookup_app_group_path_by_app_group_identifier: client is not entitled
flutter: CAMERA PERMISSION STATUS: PermissionStatus.permanentlyDenied
Camera permissions don't show up in my App settings or under "Settings -> Privacy and Security -> Camera" and I am at loss to understand why this is happening.
ImageIO encoding to HEICS fails in macOS 15.5.
log
writeImageAtIndex:1246: *** CMPhotoCompressionSessionAddImageToSequence: err = kCMPhotoError_UnsupportedOperation [-16994] (codec: 'hvc1')
seems to be related with
https://github.com/SDWebImage/SDWebImage/issues/3732
affected version
iOS 18.4 (sim and device), macOS 15.5
unaffected version
iOS 18.3 (sim and device), macOS 15.3
In the latest production release of our iOS app (deployed via the App Store), we’ve observed a significant increase in AVCaptureSessionWasInterrupted notifications where the interruption reason has a rawValue of 4. The session does not automatically recover, even after returning from background or deleting/reinstalling the app. An employee ran into this and was able to get a recording. We see the below error when attempting to take photos.
"Error Domain=AVFoundationErrorDomain Code=-11803 \"Cannot Record\" UserInfo={AVErrorRecordingFailureDomainKey=3, NSLocalizedDescription=Cannot Record, NSLocalizedRecoverySuggestion=Try recording again.}",
}
This interruption causes the camera preview to remain black, and any attempt to capture an image results in a failure with the following error:
Some questions from our team:
What common system conditions or foreground app behaviors can cause .videoDeviceNotAvailableWithMultipleForegroundApps (reason 4) to become persistent? Our teams under is under the impression the interruption reason 4 is mostly associated with iPad and PiP, but neither of these are true in the logs we see.
Is manual recovery of the session required?
Is there a recommended strategy to detect that the session is unrecoverable and gracefully notify the user or rebuild the session?
Is there an instrument(s) in XCode you would recommend when trying to evaluate the increase in reason 4?
Best,
Ben
My app is a camera app that supports Picture-in-Picture (PiP) mode.
Normally, when the device rotates, I get the device orientation from iOS and use it to rotate the camera feed so that the preview stays correctly aligned.
However, when the app enters PiP mode, it is considered to be in the background, and I can no longer receive orientation updates from the system.
As a result, I can’t apply rotation corrections to the camera video in PiP mode.
Is there any way to retrieve device orientation while the app is in the background (specifically during PiP mode)?
Any guidance would be greatly appreciated.
Thank you!
Hi guys,
Can I use CMIO to achieve the following feature on macOS when a USB device (Camera/Mic/Speaker) is connected:
When a third-party video conferencing app is not in a meeting, ensure the app defaults to using the USB device (Camera/Mic/Speaker).
When a third-party conferencing app is in a meeting, ensure the app automatically switches to the USB device (Camera/Mic/Speaker).
Hi guys,
How to achieve the following feature on macOS when a USB device (Camera/Mic/Speaker) is connected:
When a third-party video conferencing app is not in a meeting, ensure the app defaults to using the USB device (Camera/Mic/Speaker).
When a third-party conferencing app is in a meeting, ensure the app automatically switches to the USB device (Camera/Mic/Speaker).
I want to make use of IOKit extension to hidden or ignore build-in camera to realize the requirement.
however the extension can't be loaded for Invalid permissions in MacOS 15.4.1, buildVersion:24E263. I also tried to run in in MacOS 14.4.1, which can be loaded but can't auto load when restart laptop as KDK version not match.
Could you please give me some suggestion? Is it possible hidden build-in camera in MacOS M-series chip? Is there any other method to realize the feature. Thanks a lot.
In the AVP project, a selector pops up, only wanting to filter spatial videos. When selecting the material of one of the spatial videos, the selection result returns empty. How can we obtain the video selected by the user and get the path and the URL of the file
The code is as follows:
PhotosPicker(selection: $selectedItem, matching: .videos) {
Text("Choose a spatial photo or video")
}
func loadTransferable(from imageSelection: PhotosPickerItem) -> Progress {
return imageSelection.loadTransferable(type: URL.self) { result in
DispatchQueue.main.async {
// guard imageSelection == self.imageSelection else { return }
print("加载成功的图片集合:(result)")
switch result {
case .success(let url?):
self.selectSpatialVideoURL = url
print("获取视频链接:(url)")
case .success(nil):
break
// Handle the success case with an empty value.
case .failure(let error):
print("spatial错误:(error)")
// Handle the failure case with the provided error.
}
}
}
}
I am seeing a crash on iOS 18.0 in my app due to PHImageManager.default().requestImage. Same crash is seen even while using requestImageDataAndOrientation.
Not sure why this is happening only on iOS 18.0.
Any help on this would be appreciated.
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000010
Exception Codes: 0x0000000000000001, 0x0000000000000010
VM Region Info: 0x10 is not in any region. Bytes before following region: 4310777840
REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL
UNUSED SPACE AT START
--->
Termination Reason: SIGNAL 11 Segmentation fault: 11
Terminating Process: exc handler [695]
Triggered by Thread: 14
Thread 14 name: Dispatch queue: */file=33) .Generic
Thread 14 Crashed:
0 libobjc.A.dylib 0x1944d7020 objc_msgSend + 32
1 PhotoLibraryServices 0x1b080262c +[PLUniformTypeIdentifier utiWithCompactRepresentation:conformanceHint:] + 40
2 Photos 0x1b0081354 _resourceInfoFromResultDict + 1048
3 Photos 0x1b0080a7c fetchResourcesForChoosing + 584
4 Photos 0x1b0080714 ___fetchNonHintResources_block_invoke.227 + 152
5 PhotoLibraryServices 0x1b026b3c4 __53-[PLManagedObjectContext _directPerformBlockAndWait:]_block_invoke + 48
6 CoreData 0x19f171b00 developerSubmittedBlockToNSManagedObjectContextPerform + 228
7 libdispatch.dylib 0x19eeff584 _dispatch_client_callout + 16
8 libdispatch.dylib 0x19eef5728 _dispatch_lane_barrier_sync_invoke_and_complete + 56
9 CoreData 0x19f1c2a0c -[NSManagedObjectContext performBlockAndWait:] + 308
10 PhotoLibraryServices 0x1b026cea4 -[PLManagedObjectContext _directPerformBlockAndWait:] + 144
11 PhotoLibraryServices 0x1b026cdf8 -[PLManagedObjectContext performBlockAndWait:] + 196
12 Photos 0x1b00804a4 _fetchNonHintResources + 292
13 Photos 0x1afeedb38 PHChooserListContinueEnumerating + 144
14 Photos 0x1afeed9f8 -[PHImageResourceChooser presentNextQualifyingResource] + 412
15 Photos 0x1afeed1d0 -[PHImageRequest startRequest] + 2424
16 libdispatch.dylib 0x19eee5aac _dispatch_call_block_and_release + 32
17 libdispatch.dylib 0x19eeff584 _dispatch_client_callout + 16
18 libdispatch.dylib 0x19eeee2d0 _dispatch_lane_serial_drain + 740
19 libdispatch.dylib 0x19eeeede0 _dispatch_lane_invoke + 440
20 libdispatch.dylib 0x19eef91dc _dispatch_root_queue_drain_deferred_wlh + 292
21 libdispatch.dylib 0x19eef8a60 _dispatch_workloop_worker_thread + 540
22 libsystem_pthread.dylib 0x2214d5660 _pthread_wqthread + 292
23 libsystem_pthread.dylib 0x2214d29f8 start_wqthread + 8
I have an iOS app that includes a Photo Editing Extension and is optimized for Mac Catalyst so you can edit photos in the Photos app on your Mac. This has worked really well but now I am encountering an error alert trying to open the photo editing extension:
RBSLaunchRequest error trying to launch plugin com.company.TestEditor. TestPhotoEditor (B7A616A7-2 5A8-4E02-8B32-5CAB37C8B4B2): ErrorDomain=RBSRequestErrorDomain Code=5 "Launch failed." UserInfo={NSLocalizedFailureReason=Launch failed., NSUnderlyingError=0x7f08fafd0 {ErrorDomain=NSPOSIXErrorDomain Code=153 "Unknown error: 153" UserInfo={NSLocalizedDescription=Launchd job spawn failed}}}
Create a new iOS app project in Xcode
Create a new target and choose iOS > Photo Editing Extension
For both targets in the project, add Mac Catalyst as a supported destination
Run the app on My Mac (Mac Catalyst)
Open the Photos app, double click a photo, click Edit, click the more plugins button, and click TestPhotoEditor in the list
macOS 15.4.1 + Xcode 16.3
I'm working on an application that uses the iPhone camera for scientific purposes - and, as a result would like to receive sensor data in as unprocessed format as possible.
I'm using AVCapturePhotoOutput to take Bayer RAW stills and receiving data in kCVPixelFormatType_14Bayer_RGGB format.
However, I'm puzzled as to the content of the bits. I simply demosaic the image by taking each 2x2 square:
RG
GB
and use R, (G+G)/2, B to get 16-bit RGB values - and this indeed works.
However, I am puzzled as to the values we are getting as they seem to be approximately in the range 2048 - 16383. The top value is understandable - the maximum that you can fit in 14-bits (as implied by the pixel format type).
However we don't seem to be able to get lower than ~2048 no matter how black/dark we make the sensor.
I'm aware that the sensor is probably not 14-bits (we're using the iPhone 16e camera) and that maybe this is to do with the way the sensor data is packaged.
The Advances in iOS Photography video (https://developer.apple.com/videos/play/wwdc2016/501/) describes it as "10-bit sensor RAW packaged in 14 bits per pixel instead of eight."
Is there any documentation describing what is going on here? It's vital for our use that we get as close to the raw camera sensor light readings as possible, so any pointers as to the mapping (e.g. decompanding?) being used would be extremely useful.
Many thanks in advance for your help.
As the image access policy has changed with Android targeting SDK 34, I’m planning to update the way our app accesses photos.
We are using the react-native-image-picker library to access images.
On Android, the system no longer prompts the user for image access permissions, but on iOS, permission requests still appear.
Since Android no longer requires explicit permissions, I’ve removed the permission request logic for Android.
In this case, is it also safe to remove the permission request for iOS?
In our app, photo access is only used for changing the user profile picture and attaching images when writing a post on the bulletin board.
Are there any limitations or considerations for this kind of usage?