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

Objective c : fastest method to overlay a video

After recording a video, I want to overlay it with a dynamic uiview which is updated related to the current video frame timestamp. In fact I am trying to do the same thing as Vidometer application. Following the Apple example, I am able to extract…
3
votes
1 answer

Simplified screen capture: record video of only what appears within the layers of a UIView?

This SO answer addresses how to do a screen capture of a UIView. We need something similar, but instead of a single image, the goal is to produce a video of everything appearing within a UIView over 60 seconds -- conceptually like recording only the…
Crashalot
  • 33,605
  • 61
  • 269
  • 439
3
votes
1 answer

Use AVMutableVideoCompositionLayerInstruction modify Track, size and position deviation

I use AVMutableVideoCompositionLayerInstruction modify the size and position, after setting Transform. The 'iPhone 5' can be normal, but there are deviations at 'iPhone6' display. After testing, always more offset about 30 or so. Like the picture…
3
votes
1 answer

AVAssetTrack.duration is shorter than AVURLAsset.duration

This is weird, after hours' testing I still can't figure it out. Ok, this is what I'm going to do: merge two videos, that is to append one after another. I shoot two videos, then have two urls. Then I created two AVURLAsset using : AVURLAsset*…
DrustZ
  • 342
  • 1
  • 5
  • 19
3
votes
3 answers

AVFoundation - combine videos only one the first is displayed

I am trying to take a different approach at combining videos. I am creating a new track for each transformation. The problem with this code is that the first video is shown and all others are black. The audio overlay is correct for the entire…
iPhone Guy
  • 1,031
  • 10
  • 30
3
votes
0 answers

Exporting cropped video - different results for front/rear camera

I'm trying to take a video from the camera and export it as a square. I'm testing it on an iPad Air with front and rear camera. Everything works well when I capture video with a rear camera - video is cropped just as I want. Unfortunately, it's…
3
votes
0 answers

How to use removeTimeRange method of AVMutableComposition?

I have composed multiple videos and I want to remove last 0.5 second of all the tracks in the composition. I believe removeTimeRange can be used in situation. Doc for this methods reads as Removes a specified timeRange from all tracks of the…
blancos
  • 1,576
  • 2
  • 16
  • 38
3
votes
1 answer

CGAffineTransform scale not scaling from center - with export

I guess what makes my question/problem different than other postings is that I am not scaling a view, but rather an asset layer instruction (AVMutableVideoCompositionLayerInstruction). So setting anchor points, view.center, CG Rect scaling all do…
3
votes
2 answers

AVAssetExportSession with instructions make black screen

I'm trying to combine 2 audio files and 1 video file into 1 .mov file. I realize it with next code: -(void)combineData{ AVMutableComposition *mixComposition = [[AVMutableComposition alloc] init]; AVAsset *audioAsset = [AVAsset…
3
votes
0 answers

change avplayer play rate and then save video as a movie file

I have a video which I play by using avplayer. And then I have a feature where user can change rate of the movie to go faster or slower. Is there a way to say this fast or slowed down movie? I have looked into avassetwriter but I can't find a way to…
Jatin
  • 1,668
  • 2
  • 16
  • 23
3
votes
1 answer

Exporting with AVAssetReaderVideoCompositionOutput goes partway and then exits with AVFoundationErrorDomain Code=-11800

I've built an AVMutableComposition and VideoComposition from AVAssets and am able to play it. I am also able to export it using AVAssetExportSession, however AVAssetExportSession does not offer much control of the settings, so I'm exporting it using…
Bjorn Roche
  • 11,279
  • 6
  • 36
  • 58
3
votes
1 answer

AVExportSession to continue in background

I am working on one application in which it requires to merge more than one videos. I am using AVExportSession to export merged video. I am also displaying progress bar for exporting video. It is running correctly. The issue occurs when we lock the…
3
votes
1 answer

Iphone: Audio Asset track not found when audio is created as a file, runtime in application

When I select audio as asset,I noticed Audio Asset track not found in selected asset. That "audio is created runtime as a file"(means created in application and saved in document directory). I have used the code from link below ... its work when…
K'am
  • 129
  • 1
  • 7
3
votes
4 answers

How to merge Audio and video using AVMutableCompositionTrack

In my application I need to merge audio and video and then I need to play the audio file in the Mediaplayer. How can I merge the audio and video in IOS. Is there is any source code for this. Please suggest me some ideas Thanks in advance
btmanikandan
  • 1,923
  • 2
  • 25
  • 45
3
votes
1 answer

Merge audio with video perfectly

I've been trying to merge audio with video using AVMutableComposition and AVExportSession. Everything works perfectly except that the audio and video sources don't have the same duration. So the exported movie is a bit laggy. Is there anyway to…
Jad
  • 188
  • 2
  • 12