Questions tagged avfoundation

Explore the latest questions and answers asked by our top developers.

How to improve AVAssetExportSession saving performance

I’m using AVAssetExportSession to save video with some text / image overlays on it. It’s working pretty fine except It takes way to much time to save new video, I’ve seen other apps that do it much faster like 2-4x faster. So I’m wondering is there something I do in a wrong way? Here is […]

How to manage AVPlayer state in SwiftUI

I have a list of URLs in SwiftUI. When I tap an item, I present a full screen video player. I have an @EnvironmentObject that handles some viewer options (for example, whether to show a timecode). I also have a toggle that shows and hides the timecode (I’ve only included the toggle in this example […]

Categorised as avfoundation, avkit, ios, swiftui Tagged , , ,

AVFoundation record 10 bit HDR video on iPhone 12

iPhone 12/12 pro supports recording Dolby vision HDR video in 10 bit format instead of 8 bits but it is not clear from iOS 14.1 SDK if AVCaptureVideoDataOutput supports delivery of 10 bit sample buffers that can be appended to video file using AVAssetWriter. Has anyone figured it out whether it is possible or not […]

Trouble applying scaleTimeRange on multiple videos in a AVMutableComposition video

I am attempting to merge videos with scaleTimeRanges (to make them slo-mo or speed-up); however, it is not working as desired. Only the first video has the timerange effect… not all of them. The work is done in the merge videos function; it is pretty simple… however I am not sure why the scaling of […]

MPVolumeView not suppressing default system volume UI after showing an AVPlayerViewController

Have run into an issue where iOS’ MPVolumeView no longer suppresses the system volume UI when the device’s volume up/down buttons are pressed. My understanding is that the presence of an MPVolumeView on the screen should suppress iOS’ default volume UI, but it doesn’t in this instance. Everything works as expected on load of the […]

By Richard Viney
Categorised as audio, avfoundation, ios, volume Tagged , , ,

iOS TTS Alex voice is treated like available when it’s actually not

In my app I allow the user to change TTS voices and English Alex voice is one of possible options. However, there are some cases when it’s treated as available when it’s actually not. It results in pronouncing the TTS utterance with another voice. To prepare the list of available voices I use next code: […]

Audio Player in swift is not getting value of volume and pitch

I am trying to make an audio player in SwiftUI, Audio player should have these functionality. Play/Stop Audio Play in loop Change volume through slider Change audio pitch through slider. There are two problem currently I am facing audio player is not using volume and pitch slider value While I stop and play and change […]

By Varun Naharia
Categorised as audio, avfoundation, ios, swift, swiftui Tagged , , , ,

AVExportSession exporting video super slow

I am trying to simply increase the speed of my exporting of my merged video. Here is the code: //from my extensive research online and on SO, I have pretty much come down to the preset PassThrough makes it super fast, however as I wrote in a comment in the code, my merging code does […]

Inserting slowMo AVComposition into AVMutableComposition

PHPhotoLibrary gives an AVComposition rather than an AVURLAsset for a video recorded in SlowMo. I want to insert slowMo videos into another AVMutableComposition, so this means I need to insert this AVComposition into AVMutableComposition which is my editing timeline. The hack I used before was to load the tracks and segments and find the mediaURL […]

AVCaptureConnection.previewLayer is nil in delegate AVCaptureMetadataOutputObjectsDelegate

The code below can run on an iPhone and when aimed at any QR code, should print the contents. The QR code below points to The problem is that the delegate should supply the connection: AVCaptureConnection and it does, but its previewLayer property is nil. The following code can be pasted into a new, […]

By Bart van Kuik
Categorised as avfoundation, qr-code, swift
1 2 3 6

Still Have Questions?

Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us