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
3
votes
0 answers

How to add effects(like CurlUp, CurlDown etc) to movie created using objective c iPhone

i have created one movie using AVAssetWriter, AVMutableComposition with images array and audio song and i am saving that to Photo Library...know i want to add effects to that images while creating movie... is it possible to add effects(like CurlUp,…
Steve Gear
  • 757
  • 2
  • 16
  • 44
2
votes
1 answer

Portrait video rendered as landscape after exporting with AVMutableVideoComposition

hello i'm combining two videos with AVMutableVideoComposition() and it works good with landscape videos and portrait videos downloaded from youtube but when try portrait video recorded in iPhone or android the exported video comes as…
Ramesh Sanghar
  • 174
  • 1
  • 1
  • 19
2
votes
1 answer

AVMutableComposition output freezes at the last frame of the first video

I am trying to merge multiple clips(videos) into one using AVMutableCompositions, I have successfully done this as well as rotating and translating each instruction, however, there is still one issue that remains. When the first clip finishes the…
Jaime Santos
  • 437
  • 2
  • 10
  • 21
2
votes
1 answer

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…
Kev Wats
  • 896
  • 1
  • 5
  • 13
2
votes
1 answer

Make AVMutableComposition with image (aspect fill) and video in aspect fit

I am attempting to make a new video using an image that will always be size: CGSize(375, 667), but with a video that will be different sizes, and with the contentMode of .`aspectFit'. The problem is that I cannot figure out how to make the whole…
NCT 127
  • 596
  • 1
  • 6
  • 27
2
votes
1 answer

How do I export a video with a transparent background (alpha channel)

I have a video I'm overlaying on top of another video, where the overlay video has a transparent background. I'm doing this with AVMutableComposition where I just add the tracks and it works great; AVPlayer plays it fine. The problem is when I try…
2
votes
0 answers

Merge two videos on top of each other

I am trying to merge two videos so that second video is on top of other video. My second video has transparent background so my desired outcome looks like this : However i cannot see second video in my outcome Here is my code : func merge(video…
Kaan Baris Bayrak
  • 3,213
  • 3
  • 16
  • 20
2
votes
0 answers

Swift 4 AVMutableComposition animations

I am trying to display an image over top of a video for the first few seconds only. I am adding an image to a CALayer and then attempting to hide it using CABasicAnimation. I have tried a few different iterations of the code below and cannot get…
Victor Altadonna
  • 193
  • 2
  • 10
2
votes
1 answer

How do i pause video recording with iPhone SDK?

I see there is an app called iFile with a pause feature while recording video. How do they do this? I tried using AVMutableComposition classes and when the user pauses i cut a new video and then merge the video at the end, however the processing…
Scoota P
  • 2,622
  • 7
  • 29
  • 45
2
votes
1 answer

Video with no audio crashes app on AVMutableComposition()

My app takes a video from a URL and allows you to add text to it, etc. It seems to crash when the video doesn't have any audio to begin with, can't seem to figure this out. This is what I have when the video is being composed: let asset =…
Derek Saunders
  • 401
  • 1
  • 4
  • 14
2
votes
3 answers

MP4 videos created with AVMutableComposition and AVAssetExportSession work in Quicktime, but appear corrupted in all other video tools

I'm trying to edit segments of multiple movies together into one clip using Swift, AVFoundation, and AVKit on macOS. The following Swift code is a good example of what I'm trying to do: import AVFoundation import AVKit let source1 = AVAsset(url:…
James Porter
  • 1,853
  • 2
  • 17
  • 30
2
votes
0 answers

Is it possible to set the output audio sample rate for a video file created using AVMutableComposition and AVAssetExportSession?

I'm using AVMutableComposition and AVAssetExportSession to combine a silent MP4 video with a WAV audio file. The basic steps are: Create AVAssets for the video and audio Add tracks to the AVMutableComposition Add each AVAssets first track to a…
2
votes
0 answers

Recording Audio with background sound is out of sync when played back with the sound

What i am trying to achieve is making a sort of a karaoke application that will play music in the background while the user sings. With headphones everything seems to work fine but when i try to record and merge audio files when on speaker, i am…
Rikh
  • 4,078
  • 3
  • 15
  • 35
2
votes
1 answer

iPhone SdK: AVPlayer will not play a composition after adding a audio track

After adding an audio track (recorded with AVAudioRecorder) to a composition AVPlayer will not play it. AVPlayer.status = 1 and AVPlayer.error = null. I have looked at the WWDC10 AVEdit demo code and it's pretty much similar. Could it be an audio…
2
votes
0 answers

AVMutableVideoComposition & AVVideoCompositionCoreAnimationTool color glitch

I'm trying to add image to video using following code: AVURLAsset* videoAsset = [[AVURLAsset alloc]initWithURL:[self assetURL] options:nil]; AVMutableComposition *mixComposition = [[AVMutableComposition alloc] init]; AVMutableCompositionTrack…
Wojczitsu
  • 250
  • 3
  • 16