Integrate photo, audio, and video content into your apps.

Posts under Media tag

200 Posts

Post

Replies

Boosts

Views

Activity

replay broken on ios 16 safari with application/x-mpegURL (HLS)
Hi, Replay doesn't work on HLS videos (.m3u8) on ios 16 safari when you get to the end of a video. It works on .mp4s, .movs, etc. I have written a github issue on the videojs repo here: https://github.com/videojs/video.js/issues/8345 But i'm starting to think its the new native ios 16 player that is causing issues and not the library itself.
0
0
924
Jul ’23
Unexpected errors when using AVPlayer in iOS 16
Hi, I'm trying to add a video to my first iOS app. From the tutorials I've read online, this seemed to be a simple process of creating a AVPlayer, providing a URL to the video file and using onAppear to start the video playing when the view is shown. Below is a simplified version of the code I'm using in my app: struct ContentView: View {   let avPlayer = AVPlayer(url: Bundle.main.url(forResource: "Intro", withExtension: "mp4")!)   var body: some View {     VStack{       VideoPlayer(player: avPlayer)         .onAppear{           avPlayer.play()         }     }   } } When I run this code, the video plays but when it finishes playing I receive the following errors in the Xcode output window: 2023-01-27 11:56:39.530526+1100 TestVideo[29859:2475750] [api] -[CIImage initWithCVPixelBuffer:options:] failed because the buffer is nil. 2023-01-27 11:56:39.676462+1100 TestVideo[29859:2475835] [TextIdentificationService] Text LID dominant failure: lidInconclusive 2023-01-27 11:56:39.676822+1100 TestVideo[29859:2475835] [VisualTranslationService] Visual isTranslatable: NO; not offering translation: lidInconclusive 2023-01-27 11:56:40.569337+1100 TestVideo[29859:2476091] Metal API Validation Enabled I have googled each of these error messages but have not been able to find any information explaining exactly what they mean or how to eliminate them. I am using Xcode 14.2 and testing on iOS 16.2. If anyone could please point me in the right direction of how to understand and eliminate these errors I'd really appreciate it. Thanks!
4
3
2.9k
Jul ’23
MPNowPlayingInfoCenter not fully available if player playback controls disabled
If I disable playback controls for an AVPlayer (showsPlaybackControls), some feature of MPNowPlayingInfoCenter no longer working. (play/pause, skip forward and backward). I need custom video and audio controls on my AVPlayer in my app, that's why I disabled the iOS playback controls. But I also need the features of the MPNowPlayingInfoCenter. Is there another solution to achieve this?
1
0
1.1k
Jul ’23
Cinematic Video with AVAsynchronousCIImageFilteringRequest
Are there plans to expose the cinematic frames (e.g. disparity) to a AVAsynchronousCIImageFilteringRequest? I want to use my own lens blur shader on the cinematic frames. Right now it looks like the cinematic frames are only available in a AVAsynchronousVideoCompositionRequest like this: guard let sourceFrame = SourceFrame(request: request, cinematicCompositionInfo: cinematicCompositionInfo) else { return } let disparity = sourceFrame.disparityBuffer
0
0
668
Jul ’23
Permissions when creating an album for an app and saving media
I am trying to create an album for an app in photo_kit and store images in it, is there any way to do this under the NSPhotoLibraryAddUsageDescription permission? At first glance, using NSPhotoLibraryAddUsageDescription seems to be the best choice for this app, since I will not be loading any images. However, there are two album operations that can only be done under NSPhotoLibraryUsageDescription. Creating an album Even though the creation of an album does not involve loading media, it is necessary to use NSPhotoLibraryUsageDescription to allow users to load media. This is a bit unconvincing. Saving images in the created album Before saving, you must check to see if the app has already created the album. You need to fetch the name as a key. This is where NSPhotLibraryUsageDescription is needed. I understand that the NSPhotLibraryUsageDescription is needed for fetching, but if iOS forbids the creation of albums with the same name and ignores attempts to create an album with an already existing name, this fetching will not be necessary. In summary, I just want to create an album for my app and store media in it, but in order to do so I need to get permission from the user to read into the photos, which goes against the idea that the permissions I request should be minimal and only what I need. If there is a way to do this under the NSPhotoLibraryAddUsageDescription permission I would like to know, I am new to Swift so sorry if I am wrong.
1
0
1.2k
Jul ’23
Why does video volume goes down after mic permission is granted on iOS browser?
Background I am building a web app where users can talk to a microphone and watch dynamic video that changes depending on what they say. Here is a sample flow: User accesses the page Mic permission popup appears, user grants it User presses start buttton, standby video starts playing and mic turns on User speaks something, the speech gets turned to text, analyzed, and based on that, the src changes The new video plays, mic turns on, the loop continues. Problem The problem in iOS is that volume goes down dramatically to a level where it is hard to hear on max volume if mic access is granted. iPhone's volume up/down buttons don't help much either. That results in a terrible UX. I think the OS is forcefully keeping the volume down, but I could not find any documentation about it. On the contrary, if mic permission not granted, the volume does not change, video plays in a normal volume. Question Why does it happen and what can I do prevent volume going down automatically? Any help would be appreciated. This will not happen in PC(MacOS, Windows) or Android OS. Has anyone had any similar experience before? Context For context: I have two tags(positioned:absolute, with and height 100%) that are switched(by toggling z-indexs) to appear one on top of the other. This is to hide load, buffer and black screen from the user for better UX. If the next video is loaded and can play, then they are switched places. both tags have playsinline to enable inline play as required by webKit. both tags start out muted, muted is removed after play starts. video.play() is initiated after user grants mic permission Tech stack NextJS with Typescript, latest versions Testing on latest Chrome and Safari on iOS 16 fully updated
2
1
1.5k
Jun ’23
nominalFrameRate is 30 for 240 slow motion video
I am currently working on a SwiftUI video app. When I load a slow motion video being in 240 IPS (239.68), I use "asset.loadTracks" and then ".load(.nominalFrameRate)" which returns 30 IPS (29.xx), asset being AVAsset(url: ). And the duration in asset.load(.duration) is also 8 times bigger than original duration. Do you know how to get this 239.68 displayed in the Apple Photo app ? Is it stored somewhere in the video metadata or is it computed ?
0
0
883
Jun ’23
PhotosPickerItem‘s loadTransferable method has a problem with some raw format photos
item.loadTransferable(type: Data.self) { result in switch result { case .success(let data): guard let data = data, let image = UIImage(data: data) else { break } imageView.image = image case .failure(let error): ... } } I load the raw format photo through the above code, but the displayed image is very blurry and messed up. But not all raw format photos will be like this, what is the reason?
0
0
725
May ’23
Bracketed capture photos have badly clipped highlights
Bracketed photo capture with iPhone 14 Pro produces photos with oddly clipped highlights. Rather than pixel values clipping normally to white when too bright, there is a sudden and harsh jump from gray to white. See image below that shows a comparison of a normal photo capture (using qualityPriorization .speed) and a bracketed capture. Note the massive difference in clipping behavior. Here's how I am configuring the bracketed capture: let bracketedStillImageSettings = AVCaptureAutoExposureBracketedStillImageSettings.autoExposureSettings(exposureTargetBias: 0.0) let bracketSettings = AVCapturePhotoBracketSettings(rawPixelFormatType: 0 as OSType, processedFormat: [AVVideoCodecKey: AVVideoCodecType.jpeg], bracketedSettings: [bracketedStillImageSettings]) photoOutput.capturePhoto(with: bracketSettings, delegate: photoCaptureProcessor) Things I've tried that don't make a difference: Changing AVCapturePhotoBracketSettings.photoQualityPrioritization to values of .speed, .balanced, or .quality Changing device type .builtInTripleCamera, .builtInUltraWideCamera, .builtInWideCamera, .builtInDualCamera, etc Changing capture format from jpeg to hevc Any ideas?
0
0
912
May ’23
IOS App Ionic Vue Problem with Video
I have implemented an app with ionicvue. On one page I want to display videos with the HTML5 video control, e.g. video src="https://media.geeksforgeeks.org/wp-content/uploads/20210314115545/sample-video.mp4" .... it works on web, on android, but it does not work on iOS. There is only a play button with a strike through line I have tried all of the available option conbinations (controls playsinline webkit-playsinline etc.) but it does not help. Any Ideas? Thanks a lot Alex
1
0
906
Apr ’23
adding a slideshow to webview app
hello I have created a webview app but it got rejected for not being interactive enough or not using iOS features. so I want to put an image slideshow in. however I get an error code when trying to put the code in code-block // //  ContentView.swift //  BEMCO iOS // //  Created by Lewis Dunn on 06/01/2023. // import SwiftUI import WebKit import UIKit struct ContentView_Previews: PreviewProvider {     static var previews: some View {         ContentView()     } } struct ContentView: View {     let webView = WebView(request: URLRequest(url: URL(string: "https://www.apple.com")!))     var body: some View {         VStack {             webView             HStack {                 Button(action: {                     self.webView.goBack()                 }) {                     Image(systemName: "arrowshape.left")                         .font(.title)                         .foregroundColor(.blue)                     }                 Spacer()                 Button(action: {                     self.webView.goHome()                 }) {                     Image(systemName: "house.fill")                         .font(.title)                         .foregroundColor(.blue)                 }                 Spacer()                 Button(action: {                     self.webView.goForward()                 }) {                     Image(systemName: "arrowshape.right")                         .font(.title)                         .foregroundColor(.blue)                 }             }         }     } } struct WebView: UIViewRepresentable {     let request: URLRequest     private var webView: WKWebView?     init (request: URLRequest) {         self.webView = WKWebView()         self.request = request     }     func makeUIView(context: Context) -> WKWebView { return webView!     }     func updateUIView(_ uiView: WKWebView, context: Context) {         uiView.load(request)     }     func goBack() {     webView?.goBack()   }     func goForward() {   webView?.goForward()     }     func goHome() {         webView?.load(request)     } } @State private var currentIndex = 0 _**(error is here: property wrappers are not supported in top level code) **_ let images : [String] = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19"] var body : some View {     VStack {         Image(images[currentIndex])             .resizable()             .scaledToFit()         HStack{             ForEach(0..<images.count){ index in                 Circle()                     .fill(self.currentIndex == index ? Color.gray : Color.blue) _**(cannot find self in scope)**_                     .frame(width: 10, height: 10)             }         }         .onAppear{             print("Appear")             // We are going to use Timers             Timer.scheduledTimer(withTimeInterval: 2, repeats: true){ timer in                 if self.currentIndex + 1 == self.images.count{                     self.currentIndex = 0                 }else{                     self.currentIndex += 1                 }             }         }     } }
4
0
1.1k
Apr ’23
adding slideshow to app
hello I am trying to add a slideshow to my app but I am getting 2 error messages and 1 warning the code is as follows: // ContentView.swift // BEMCO iOS // // Created by Lewis Dunn on 06/01/2023. // import SwiftUI import WebKit import UIKit struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } } struct MainView : View { var body : some View { VStack { } } struct MainViewController : UIViewControllerRepresentable { func makeUIViewController(context: UIViewControllerRepresentableContext<MainViewController>) -> UIHostingController<MainView> { return UIHostingController(rootView: MainView()) } func updateUIViewController(_ uiViewController: UIHostingController<MainView>, context: UIViewControllerRepresentableContext<MainViewController>) { let viewController = UIHostingController<MainViewController>(rootView:MainViewController())} } } struct ContentView: View { let webView = WebView(request: URLRequest(url: URL(string: "https://www.bemcouk.com")!)) var body: some View { VStack { webView HStack { Button(action: { self.webView.goBack() }) { Image(systemName: "arrowshape.left") .font(.title) .foregroundColor(.blue) } Spacer() Button(action: { self.webView.goHome() }) { Image(systemName: "house.fill") .font(.title) .foregroundColor(.blue) } Spacer() Button(action: { self.webView.goForward() }) { Image(systemName: "arrowshape.right") .font(.title) .foregroundColor(.blue) } } } } } struct WebView: UIViewRepresentable **{**2 errors are here _"UIViewRepresentable' requires the types 'some View' and 'Never' be equivalent _ and the other error is _"Type 'WebView' does not conform to protocol 'UIViewRepresentable'_** let request: URLRequest private var webView: WKWebView? init (request: URLRequest) { self.webView = WKWebView() self.request = request } func makeUIView(context: Context) -> WKWebView { return webView! } func updateUIView(_ uiView: WKWebView, context: Context) { uiView.load(request) } func goBack() { webView?.goBack() } func goForward() { webView?.goForward() } func goHome() { webView?.load(request) } @State private var currentIndex = 0 let images : [String] = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19"] let imagesCount = 19 var body : some View { VStack { Image(images[currentIndex]) .resizable() .scaledToFit() HStack{ ForEach(0..<imagesCount){ index in **warning is here. Non-constant range: argument must be an integer literal** Circle() .fill(self.currentIndex == index ? Color.gray : Color.blue) .frame(width: 10, height: 10) } } .onAppear{ print("Appear") // We are going to use Timers Timer.scheduledTimer(withTimeInterval: 2, repeats: true){ timer in if self.currentIndex + 1 == self.images.count{ self.currentIndex = 0 }else{ self.currentIndex += 1 } } } } } }
0
0
615
Mar ’23
HELP!! Please teach me, How can I create profile of photos in Mac?
Recently, I have matter of should change color of so many photos about 80000 picts. But, It's to hard to change it one by one. Actually, I want to change color with ''Match to image with ColorSync profile" of "Automator". But, I don't know some method to do it. Please teach me some method to do it. Should Ito create some profile in mac? Or, Should I search for other method? If I can create some profile, Please teach me the method both. (The pictures are taken by old film camera. There are already changed to digital image.) (They have color of "sepia color". I have to change color to "Normal".)
0
0
1.2k
Mar ’23
Video with different audio and video durations for HLS playback
I am trying to generate ABR manifest for a video that has a slightly longer video stream than audio stream. Running mediastreamvalidator tool on the manifest I get an error "Different content duration detected between discontinuities". I assume it is caused by my generated manifest having video segments extent past the last audio segments in seconds. Should I shorten the video playback to be the shorter between the two? Should I pad out the video with empty segments so that both streams have the same duration?
4
0
1.4k
Mar ’23
AVVideoCompositionCoreAnimationTool and AVAssetExportSession freezes the app randomly
Hi there, So I've been banging my head for the last week, because we have an issue in our app where it's freezing on export while the composition has a AVVideoCompositionCoreAnimationTool as animationTool Before extracting the code to an app I can share, or submit a TSIs, I was wondering if this rings a bell to someone. Basically, we're not doing something too crazy We create an AVAssetExportSession from a composition, some audio and some layers to animate.     func makeExportable(configuration: ExportConfiguration) throws -> AVAssetExportSession {         if let animationLayer {             let rect = CGRect(origin: .zero, size: configuration.videoSize)             let videoAnimationLayer = CALayer()             videoAnimationLayer.frame = rect             let videoLayer = CALayer()             videoLayer.frame = rect             videoAnimationLayer.addSublayer(videoLayer)             videoAnimationLayer.addSublayer(animationLayer)             videoAnimationLayer.isGeometryFlipped = true             let animationTool = AVVideoCompositionCoreAnimationTool(postProcessingAsVideoLayer: videoLayer,                                                                     in: videoAnimationLayer)             avVideoComposition.animationTool = animationTool         }         guard             let session = AVAssetExportSession(asset: avComposition,                                                presetName: configuration.avAssetExportPresetName) else {             throw CompositionError.invalidExportSession         }         session.audioMix = audioMix         session.videoComposition = avVideoComposition         return session)     } Then we run await session.export() If we do that multiple times in a row (there are no specific triggers, I can have a 3s video with 40 CALayers or a 30s with 1500 layers, it could happen on the first export or the 20th, ...), then at some point, the app will just have a severe hang with the following stack trace (if I pause the debug session). If ever, I remove the avVideoComposition.animationTool = animationTool line from the export session creation, then the app does not hang... Also, I encounter the issue with the fact that it's crashing on a sim but running fine on a device. Some api_misuse crash (see [here)]. Could this be related, idk...(https://developer.apple.com/forums/thread/133681) Anyway... Completely stuck here, and surprised that such a thing would have an issue on AVFoundation. We're probably not the onliest using CoreAnimation on a video export... Thanks! Marian
4
4
1.8k
Mar ’23
I can’t save a large video on my iPhone
The problem is, I have a video file which is about 111MB with resolution 1216x2160 aaaand I can’t save it on my iPhone even though I have a plenty enough space 😭 I tried to send it via airdrop and it shows a pop up with an error and ask me if I want to save it in my documents (I tried this one as well and there’s no way to save it in my gallery from the app), I tried to send a file via telegram and also get the same error. What should I do? I can’t believe that I can shoot in 4K, but can’t save a video with a higher resolution on my iPhone
1
0
1.9k
Feb ’23
Memory change photo order when music changes
Hi, when I try to make a memory of an album it keeps the order the photos are on in that album. However, if I change the music the order of the photos changes. Is this the expected behavior? Could we have it so that it doesn’t change the order?
Replies
1
Boosts
0
Views
790
Activity
Jul ’23
replay broken on ios 16 safari with application/x-mpegURL (HLS)
Hi, Replay doesn't work on HLS videos (.m3u8) on ios 16 safari when you get to the end of a video. It works on .mp4s, .movs, etc. I have written a github issue on the videojs repo here: https://github.com/videojs/video.js/issues/8345 But i'm starting to think its the new native ios 16 player that is causing issues and not the library itself.
Replies
0
Boosts
0
Views
924
Activity
Jul ’23
Unexpected errors when using AVPlayer in iOS 16
Hi, I'm trying to add a video to my first iOS app. From the tutorials I've read online, this seemed to be a simple process of creating a AVPlayer, providing a URL to the video file and using onAppear to start the video playing when the view is shown. Below is a simplified version of the code I'm using in my app: struct ContentView: View {   let avPlayer = AVPlayer(url: Bundle.main.url(forResource: "Intro", withExtension: "mp4")!)   var body: some View {     VStack{       VideoPlayer(player: avPlayer)         .onAppear{           avPlayer.play()         }     }   } } When I run this code, the video plays but when it finishes playing I receive the following errors in the Xcode output window: 2023-01-27 11:56:39.530526+1100 TestVideo[29859:2475750] [api] -[CIImage initWithCVPixelBuffer:options:] failed because the buffer is nil. 2023-01-27 11:56:39.676462+1100 TestVideo[29859:2475835] [TextIdentificationService] Text LID dominant failure: lidInconclusive 2023-01-27 11:56:39.676822+1100 TestVideo[29859:2475835] [VisualTranslationService] Visual isTranslatable: NO; not offering translation: lidInconclusive 2023-01-27 11:56:40.569337+1100 TestVideo[29859:2476091] Metal API Validation Enabled I have googled each of these error messages but have not been able to find any information explaining exactly what they mean or how to eliminate them. I am using Xcode 14.2 and testing on iOS 16.2. If anyone could please point me in the right direction of how to understand and eliminate these errors I'd really appreciate it. Thanks!
Replies
4
Boosts
3
Views
2.9k
Activity
Jul ’23
MPNowPlayingInfoCenter not fully available if player playback controls disabled
If I disable playback controls for an AVPlayer (showsPlaybackControls), some feature of MPNowPlayingInfoCenter no longer working. (play/pause, skip forward and backward). I need custom video and audio controls on my AVPlayer in my app, that's why I disabled the iOS playback controls. But I also need the features of the MPNowPlayingInfoCenter. Is there another solution to achieve this?
Replies
1
Boosts
0
Views
1.1k
Activity
Jul ’23
Does Swift support saving videos from `Data` to the Photos app?
Can I do the same with the image? PHAssetChangeRequest.creationRequestForAsset(from: UIImage(data: bytes)
Replies
2
Boosts
0
Views
1.2k
Activity
Jul ’23
Cinematic Video with AVAsynchronousCIImageFilteringRequest
Are there plans to expose the cinematic frames (e.g. disparity) to a AVAsynchronousCIImageFilteringRequest? I want to use my own lens blur shader on the cinematic frames. Right now it looks like the cinematic frames are only available in a AVAsynchronousVideoCompositionRequest like this: guard let sourceFrame = SourceFrame(request: request, cinematicCompositionInfo: cinematicCompositionInfo) else { return } let disparity = sourceFrame.disparityBuffer
Replies
0
Boosts
0
Views
668
Activity
Jul ’23
Permissions when creating an album for an app and saving media
I am trying to create an album for an app in photo_kit and store images in it, is there any way to do this under the NSPhotoLibraryAddUsageDescription permission? At first glance, using NSPhotoLibraryAddUsageDescription seems to be the best choice for this app, since I will not be loading any images. However, there are two album operations that can only be done under NSPhotoLibraryUsageDescription. Creating an album Even though the creation of an album does not involve loading media, it is necessary to use NSPhotoLibraryUsageDescription to allow users to load media. This is a bit unconvincing. Saving images in the created album Before saving, you must check to see if the app has already created the album. You need to fetch the name as a key. This is where NSPhotLibraryUsageDescription is needed. I understand that the NSPhotLibraryUsageDescription is needed for fetching, but if iOS forbids the creation of albums with the same name and ignores attempts to create an album with an already existing name, this fetching will not be necessary. In summary, I just want to create an album for my app and store media in it, but in order to do so I need to get permission from the user to read into the photos, which goes against the idea that the permissions I request should be minimal and only what I need. If there is a way to do this under the NSPhotoLibraryAddUsageDescription permission I would like to know, I am new to Swift so sorry if I am wrong.
Replies
1
Boosts
0
Views
1.2k
Activity
Jul ’23
Why does video volume goes down after mic permission is granted on iOS browser?
Background I am building a web app where users can talk to a microphone and watch dynamic video that changes depending on what they say. Here is a sample flow: User accesses the page Mic permission popup appears, user grants it User presses start buttton, standby video starts playing and mic turns on User speaks something, the speech gets turned to text, analyzed, and based on that, the src changes The new video plays, mic turns on, the loop continues. Problem The problem in iOS is that volume goes down dramatically to a level where it is hard to hear on max volume if mic access is granted. iPhone's volume up/down buttons don't help much either. That results in a terrible UX. I think the OS is forcefully keeping the volume down, but I could not find any documentation about it. On the contrary, if mic permission not granted, the volume does not change, video plays in a normal volume. Question Why does it happen and what can I do prevent volume going down automatically? Any help would be appreciated. This will not happen in PC(MacOS, Windows) or Android OS. Has anyone had any similar experience before? Context For context: I have two tags(positioned:absolute, with and height 100%) that are switched(by toggling z-indexs) to appear one on top of the other. This is to hide load, buffer and black screen from the user for better UX. If the next video is loaded and can play, then they are switched places. both tags have playsinline to enable inline play as required by webKit. both tags start out muted, muted is removed after play starts. video.play() is initiated after user grants mic permission Tech stack NextJS with Typescript, latest versions Testing on latest Chrome and Safari on iOS 16 fully updated
Replies
2
Boosts
1
Views
1.5k
Activity
Jun ’23
nominalFrameRate is 30 for 240 slow motion video
I am currently working on a SwiftUI video app. When I load a slow motion video being in 240 IPS (239.68), I use "asset.loadTracks" and then ".load(.nominalFrameRate)" which returns 30 IPS (29.xx), asset being AVAsset(url: ). And the duration in asset.load(.duration) is also 8 times bigger than original duration. Do you know how to get this 239.68 displayed in the Apple Photo app ? Is it stored somewhere in the video metadata or is it computed ?
Replies
0
Boosts
0
Views
883
Activity
Jun ’23
PhotosPickerItem‘s loadTransferable method has a problem with some raw format photos
item.loadTransferable(type: Data.self) { result in switch result { case .success(let data): guard let data = data, let image = UIImage(data: data) else { break } imageView.image = image case .failure(let error): ... } } I load the raw format photo through the above code, but the displayed image is very blurry and messed up. But not all raw format photos will be like this, what is the reason?
Replies
0
Boosts
0
Views
725
Activity
May ’23
Bracketed capture photos have badly clipped highlights
Bracketed photo capture with iPhone 14 Pro produces photos with oddly clipped highlights. Rather than pixel values clipping normally to white when too bright, there is a sudden and harsh jump from gray to white. See image below that shows a comparison of a normal photo capture (using qualityPriorization .speed) and a bracketed capture. Note the massive difference in clipping behavior. Here's how I am configuring the bracketed capture: let bracketedStillImageSettings = AVCaptureAutoExposureBracketedStillImageSettings.autoExposureSettings(exposureTargetBias: 0.0) let bracketSettings = AVCapturePhotoBracketSettings(rawPixelFormatType: 0 as OSType, processedFormat: [AVVideoCodecKey: AVVideoCodecType.jpeg], bracketedSettings: [bracketedStillImageSettings]) photoOutput.capturePhoto(with: bracketSettings, delegate: photoCaptureProcessor) Things I've tried that don't make a difference: Changing AVCapturePhotoBracketSettings.photoQualityPrioritization to values of .speed, .balanced, or .quality Changing device type .builtInTripleCamera, .builtInUltraWideCamera, .builtInWideCamera, .builtInDualCamera, etc Changing capture format from jpeg to hevc Any ideas?
Replies
0
Boosts
0
Views
912
Activity
May ’23
IOS App Ionic Vue Problem with Video
I have implemented an app with ionicvue. On one page I want to display videos with the HTML5 video control, e.g. video src="https://media.geeksforgeeks.org/wp-content/uploads/20210314115545/sample-video.mp4" .... it works on web, on android, but it does not work on iOS. There is only a play button with a strike through line I have tried all of the available option conbinations (controls playsinline webkit-playsinline etc.) but it does not help. Any Ideas? Thanks a lot Alex
Replies
1
Boosts
0
Views
906
Activity
Apr ’23
CNContactViewController no "Take Photo" option in iPad
CNContactViewController has no "Take Photo" option when adding a contact photo when in iPad. It shows in iPhones though. iPad Devices: iPad 6th (iOS 16), iPad 9th (iOS 15.6.1)
Replies
0
Boosts
0
Views
563
Activity
Apr ’23
adding a slideshow to webview app
hello I have created a webview app but it got rejected for not being interactive enough or not using iOS features. so I want to put an image slideshow in. however I get an error code when trying to put the code in code-block // //  ContentView.swift //  BEMCO iOS // //  Created by Lewis Dunn on 06/01/2023. // import SwiftUI import WebKit import UIKit struct ContentView_Previews: PreviewProvider {     static var previews: some View {         ContentView()     } } struct ContentView: View {     let webView = WebView(request: URLRequest(url: URL(string: "https://www.apple.com")!))     var body: some View {         VStack {             webView             HStack {                 Button(action: {                     self.webView.goBack()                 }) {                     Image(systemName: "arrowshape.left")                         .font(.title)                         .foregroundColor(.blue)                     }                 Spacer()                 Button(action: {                     self.webView.goHome()                 }) {                     Image(systemName: "house.fill")                         .font(.title)                         .foregroundColor(.blue)                 }                 Spacer()                 Button(action: {                     self.webView.goForward()                 }) {                     Image(systemName: "arrowshape.right")                         .font(.title)                         .foregroundColor(.blue)                 }             }         }     } } struct WebView: UIViewRepresentable {     let request: URLRequest     private var webView: WKWebView?     init (request: URLRequest) {         self.webView = WKWebView()         self.request = request     }     func makeUIView(context: Context) -> WKWebView { return webView!     }     func updateUIView(_ uiView: WKWebView, context: Context) {         uiView.load(request)     }     func goBack() {     webView?.goBack()   }     func goForward() {   webView?.goForward()     }     func goHome() {         webView?.load(request)     } } @State private var currentIndex = 0 _**(error is here: property wrappers are not supported in top level code) **_ let images : [String] = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19"] var body : some View {     VStack {         Image(images[currentIndex])             .resizable()             .scaledToFit()         HStack{             ForEach(0..<images.count){ index in                 Circle()                     .fill(self.currentIndex == index ? Color.gray : Color.blue) _**(cannot find self in scope)**_                     .frame(width: 10, height: 10)             }         }         .onAppear{             print("Appear")             // We are going to use Timers             Timer.scheduledTimer(withTimeInterval: 2, repeats: true){ timer in                 if self.currentIndex + 1 == self.images.count{                     self.currentIndex = 0                 }else{                     self.currentIndex += 1                 }             }         }     } }
Replies
4
Boosts
0
Views
1.1k
Activity
Apr ’23
adding slideshow to app
hello I am trying to add a slideshow to my app but I am getting 2 error messages and 1 warning the code is as follows: // ContentView.swift // BEMCO iOS // // Created by Lewis Dunn on 06/01/2023. // import SwiftUI import WebKit import UIKit struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } } struct MainView : View { var body : some View { VStack { } } struct MainViewController : UIViewControllerRepresentable { func makeUIViewController(context: UIViewControllerRepresentableContext<MainViewController>) -> UIHostingController<MainView> { return UIHostingController(rootView: MainView()) } func updateUIViewController(_ uiViewController: UIHostingController<MainView>, context: UIViewControllerRepresentableContext<MainViewController>) { let viewController = UIHostingController<MainViewController>(rootView:MainViewController())} } } struct ContentView: View { let webView = WebView(request: URLRequest(url: URL(string: "https://www.bemcouk.com")!)) var body: some View { VStack { webView HStack { Button(action: { self.webView.goBack() }) { Image(systemName: "arrowshape.left") .font(.title) .foregroundColor(.blue) } Spacer() Button(action: { self.webView.goHome() }) { Image(systemName: "house.fill") .font(.title) .foregroundColor(.blue) } Spacer() Button(action: { self.webView.goForward() }) { Image(systemName: "arrowshape.right") .font(.title) .foregroundColor(.blue) } } } } } struct WebView: UIViewRepresentable **{**2 errors are here _"UIViewRepresentable' requires the types 'some View' and 'Never' be equivalent _ and the other error is _"Type 'WebView' does not conform to protocol 'UIViewRepresentable'_** let request: URLRequest private var webView: WKWebView? init (request: URLRequest) { self.webView = WKWebView() self.request = request } func makeUIView(context: Context) -> WKWebView { return webView! } func updateUIView(_ uiView: WKWebView, context: Context) { uiView.load(request) } func goBack() { webView?.goBack() } func goForward() { webView?.goForward() } func goHome() { webView?.load(request) } @State private var currentIndex = 0 let images : [String] = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19"] let imagesCount = 19 var body : some View { VStack { Image(images[currentIndex]) .resizable() .scaledToFit() HStack{ ForEach(0..<imagesCount){ index in **warning is here. Non-constant range: argument must be an integer literal** Circle() .fill(self.currentIndex == index ? Color.gray : Color.blue) .frame(width: 10, height: 10) } } .onAppear{ print("Appear") // We are going to use Timers Timer.scheduledTimer(withTimeInterval: 2, repeats: true){ timer in if self.currentIndex + 1 == self.images.count{ self.currentIndex = 0 }else{ self.currentIndex += 1 } } } } } }
Replies
0
Boosts
0
Views
615
Activity
Mar ’23
HELP!! Please teach me, How can I create profile of photos in Mac?
Recently, I have matter of should change color of so many photos about 80000 picts. But, It's to hard to change it one by one. Actually, I want to change color with ''Match to image with ColorSync profile" of "Automator". But, I don't know some method to do it. Please teach me some method to do it. Should Ito create some profile in mac? Or, Should I search for other method? If I can create some profile, Please teach me the method both. (The pictures are taken by old film camera. There are already changed to digital image.) (They have color of "sepia color". I have to change color to "Normal".)
Replies
0
Boosts
0
Views
1.2k
Activity
Mar ’23
Video with different audio and video durations for HLS playback
I am trying to generate ABR manifest for a video that has a slightly longer video stream than audio stream. Running mediastreamvalidator tool on the manifest I get an error "Different content duration detected between discontinuities". I assume it is caused by my generated manifest having video segments extent past the last audio segments in seconds. Should I shorten the video playback to be the shorter between the two? Should I pad out the video with empty segments so that both streams have the same duration?
Replies
4
Boosts
0
Views
1.4k
Activity
Mar ’23
AVVideoCompositionCoreAnimationTool and AVAssetExportSession freezes the app randomly
Hi there, So I've been banging my head for the last week, because we have an issue in our app where it's freezing on export while the composition has a AVVideoCompositionCoreAnimationTool as animationTool Before extracting the code to an app I can share, or submit a TSIs, I was wondering if this rings a bell to someone. Basically, we're not doing something too crazy We create an AVAssetExportSession from a composition, some audio and some layers to animate.     func makeExportable(configuration: ExportConfiguration) throws -> AVAssetExportSession {         if let animationLayer {             let rect = CGRect(origin: .zero, size: configuration.videoSize)             let videoAnimationLayer = CALayer()             videoAnimationLayer.frame = rect             let videoLayer = CALayer()             videoLayer.frame = rect             videoAnimationLayer.addSublayer(videoLayer)             videoAnimationLayer.addSublayer(animationLayer)             videoAnimationLayer.isGeometryFlipped = true             let animationTool = AVVideoCompositionCoreAnimationTool(postProcessingAsVideoLayer: videoLayer,                                                                     in: videoAnimationLayer)             avVideoComposition.animationTool = animationTool         }         guard             let session = AVAssetExportSession(asset: avComposition,                                                presetName: configuration.avAssetExportPresetName) else {             throw CompositionError.invalidExportSession         }         session.audioMix = audioMix         session.videoComposition = avVideoComposition         return session)     } Then we run await session.export() If we do that multiple times in a row (there are no specific triggers, I can have a 3s video with 40 CALayers or a 30s with 1500 layers, it could happen on the first export or the 20th, ...), then at some point, the app will just have a severe hang with the following stack trace (if I pause the debug session). If ever, I remove the avVideoComposition.animationTool = animationTool line from the export session creation, then the app does not hang... Also, I encounter the issue with the fact that it's crashing on a sim but running fine on a device. Some api_misuse crash (see [here)]. Could this be related, idk...(https://developer.apple.com/forums/thread/133681) Anyway... Completely stuck here, and surprised that such a thing would have an issue on AVFoundation. We're probably not the onliest using CoreAnimation on a video export... Thanks! Marian
Replies
4
Boosts
4
Views
1.8k
Activity
Mar ’23
Can it auto choose don't import apply to all duplicates in Apple Script
I was trying to write a script that can automatically import new photos in to the Photoslibrary, in AppleScript, there are only bool value to determine whether check duplicates, is there a way to do like " check and always do not import duplicate items "
Replies
1
Boosts
0
Views
873
Activity
Mar ’23
I can’t save a large video on my iPhone
The problem is, I have a video file which is about 111MB with resolution 1216x2160 aaaand I can’t save it on my iPhone even though I have a plenty enough space 😭 I tried to send it via airdrop and it shows a pop up with an error and ask me if I want to save it in my documents (I tried this one as well and there’s no way to save it in my gallery from the app), I tried to send a file via telegram and also get the same error. What should I do? I can’t believe that I can shoot in 4K, but can’t save a video with a higher resolution on my iPhone
Replies
1
Boosts
0
Views
1.9k
Activity
Feb ’23