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
5
votes
1 answer

How to increase speed of the video when saving it by using AVAssetExportSession

I have a video file which I can load into an AVAsset. I want to change the rate at this video is played and double up its speed so that if the video was 10 seconds long, it would speed up to finish in 5 seconds. Here is the code I am trying with,…
Jatin
  • 1,668
  • 2
  • 16
  • 23
5
votes
4 answers

Loop AVMutableCompositionTrack

I have got two audio tracks on me that I combine with one another like this: AVMutableComposition *composition = [[AVMutableComposition alloc] init]; AVMutableCompositionTrack *compositionAudioTrack = [composition…
Sergey Grischyov
  • 11,995
  • 20
  • 81
  • 120
5
votes
1 answer

AVAssetExporter crashing on setting videoComposition

I'm using AVFoundation to crop and rotate a video, but I'm getting a SIGABRT error when setting the AVAssetExporter's videoComposition property. assetExport.videoComposition = videoComposition; Any ideas? Thanks, Daniel.
5
votes
3 answers

AvMutableComposition issues having black frame at the end

I capturing a video using AVCaptureConnection in my iOS app. After that I add some images in the video as CALayers. Everything is working fine but I get a black frame at the very end of the resulting video after adding images. There is no frame of…
Swati
  • 1,417
  • 1
  • 15
  • 35
4
votes
1 answer

How do I merge 2 videos with a fade transition?

I'm trying two merge 2 videos with a 2 second overlap. In this overlap I'd like to fade the second video in (or fade the first one out to reveal the second, either one would be great). The first video is fading out 2 seconds before the end as…
kerbelda
  • 325
  • 1
  • 4
  • 14
4
votes
1 answer

AVFoundation -Videos merge but only last video plays

I have an array of [AVAsset](). Whenever I record different videos at different durations the below code merges all the durations into 1 video but it will only play the last video in a loop. For eg. video1 is 1 minute and shows a dog walking, video2…
Lance Samaria
  • 17,576
  • 18
  • 108
  • 256
4
votes
1 answer

AVMutableComposition rotate video file

I'm using PryntTrimmerView for trimming video file. there is my code for exportation trimming video file, and generating video thumbnail: func prepareAssetComposition() throws { guard let asset = trimmerView.asset, let videoTrack =…
ava
  • 1,148
  • 5
  • 15
  • 44
4
votes
2 answers

AVAssetExportSession, AVMutableComposition w/ AudioMix fade out not working

I'm building a app that combines a couple of videos, merges them into one and puts a custom audiotrack in the video. This all works flawlessly. Now I want to fade out my audio. This on the other hand, does not work, and I have no idea why. This is…
kaanmijo
  • 713
  • 1
  • 5
  • 14
4
votes
1 answer

Overlay Two Videos with AVFoundation

I am trying to overlay two videos, with the foreground video being somewhat alpha transparent. I have been following the Apple Docs as well as This tutorial. Whenever I try putting two of the same video through my code it doesn't crash; however,…
Blake Barrett
  • 206
  • 1
  • 10
4
votes
1 answer

iOS - change volume for each AVAssetTrack

I have some audio files that I need to insert in an AVMutableComposition. Each audio have a different volume. To accomplish that I created an AVMutableTrackComposition and an AVAssetTrack for each audio file. So I change the volume for every track…
Marco
  • 1,057
  • 1
  • 19
  • 36
4
votes
2 answers

AVAssetExportSession combine video files and freeze frame between videos

I have an app which combines video files together to make a long video. There could be a delay between videos (e.g. V1 starts at t=0s and runs for 5 seconds, V1 starts at t=10s). In this case, I want the video to freeze the last frame of V1 until V2…
Liron
  • 2,012
  • 19
  • 39
4
votes
1 answer

How to play multiple videos in AVQueuePlayer or AVMutableComposition without any gapes or freeze?

I know this question has been asked a few times in past and I have read responses to those. But nothing seems to work the way I want. There are multiple videos and all are added in queue of AVQueuePlayer. I have tried adding in two ways as…
blancos
  • 1,576
  • 2
  • 16
  • 38
4
votes
1 answer

Video cracked while merging videos using AVMutableComposition

I'm merging the videos using AVMutableComposition with the below code, - (void)MergeAndSave_internal{ AVMutableComposition *composition = [AVMutableComposition composition]; AVMutableCompositionTrack *compositionVideoTrack = [composition…
4
votes
1 answer

What is OSStatus -12500?

I am working on a project with AVFoundation and am currently getting the following error: Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" UserInfo=0x10021ee80 {NSUnderlyingError=0x10015cee0 "The operation…
4
votes
0 answers

Correcting Video Orientation in iOS

I am developing a video app in which user can merge different videos present in Asset Library. I am able to join the videos but I am facing the orientation issues. For example, if a video is landscape right and other is landscape left, the second…