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

Weird behaviour of AVMutableComposition freezing while using AVMutableVideoComposition

I am trying to merge multiple videos using AVMutableComposition. The problem I face is that whenever I try to add any AVMutableVideoComposition for applying any instructions, my playback freezes in AVPlayer at exact 6 seconds duration. Another…
blancos
  • 1,576
  • 2
  • 16
  • 38
7
votes
1 answer

AVfoundation Reverse Video

I tried to make video in reverse. While playing asset in AVPlayer i set the rate = -1 to make it work in reverse format. But how to export that video? I looked into docs. read about avassetwrite, sambuffers , compositions but didn't find any way to…
6
votes
2 answers

How to add current timestamp in camera in ios app

Something like this I want to add current timestamp when recording is done in the video and save into camera roll. **Note **: I have successfully added current location and timestamp in AVVideoPreviewLayer but it is static after exporting video is…
6
votes
1 answer

AVMutableComposition - Exporting wrong video transform

After exporting VideoAsset: the issues: Video orientation is not original transform Exported Video's layer seems to be always landscape. trying to: transform video layer orientation - rotate to original orientation video layer size - make it full…
Ofir Malachi
  • 1,145
  • 14
  • 20
6
votes
1 answer

White video when opening AVMutableComposition in Instagram

After I export an AVMutableComposition I use PHPhotoLibrary to save the video to the camera roll. In the creationRequestForAssetFromVideoAtFileURL: completion handler, I then open the saved video in Instagram, like so: __block PHObjectPlaceholder…
6
votes
1 answer

AVPlayer not working with AirPlay

I have a sequence of AVMutableCompositions that I am playing with AVPlayer. Everything works great when I am playing via speaker, headphones, or bluetooth. However, as soon as I connect to AirPlay, everything falls apart. I can play one asset, and…
6
votes
3 answers

precise timing with AVMutableComposition

I'm trying to use AVMutableComposition to play a sequence of sound files at precise times. When the view loads, I create the composition with the intent of playing 4 sounds evenly spaced over 1 second. It shouldn't matter how long or short the…
6
votes
3 answers

Concat two audio files (one after another) in iOS

I want to concatenate two audio files into one. I had done following code. Please check below. - (BOOL)combineFiles{ AVMutableComposition *composition = [[AVMutableComposition alloc] init]; AVMutableCompositionTrack *compositionAudioTrack =…
6
votes
2 answers

Add a text overlay with AVMutableVideoComposition to a specific timerange

I have found a few examples that show how to add a text overlay on a video. Ray's Tutorial - http://www.raywenderlich.com/30200/avfoundation-tutorial-adding-overlays-and-animations-to-videos This SO answer - How can I add a watermark in a captured…
ScottF
  • 565
  • 6
  • 21
6
votes
0 answers

iOS: Add empty / black frames to AVMutableComposition

Starting from just a CAF audio recording, I need to create a video file where the video track is just empty frames, and the audio track is this audio recording file. I know it's a strange use case, and that's probably why I can't find information on…
user2041338
  • 211
  • 3
  • 6
6
votes
1 answer

Create a CATextlayer that changes at an interval in an AVMutableVideoComposition

I have an app that allows a user to record a video in a mutable composition. I'd like to set some text that will come up and then change at an interval that I set when the user plays it back after an export. For example, if the first word is "dog",…
Orpheus Mercury
  • 1,617
  • 2
  • 15
  • 30
5
votes
2 answers

AVMutableComposition - Blank/Black frame between videos assets

I'm currently trying to put 5 videos back to back using AVMutableComposition like so: [mixComposition insertTimeRange:CMTimeRangeMake(kCMTimeZero, asset1.duration) ofAsset:asset1 atTime:[mixComposition duration] error:nil]; [mixComposition…
5
votes
4 answers

Flip the video recorded with front facing camera along horizontal axis in IOS

I am trying to un-mirror the mirror effect created by iPhone’s front facing camera while recording video. Basically, I want to flip the video captured by front facing camera along the horizontal axis, so that the final edited video doesn’t not have…
5
votes
3 answers

AVPlayerItem videoComposition freeze IOS8

I am playing a AVMutableVideoComposition with AVPlayer and since IOS8 everything was perfectly fine. But now the video start playing and after 4 or 5 seconds it stop ,like buffering or something like that, the sound keeps playing and when the video…
guillaumeD
  • 73
  • 6
5
votes
1 answer

iOS composing 2 videos with transparency

I have 2 videos where one of them is overlay video with transparent background (explosion video that Im trying to add to the video). When I try to combine them using AVMutableComposition I see that overlay's video alpha channel is ignored. Basically…
Andrei V
  • 1,468
  • 3
  • 17
  • 32
1 2
3
18 19