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

Avplayer not playing video when audio is present in the composition

I have been struggling with a problem where avplayer is not showing the video asset if I add audio to the composition. Here is the code as it is now: - (void)viewDidLoad { [super viewDidLoad]; AVMutableComposition *composition =…
2
votes
1 answer

Issues with video recording being upside down and AVMutableComposition rotating video

I've got a strange problem going on with video recording and putting said video into a composition. If the device is oriented landscape left (button on the left), the video records upside down and then when it's put into the composition it's rotated…
lunadiviner
  • 509
  • 2
  • 9
  • 25
2
votes
2 answers

Adding multiple video assets to AVMutableComposition

I have no problem adding one video asset and one audio asset to an AVMutableComposition and getting a playable mov file after using AVAssetExportSession. However, when I try to add another video track right after the first I end up with problems.…
2
votes
1 answer

Using AVMutableComposition iPhone

I am using the below code, for streaming the two videos sequentially. But it is not showing any video in the simulator, its totally blank. Also how can I seek through these two videos. Like, if one video is of 2 minutes and the second is 3 minutes.…
Omer Waqas Khan
  • 2,423
  • 4
  • 33
  • 62
2
votes
2 answers

Merging two m4v Movie Files Using AVMutableComposition - Videos Will Not Merge

I am using the below code to try and merge two m4v files stored in the documents folder : CMTime insertionPoint = kCMTimeZero; NSError * error = nil; AVMutableComposition *composition = [AVMutableComposition composition]; AVURLAsset* asset =…
GuybrushThreepwood
  • 5,598
  • 9
  • 55
  • 113
1
vote
1 answer

AVFoundation - Video didn't play in AVMutablecomposition with AVplayer

I am working on playing a online video file with AVplayer using AVMutablecomposition. The Video plays very fine when I play it on browser but I just cant get it play on my iPad. Here's the code: self.composition = [AVMutableComposition…
WilsonL
  • 167
  • 1
  • 2
  • 10
1
vote
0 answers

Play video with this audio in AVMutableCompositionTrack

I have a 2 AVMutableCompositionTrack objects. 1st contains video (with his sound) and 2nd contains some audio, for example mp3. I want to play both of them simultaneously. Everything is OK with the sound of second object. Unfortunately I can't hear…
Artak
  • 11
  • 2
1
vote
0 answers

trim Audio File in iphone sdk

I am working on an Audio Mixture iPhone App. Now I want to trim the audio file. I am trying to use removeTimeRange method from AVMutableComposition, but I don't understand how to use it. Please can someone guide me on how to do that?
Akhii
  • 11
  • 2
1
vote
0 answers

loadInPlaceFileRepresentation vs loadFileRepresentation

I have an app where users upload videos and then I create clips from the video using AVMutableComposition. I don't fully understand the difference between loadInPlaceFileRepresentation and loadFileRepresentation. Is there any reason I can't always…
1
vote
0 answers

Play video synthesized by AVMutableComposition in AVPlayer with error

I am creating an IOS video editing tool by AVMutableComposition. If I combine multiple videos in a single video mutabletrack, it works fine. However, when I create mutabletrack per video and synthesize the video and play it in AVPlayer, only sound…
1
vote
1 answer

Swift AVAssetTrack not merging properly

Attempting to merge multiple videos with AVMutableComposition, the tracks are gathering correctly in the avassettrack. However, they simply overlap and only the second video is displayed. Also the length of the output is whatever the second video…
Trevor
  • 580
  • 5
  • 16
1
vote
1 answer

audio file plays fine but can't add in AVMutableVideoComposition

i'm trying to add audio file selected with MPMediaPickerController to video with AVMutableVideoComposition, but it gives error and doesn't work. picking audio like this : func mediaPicker(_ mediaPicker: MPMediaPickerController, didPickMediaItems…
1
vote
0 answers

How to combine multiple videos with AVMutableComposition without loosing audio sync?

I'm trying to write video exporter which can combine N videos and place them side by side. Below example is with 3 videos. Videos are recorded WebRTC streams of speakers, and each has a bit different frame rate, possibly also recorded with variable…
1
vote
1 answer

Change volume of audio track within AVMutableComposition

I'm trying to merge a pre-existing video with a newly recorded audio voiceover track. User can set the relative sound volume for the two audio tracks (audio belonging to video, and new audio). This code works in terms of merging it into one new…
1
vote
1 answer

AVMutableVideoCompositionLayerInstruction setCropRectangle with ROTATED rectangle not working as expected

I have a video that is placed at the origin of the screen, no rotation, as seen in this picture (ignore the background): No crop rectangle I apply a basic rectangle (no rotation for now) crop with setCropRectangle so that it cuts my video in half,…