Post

Replies

Boosts

Views

Activity

why does tripple camera take photo faster than single camera device?
I found this phenomenon, and it can be reproduced stably. If I use a triple-camera to take a photo, if the picture is moving, or I move the phone, let's assume it moves horizontally, when I aim at an object, I press the shutter, which is called time T. At this time, the picture in the viewfinder is T0, and the photo produced is about T+100ms. If I use a single-camera to take a photo, use the same speed to move the phone to move the picture, and press the shutter when aiming at the same object, the photo produced is about T+400ms later. Let me describe the problem I encountered in another way. Suppose a pile of cards are placed horizontally on the table, and the cards are written with numbers from left to right, 0,1,2,3,4,5,6... Now aim the camera at the number 0, and then move to the right at a uniform speed. The numbers pass through the camera's viewfinder and continue to increase. When aiming at the number 5, press the shutter. If it is a triple-camera, the photo obtained will probably show 6, while if it is taken with a single-camera, the photo obtained will be about 9. This means the triple camera can capture photos faster, but why is this the case? Any explanation?
2
0
540
Dec ’24
Why doesn't sometimes recommendedVideoSettings have recommend settings?
I am talking about AVCaptureVideoDataOutput.recommendedVideoSettings. I found sometimes it return nil, there is my test result. hevc .mov with activeColorSpace sRGB 60FPS -> ok 120FPS -> ok hevc .mov with activeColorSpace displayP3_HLG 60FPS -> nil 120FPS -> nil h264 .mov 30FPS -> ok 60FPS -> nil 120FPS -> nil so, if you don't give a recommend setting, and you don't give a document, how does developer to use it?
0
0
427
Nov ’24
sceneWillResignActive be called after app launched from CameraCaptureIntentCaptureIntent
I made a LockScreen ControlWidget with CameraCaptureIntent, but I found launch my main app from Control Widget, SceneDelegate will be called like below: sceneWillEnterForeground sceneDidBecomeActive sceneWillResignActive sceneDidBecomeActive sceneWillResignActive be called, is it normal? it make my app camera launch with a delay.
1
0
432
Nov ’24
ControlWidget can't open APP
My custom control widget is show up and I can set it to Lock Screen, but it doesn't launch my app when I clicked it. any problem? in A.swift file, code like below: @available(iOS 18.0, *) struct LockScreenAppLaunchWidget: ControlWidget { var body: some ControlWidgetConfiguration { StaticControlConfiguration(kind: "abc") { ControlWidgetButton(action: LaunchAppIntent()) { // <-- HERE Label("Something", systemImage: "arrow.up") } } .displayName("Open app") } } @available(iOS 18, *) struct LaunchAppIntent: AppIntent { static var title: LocalizedStringResource = "ABC" static var description: IntentDescription? = "abcd" static var openAppWhenRun: Bool = true @MainActor func perform() async throws -> some IntentResult & OpensIntent { return .result() } }
2
1
716
Sep ’24
Why isReadyForMoreMediaData is false sometimes?
Hi, Recording Videos with AVAssetWriter, capture fps(camera output fps) is ok, but final result video fps was lower, the reason is AVAssetWriterInput.isReadyForMoreMediaData is false sometimes. Yes, I have read document many times, it said need to set expectsMediaDataInRealTime to true and balabala... I really be tortured by this problem for a long time, can I debug this problem? or any advice?
2
0
682
Sep ’24
IOS 18: How to create a custom App 'Control' that could be display in Control List?
in ios 18, we can custom two bottom button on Lock Screen, in past, they are Flash and Camera. So I want my app's function could be display in here, and I custom it, and will show a Controls List, But I can not found my app's icon. How to make a myself Control item and add it to Control List? any guideline or tutorials are welcome :D
0
0
464
Sep ’24
take raw photo, photoOutput error: Domain=AVFoundationErrorDomain Code=-11800, Domain=NSOSStatusErrorDomain Code=-16415
Error Domain=AVFoundationErrorDomain Code=-11800 "这项操作无法完成" UserInfo={NSUnderlyingError=0x1102b4940 {Error Domain=NSOSStatusErrorDomain Code=-16415 "(null)"}, NSLocalizedFailureReason=发生未知错误(-16415), AVErrorRecordingFailureDomainKey=4, NSLocalizedDescription=这项操作无法完成}
3
2
2k
Nov ’22
Playing a sound effect before record video makes video's sound volume is low
I am using AudioService API to play a sound effect before start video recoding, I found a weird thing that the final result video's volume is relative to sound effect volume. if sound effect volume is big, the final video's volume became so low, if sound effect volume is quite, final video's volume is big. I think the iphone's microphone or audio framework make this, maybe it detected the peak volume and balance audio record volume. I use 'playAndRecord' to record video, dosen't change it when play sound effect. need help to slove this issue, i want the video's volume is constants
0
0
821
Aug ’22
iOS 15.4 iphone12pro, iphone12pro max capture depth start session failed
recently, we recevied many portrait mode issue about camera couldn't be launched. there is the error report from Notification notification: name = AVCaptureSessionRuntimeErrorNotification, object = Optional(<AVCaptureSession: 0x282f5c830 [AVCaptureSessionPresetPhoto]> <AVCaptureDeviceInput: 0x282d1fc40 [Back Dual Cam]>[vide] -> <AVCapturePhotoOutput: 0x282d2adc0> <AVCaptureDeviceInput: 0x282d1fc40 [Back Dual Cam]>[vide] -> <AVCaptureVideoDataOutput: 0x282d26f40> <AVCaptureDeviceInput: 0x282d1fc40 [Back Dual Cam]>[dpth] -> <AVCaptureDepthDataOutput: 0x282d361a0>), userInfo = Optional([AnyHashable("AVCaptureSessionErrorKey"): Error Domain=AVFoundationErrorDomain Code=-11819 "The operation could not be completed" UserInfo={NSLocalizedDescription=The operation could not be completed, NSLocalizedRecoverySuggestion=}]) 2022-04-06 12:11:15.969 < i > Thread: main [CaptureManager] onAVCaptureSessionRuntimeError: related decl 'e' for AVError(_nsError: Error Domain=AVFoundationErrorDomain Code=-11819 "The operation could not be completed" UserInfo={NSLocalizedDescription=The operation could not be completed, NSLocalizedRecoverySuggestion=}) code: -11819 session.isRunning: false I don't know how to fix this, other device is ok in ios 15.4 we can't re produce this problem
0
0
852
Apr ’22
3d texture sampler problem
I am using a color lookup table to create a 3d texture, and use input color to find output color. but I found output color has some interrupt layer. Is this sampler sample 3d texture by using trilinear? This is my code for creating 3d texture the lutData is a array of r, g, b, a, r, g, b, a, .... lutSize is the lookup table size, it's 32 or 64. func create3DTextureFromLutData(lutData: [Float], lutSize: Int) - MTLTexture? {     let desc = MTLTextureDescriptor()     desc.textureType = .type3D     desc.pixelFormat = .rgba32Float     desc.width = lutSize     desc.height = lutSize     desc.depth = lutSize     desc.usage = .shaderRead           guard let texture = _device.makeTexture(descriptor: desc) else { return nil}           texture.replace(region: MTLRegion(origin: .init(x: 0, y: 0, z: 0), size: .init(width: lutSize, height: lutSize, depth: lutSize)), mipmapLevel: 0, slice: 0, withBytes: lutData, bytesPerRow: lutSize * MemoryLayoutFloat.size * 4, bytesPerImage: lutSize * lutSize * MemoryLayoutFloat.size * 4)           return texture   } and in my shader, I just want to sample it like this. metal constexpr sampler textureSampler = sampler(mag_filter::linear, min_filter::linear, mip_filter::linear, address::clamp_to_edge); half4 lutWith3dTexture(half4 inputColor, short lutSize, half lutStrength, texture3dfloat, access::sample lut3dTexture, sampler textureSampler) {   half4 originColor = inputColor;   float3 coor = float3(((inputColor.rgb * (lutSize - 1)) + 0.5) / lutSize);   half4 resultColor = half4(lut3dTexture.sample(textureSampler, coor));       return mix(originColor, resultColor, lutStrength); } I am trying different filter::xxxx didn't help anything.
1
0
1k
May ’21
When saving a 48MP image, CGImageDestinationFinalize consumes a large amount of memory. Are there any optimization methods available?
it will use about 300MB memory, it cause a memory peak
Replies
1
Boosts
0
Views
512
Activity
Jul ’25
why does tripple camera take photo faster than single camera device?
I found this phenomenon, and it can be reproduced stably. If I use a triple-camera to take a photo, if the picture is moving, or I move the phone, let's assume it moves horizontally, when I aim at an object, I press the shutter, which is called time T. At this time, the picture in the viewfinder is T0, and the photo produced is about T+100ms. If I use a single-camera to take a photo, use the same speed to move the phone to move the picture, and press the shutter when aiming at the same object, the photo produced is about T+400ms later. Let me describe the problem I encountered in another way. Suppose a pile of cards are placed horizontally on the table, and the cards are written with numbers from left to right, 0,1,2,3,4,5,6... Now aim the camera at the number 0, and then move to the right at a uniform speed. The numbers pass through the camera's viewfinder and continue to increase. When aiming at the number 5, press the shutter. If it is a triple-camera, the photo obtained will probably show 6, while if it is taken with a single-camera, the photo obtained will be about 9. This means the triple camera can capture photos faster, but why is this the case? Any explanation?
Replies
2
Boosts
0
Views
540
Activity
Dec ’24
Why doesn't sometimes recommendedVideoSettings have recommend settings?
I am talking about AVCaptureVideoDataOutput.recommendedVideoSettings. I found sometimes it return nil, there is my test result. hevc .mov with activeColorSpace sRGB 60FPS -> ok 120FPS -> ok hevc .mov with activeColorSpace displayP3_HLG 60FPS -> nil 120FPS -> nil h264 .mov 30FPS -> ok 60FPS -> nil 120FPS -> nil so, if you don't give a recommend setting, and you don't give a document, how does developer to use it?
Replies
0
Boosts
0
Views
427
Activity
Nov ’24
sceneWillResignActive be called after app launched from CameraCaptureIntentCaptureIntent
I made a LockScreen ControlWidget with CameraCaptureIntent, but I found launch my main app from Control Widget, SceneDelegate will be called like below: sceneWillEnterForeground sceneDidBecomeActive sceneWillResignActive sceneDidBecomeActive sceneWillResignActive be called, is it normal? it make my app camera launch with a delay.
Replies
1
Boosts
0
Views
432
Activity
Nov ’24
ControlWidget can't open APP
My custom control widget is show up and I can set it to Lock Screen, but it doesn't launch my app when I clicked it. any problem? in A.swift file, code like below: @available(iOS 18.0, *) struct LockScreenAppLaunchWidget: ControlWidget { var body: some ControlWidgetConfiguration { StaticControlConfiguration(kind: "abc") { ControlWidgetButton(action: LaunchAppIntent()) { // <-- HERE Label("Something", systemImage: "arrow.up") } } .displayName("Open app") } } @available(iOS 18, *) struct LaunchAppIntent: AppIntent { static var title: LocalizedStringResource = "ABC" static var description: IntentDescription? = "abcd" static var openAppWhenRun: Bool = true @MainActor func perform() async throws -> some IntentResult & OpensIntent { return .result() } }
Replies
2
Boosts
1
Views
716
Activity
Sep ’24
Why isReadyForMoreMediaData is false sometimes?
Hi, Recording Videos with AVAssetWriter, capture fps(camera output fps) is ok, but final result video fps was lower, the reason is AVAssetWriterInput.isReadyForMoreMediaData is false sometimes. Yes, I have read document many times, it said need to set expectsMediaDataInRealTime to true and balabala... I really be tortured by this problem for a long time, can I debug this problem? or any advice?
Replies
2
Boosts
0
Views
682
Activity
Sep ’24
IOS 18: How to create a custom App 'Control' that could be display in Control List?
in ios 18, we can custom two bottom button on Lock Screen, in past, they are Flash and Camera. So I want my app's function could be display in here, and I custom it, and will show a Controls List, But I can not found my app's icon. How to make a myself Control item and add it to Control List? any guideline or tutorials are welcome :D
Replies
0
Boosts
0
Views
464
Activity
Sep ’24
take raw photo, photoOutput error: Domain=AVFoundationErrorDomain Code=-11800, Domain=NSOSStatusErrorDomain Code=-16415
Error Domain=AVFoundationErrorDomain Code=-11800 "这项操作无法完成" UserInfo={NSUnderlyingError=0x1102b4940 {Error Domain=NSOSStatusErrorDomain Code=-16415 "(null)"}, NSLocalizedFailureReason=发生未知错误(-16415), AVErrorRecordingFailureDomainKey=4, NSLocalizedDescription=这项操作无法完成}
Replies
3
Boosts
2
Views
2k
Activity
Nov ’22
Is there a way encode/decode portion of a huge Image?
if there is a huge image(10000x10000), loading it into memory will cause crash every time. so, can I load a portion of image into memory and process it, and write back this part to image file?
Replies
0
Boosts
0
Views
1.2k
Activity
Oct ’22
Playing a sound effect before record video makes video's sound volume is low
I am using AudioService API to play a sound effect before start video recoding, I found a weird thing that the final result video's volume is relative to sound effect volume. if sound effect volume is big, the final video's volume became so low, if sound effect volume is quite, final video's volume is big. I think the iphone's microphone or audio framework make this, maybe it detected the peak volume and balance audio record volume. I use 'playAndRecord' to record video, dosen't change it when play sound effect. need help to slove this issue, i want the video's volume is constants
Replies
0
Boosts
0
Views
821
Activity
Aug ’22
iOS 15.4 iphone12pro, iphone12pro max capture depth start session failed
recently, we recevied many portrait mode issue about camera couldn't be launched. there is the error report from Notification notification: name = AVCaptureSessionRuntimeErrorNotification, object = Optional(<AVCaptureSession: 0x282f5c830 [AVCaptureSessionPresetPhoto]> <AVCaptureDeviceInput: 0x282d1fc40 [Back Dual Cam]>[vide] -> <AVCapturePhotoOutput: 0x282d2adc0> <AVCaptureDeviceInput: 0x282d1fc40 [Back Dual Cam]>[vide] -> <AVCaptureVideoDataOutput: 0x282d26f40> <AVCaptureDeviceInput: 0x282d1fc40 [Back Dual Cam]>[dpth] -> <AVCaptureDepthDataOutput: 0x282d361a0>), userInfo = Optional([AnyHashable("AVCaptureSessionErrorKey"): Error Domain=AVFoundationErrorDomain Code=-11819 "The operation could not be completed" UserInfo={NSLocalizedDescription=The operation could not be completed, NSLocalizedRecoverySuggestion=}]) 2022-04-06 12:11:15.969 < i > Thread: main [CaptureManager] onAVCaptureSessionRuntimeError: related decl 'e' for AVError(_nsError: Error Domain=AVFoundationErrorDomain Code=-11819 "The operation could not be completed" UserInfo={NSLocalizedDescription=The operation could not be completed, NSLocalizedRecoverySuggestion=}) code: -11819 session.isRunning: false I don't know how to fix this, other device is ok in ios 15.4 we can't re produce this problem
Replies
0
Boosts
0
Views
852
Activity
Apr ’22
3d texture sampler problem
I am using a color lookup table to create a 3d texture, and use input color to find output color. but I found output color has some interrupt layer. Is this sampler sample 3d texture by using trilinear? This is my code for creating 3d texture the lutData is a array of r, g, b, a, r, g, b, a, .... lutSize is the lookup table size, it's 32 or 64. func create3DTextureFromLutData(lutData: [Float], lutSize: Int) - MTLTexture? {     let desc = MTLTextureDescriptor()     desc.textureType = .type3D     desc.pixelFormat = .rgba32Float     desc.width = lutSize     desc.height = lutSize     desc.depth = lutSize     desc.usage = .shaderRead           guard let texture = _device.makeTexture(descriptor: desc) else { return nil}           texture.replace(region: MTLRegion(origin: .init(x: 0, y: 0, z: 0), size: .init(width: lutSize, height: lutSize, depth: lutSize)), mipmapLevel: 0, slice: 0, withBytes: lutData, bytesPerRow: lutSize * MemoryLayoutFloat.size * 4, bytesPerImage: lutSize * lutSize * MemoryLayoutFloat.size * 4)           return texture   } and in my shader, I just want to sample it like this. metal constexpr sampler textureSampler = sampler(mag_filter::linear, min_filter::linear, mip_filter::linear, address::clamp_to_edge); half4 lutWith3dTexture(half4 inputColor, short lutSize, half lutStrength, texture3dfloat, access::sample lut3dTexture, sampler textureSampler) {   half4 originColor = inputColor;   float3 coor = float3(((inputColor.rgb * (lutSize - 1)) + 0.5) / lutSize);   half4 resultColor = half4(lut3dTexture.sample(textureSampler, coor));       return mix(originColor, resultColor, lutStrength); } I am trying different filter::xxxx didn't help anything.
Replies
1
Boosts
0
Views
1k
Activity
May ’21