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

Black Video outputted via AVMutableVideoComposition and CAAnimation

I am building iOS application that is able to record video and add animation overlay over recorded video with AVFoundation and CAAnimation. All sub features are working fine but end of video's background is black while animation is playing. It's…
0
votes
0 answers

Getting EXC_BAD_ACCESS when trying to add animated GIF file at Video using AVMutableComposition (AVFoundation)

I am trying to add animated GIF file at Video file. I have GIF and Video files in Xcode. Reference: Saving video with overlay of GIF image I am getting EXC_BAD_ACCESS in method 'animationForGifWithURL' at line as shown in attached image. Please…
Asif Raza
  • 836
  • 12
  • 29
0
votes
1 answer

Create video with AVVideoCompositionCoreAnimationTool and AVAssetExportSession SLOW

I create an animation with layers and I want to export a video with that animations. So I use AVAssetExportSession, but it take a long time to export. Maybe I can use another thing? I really need help! let videoURL = NSURL.init(fileURLWithPath:…
0
votes
1 answer

-[__NSArrayM objectAtIndex:]: index 0 beyond bounds for empty array' while using insertTimeRange in AVMutableComposition

Following is my code firstAsset = [[AVURLAsset alloc] initWithURL:[NSURL fileURLWithPath:_strThumbForegroundVideo] options:nil]; AVMutableComposition* mixComposition = [[AVMutableComposition alloc] init]; AVMutableCompositionTrack *firstTrack =…
0
votes
1 answer

CMTimeMake User Picker

have been working on the AVMutableComposition to mix audio file with video, For the part of insert the audio at video time 0, am using this AVMutableCompositionTrack *a_compositionVideoTrack = [mixComposition…
0
votes
1 answer

Merging audio and video Swift

Im trying to merge N audio tracks, to an video file. The video is in MP4 format, and all audios are m4a. All the preparation works well but when the export finishes, always fails. Heres my code : func mixAudioAndVideo() { self.player?.pause() …
Vinicius Albino
  • 743
  • 2
  • 8
  • 21
0
votes
1 answer

AVAssetExportSession only works first 6 times

Updated code sample, console output and information I'm trying to get the total duration of a video composition, divide it by 10, round up, then loop through and splice the video composition at those intervals. It works, but after the…
0
votes
0 answers

Multiple resolution videos being composed with AVMutableComposition

Is it possible to create a video composed of separate videos of different resolutions? I'm taking two different AVAssets that are MPEG4 videos of different resolution (one 300x300 and another 600x600) and using AVMutableComposition to compose them…
Joe
  • 384
  • 3
  • 13
0
votes
1 answer

Rotating videos in SDAVAssetExportSession

I currently use SDAVAssetExportSession to join videos together and apply fades between the transitions. However, when I record a video with the front-facing camera, SDAVAssetExportSession does not take the rotation (180 degrees) of the front-facing…
0
votes
1 answer

Pan audio tracks in an AVMutableVideoComposition

I've created an app that allows mixing of several videos and their respective audio tracks. I can edit the volume levels just fine using an AVAudioMix, but what I would really like to be able to do is to adjust the pan of each audio track. I know…
Luke Smith
  • 1,218
  • 12
  • 17
0
votes
1 answer

Swift 2 - Visualizing an AVMutableComposition for Debugging : Converting Apple's AVCompositionDebugViewer

I'm running into an issue with my swift 2 conversion of an Apple provided example for displaying an AVMutableComposition. This is a really useful project if you're trying to visualize your AVComposition to see what might be going on under the hood.…
Justin Levi Winter
  • 2,327
  • 2
  • 17
  • 30
0
votes
2 answers

AVMutableComposition insertTimeRange: uses wrong range

I need trim many videos, and then show preview of their compilation. User can edit start time and end time for every video, and I show preview of current video (while user trim) with code: AVPlayer *player = [AVPlayer playerWithURL:[NSURL…
Virasio
  • 470
  • 5
  • 11
0
votes
2 answers

AVMutableComposition - concatenated video assets stops after first asset

I'm using the following code to concatenate multiple AVURLAssets: AVMutableComposition * movie = [AVMutableComposition composition]; CMTime offset = kCMTimeZero; for (AVURLAsset * asset in assets) { AVMutableCompositionTrack…
Ashley Mills
  • 50,474
  • 16
  • 129
  • 160
0
votes
1 answer

merge two videos with AVMutableComposition, but one of them didnt play well

here i have two videos, both of them are mp4, and i want to merge them in one piece to play one by one with AVPlayerItem. but just one of them play well, the other one just show black screen while the progress is still rolling. the annoying thing is…
Carusd Ray
  • 993
  • 7
  • 11
0
votes
1 answer

Merge audio/video when audio duration is less than video duration

I'm only merging a single audio/video file. The problem is that, my video file is of 40 seconds & audio file is of 28 seconds. So for remaining 12 (40 - 28) seconds – I want to repeat audio for the remaining part from 0 second. How do I that? Is…
Hemang
  • 26,840
  • 19
  • 119
  • 186