Post

Replies

Boosts

Views

Activity

Create CGContext from CVImageBuffer - Context is nil for specific image buffer sizes
When I tried to create CGContext from CVImageBuffer with below code CGContext(data: CVPixelBufferGetBaseAddress(pixelBuffer), width: width, height: height, bitsPerComponent: 8, bytesPerRow: CVPixelBufferGetBytesPerRow(pixelBuffer), space: CGColorSpaceCreateDeviceRGB(), bitmapInfo: CGBitmapInfo(rawValue: CGImageAlphaInfo.premultipliedFirst.rawValue).union(.byteOrder32Little).rawValue) CGContext is nil with below Error CGBitmapContextCreate: invalid data bytes/row: should be at least 8640 for 8 integer bits/component, 3 components, kCGImageAlphaPremultipliedFirst. Note: This happens only with specific image buffer size like 4k, etc. And 1080p and 720p works fine. Appreciate your help in advance!
0
0
1.3k
Aug ’22
What is an internal error while saving video to PHPhotoLibrary?
My recording was stopped due to low battery and phone shutdown. When I reopen my app, the recorded ".mov video"(around 8GB) file is not moving/copying to PHPhotoLibrary and it shows internalError which is hard to understand the exact reason for denying to add the video file to PHPhotoLibrary. Error Domain=PHPhotosErrorDomain Code=-1 \"(null)\") So How to resolve such kind of internalError while adding assets to PHPhotoLibrary? Thanks & Regards, Natarajan S
2
1
1.5k
May ’22
Create CGContext from CVImageBuffer - Context is nil for specific image buffer sizes
When I tried to create CGContext from CVImageBuffer with below code CGContext(data: CVPixelBufferGetBaseAddress(pixelBuffer), width: width, height: height, bitsPerComponent: 8, bytesPerRow: CVPixelBufferGetBytesPerRow(pixelBuffer), space: CGColorSpaceCreateDeviceRGB(), bitmapInfo: CGBitmapInfo(rawValue: CGImageAlphaInfo.premultipliedFirst.rawValue).union(.byteOrder32Little).rawValue) CGContext is nil with below Error CGBitmapContextCreate: invalid data bytes/row: should be at least 8640 for 8 integer bits/component, 3 components, kCGImageAlphaPremultipliedFirst. Note: This happens only with specific image buffer size like 4k, etc. And 1080p and 720p works fine. Appreciate your help in advance!
Replies
0
Boosts
0
Views
1.3k
Activity
Aug ’22
What is an internal error while saving video to PHPhotoLibrary?
My recording was stopped due to low battery and phone shutdown. When I reopen my app, the recorded ".mov video"(around 8GB) file is not moving/copying to PHPhotoLibrary and it shows internalError which is hard to understand the exact reason for denying to add the video file to PHPhotoLibrary. Error Domain=PHPhotosErrorDomain Code=-1 \"(null)\") So How to resolve such kind of internalError while adding assets to PHPhotoLibrary? Thanks & Regards, Natarajan S
Replies
2
Boosts
1
Views
1.5k
Activity
May ’22