Questions tagged [avmutablecomposition]

AVMutableComposition is a mutable subclass of AVComposition you use when you want to create a new composition from existing assets. You can add and remove tracks, and you can add, remove, and scale time ranges.

AVMutableComposition is a mutable subclass of AVComposition you use when you want to create a new composition from existing assets. You can add and remove tracks, and you can add, remove, and scale time ranges.

At its top-level, AVComposition is a collection of tracks, each presenting media of a specific media type, e.g. audio or video, according to a timeline. Each track is represented by an instance of AVCompositionTrack. Each track is comprised of an array of track segments, represented by instances of AVCompositionTrackSegment. Each segment presents a portion of the media data stored in a source container, specified by URL, a track identifier, and a time mapping. The URL specifies the source container, and the track identifier indicates the track of the source container to be presented.

Sources:

282 questions
2
votes
0 answers

AVMutableComposition with AKAudioFiles just exports the first track

I recently have struggling to get AVMutableComposition working in my synthesizer app. I implemented a function like the one below without Audiokit and it worked perfectly fine. However, when I run the function below I only can here the first file in…
Grant Emerson
  • 404
  • 1
  • 4
  • 13
2
votes
1 answer

Unable to combine multiple audio files into one in a keyboard extension running on an iOS device

The keyboard extension I built uses audio files to play audio feedback when keys are pressed. At some point, the user has an ability to combine multiple audio files into a single audio file. Combining multiple audio files works in simulator but does…
2
votes
1 answer

AVMutableComposition Not Orienting Video Properly

I've been digging around StackOverflow for most of the day on this, and while there are lots of great posts on the topic, I have yet to find a solution to my issue. I am writing a video file using an AVAssetWriter with no problem. My video file, if…
ZbadhabitZ
  • 2,753
  • 1
  • 25
  • 45
2
votes
1 answer

AVMutableAudioMix multiple volume changes to single track

I'm working on an app that merges multiple video clips into one final video. I would like to give users the ability to mute individual clips if desired (so, only parts of the final merged video would be muted). I have wrapped the AVAssets in a class…
Becky Hansmeyer
  • 712
  • 6
  • 24
2
votes
1 answer

Exporting CALayer with implicit animation via AVExportSession

I'm trying to export an animation for my custom CALayer with a custom property via AVExportSession, please find the setup below: class CustomAnimatable: CALayer { @NSManaged var brightness: CGFloat override init(layer: Any) { …
NikGreen
  • 700
  • 9
  • 28
2
votes
1 answer

How to use AVAudioPlayerNode with AVMutableComposition

The AVAudioEngine and related AVAudioNode objects seem to be quite powerful for audio processing but it's difficult to see how to automate parameter changes with them. I'm sure there must be something more effective than manually using a Timer to…
2
votes
1 answer

Audio out of sync with video in rendered AVMutableComposition

I have an AVMutableComposition with the following track segments: video: empty: Y, {{0/1 = 0.000}, {48/100 = 0.480}} empty: N, {{48/100 = 0.480}, {600/600 = 1.000}} empty: Y, {{888/600 = 1.480}, {900/600 = 1.500}} empty: N, {{894/300…
zoul
  • 102,279
  • 44
  • 260
  • 354
2
votes
1 answer

Black frame at video end after AVMutableComposition creation

When creating an AVMutableComposition with 2 video AVMutableCompositionTrack objects displayed side by side if I trim the end or the start of the videos (so 2 different durations), I have a black frame instead of the last frame of the video when I…
remy_jourde
  • 300
  • 1
  • 2
  • 14
2
votes
1 answer

Performance issues with AVMutableComposition - scaleTimeRange

I am using scaleTimeRange:toDuration: to produce a fast-motion effect of upto 10x the original video speed.But I noticed that videos start to stutter when played through an AVPlayer at 10x. I also noticed that on OSX's QuickTime the same composition…
user7404038
2
votes
1 answer

insertTimeRange:ofTrack:atTime:error: (class AVMutableCompositionTrack) fails on iPhone

insertTimeRange:ofTrack:atTime:error: of class AVMutableCompositionTrack is returning NO and the error "The operation could not be completed" on the iPhone (but not the simulator). The error message is unhelpful and I'm stumped trying to come up…
2
votes
1 answer

iOS - Watermark video with transparent video

I am using AVFoundation to watermark a video with another video that has transparency in it. I have managed to overlay one video on top of the other using the following code, but as soon as I start using an asset with transparency in it, the export…
Daniel Larsson
  • 6,278
  • 5
  • 44
  • 82
2
votes
1 answer

AVMutableComposition y-axis reversed

I add watermark on video. I set origin watermark layer (10;10), but after export, watermark is located in the lower left corner. If I increase y, the watermark is moved up. As if y-axis increases from the bottom up. Can anyone suggest…
Pal4
  • 51
  • 4
2
votes
0 answers

Edit a portion of video (using AVFoundation)

I have some code, provided below. This will take 2 videos assets, and insert the 2nd asset into the first asset. As of right now I am calling a new AVMutableComposition every time and returning a whole new composition, which is time consuming. I…
impression7vx
  • 1,728
  • 1
  • 20
  • 50
2
votes
1 answer

AVAssetExportSession intermittent error 11820 "Cannot Complete Export" Suggestion=Try exporting again

EXPORT STATUS 4 Error Domain=AVFoundationErrorDomain Code=-11820 "Cannot Complete Export" UserInfo={NSLocalizedDescription=Cannot Complete Export, NSLocalizedRecoverySuggestion=Try exporting again.} I'm experiencing an intermittent error when…
2
votes
0 answers

Black frames in AVMutableComposition video merging

I use AVMutableComposition to merge three videos and a audio track.Now the merged video includes black flame in first one second. I wrote like this. let mixComposition = AVMutableComposition() let firstTrack =…
Kei Maejima
  • 401
  • 1
  • 4
  • 6