avmutablecomposition

Merge videos & images in AVMutableComposition using AVMutableCompositionTrack, not AVVideoCompositionCoreAnimationTool?

柔情痞子 提交于 2019-11-28 12:22:09
问题 The code below exports a video using AVMutableComposition . But in the exported video, if you want an image to display for 3 seconds after the source video finishes, is there a way to do that with AVMutableCompositionTrack or do you need to add an image layer and animate its appearance after the video ends? Eventually, the goal is to merge an arbitrary number of images and videos into one master video. Unfortunately, during testing it seems like AVVideoCompositionCoreAnimationTool severely

How to merge Audio and video using AVMutableCompositionTrack

↘锁芯ラ 提交于 2019-11-28 07:06:37
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 Use this AVURLAsset* audioAsset = [[AVURLAsset alloc]initWithURL:audioUrl options:nil]; AVURLAsset* videoAsset = [[AVURLAsset alloc]initWithURL:videoUrl options:nil]; AVMutableComposition* mixComposition = [AVMutableComposition composition]; AVMutableCompositionTrack *compositionCommentaryTrack = [mixComposition addMutableTrackWithMediaType:AVMediaTypeAudio

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

风格不统一 提交于 2019-11-28 02:06:15
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 layers of that UIView , ignoring other layers. Our video app superimposes layers on whatever the user is recording, and the ultimate goal is to produce a master video merging those layers with the original video. However, using AVVideoCompositionCoreAnimationTool to merge layers with the original video is very, very, very slow: exporting a 60

Add a text overlay with AVMutableVideoComposition to a specific timerange

社会主义新天地 提交于 2019-11-27 14:13:59
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 video on iOS There were a few others that I referenced as well. My code looks almost identical to that answer and I've been trying to tweak it to get the text overlay to only show up for a second or two at the beginning of the video. Any help on how I could accomplish that? Here is my code. This works as is to export the video with the overlay being

How to properly export CALayer on top of AVMutableComposition with AVAssetExportSession

China☆狼群 提交于 2019-11-27 11:01:07
问题 I know this question was asked before (for example here and here) but I just can't figure out what I'm doing wrong. I have an AVMutableComposition that I use to combine some video clips with some CALayer s that animate on top of them. Everything works ok when I take my AVMutableComposition and combine it with an AVSynchronizedLayer for playback inside an AVPlayerLayer . The video comes out correctly and everything is positioned where it should. My problem is that when I tried to export this

Only First Track Playing of AVMutableComposition()

不羁岁月 提交于 2019-11-27 06:38:34
问题 New Edit Below I have already referenced AVMutableComposition - Only Playing First Track (Swift) but it is not providing the answer to what I am looking for. I have a AVMutableComposition() . I am trying to apply MULTIPLE AVCompositionTrack , of a single type AVMediaTypeVideo in this single composition. This is because I am using 2 different AVMediaTypeVideo sources with different CGSize 's and preferredTransforms of the AVAsset 's they come from. So, the only way to apply their specified

AVFoundation + AssetWriter: Generate Movie With Images and Audio

為{幸葍}努か 提交于 2019-11-27 06:02:19
I have to export a movie from my iPhone application which contains UIImage from an NSArray and add some audio files in .caf format that have to start at pre-specified times. Now I have been able to use the AVAssetWriter (after going through many questions and answers on this and other sites) to export the video portion containing the images but cant seem to find a way to add the audio files to complete the movie. Here is what I have gotten so far -(void) writeImagesToMovieAtPath:(NSString *) path withSize:(CGSize) size { NSLog(@"Write Started"); NSError *error = nil; AVAssetWriter *videoWriter

How to merge Audio and video using AVMutableCompositionTrack

孤街醉人 提交于 2019-11-27 05:43:50
问题 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 回答1: Use this AVURLAsset* audioAsset = [[AVURLAsset alloc]initWithURL:audioUrl options:nil]; AVURLAsset* videoAsset = [[AVURLAsset alloc]initWithURL:videoUrl options:nil]; AVMutableComposition* mixComposition = [AVMutableComposition composition];

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

妖精的绣舞 提交于 2019-11-26 23:38:02
问题 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 layers of that UIView , ignoring other layers. Our video app superimposes layers on whatever the user is recording, and the ultimate goal is to produce a master video merging those layers with the original video. However, using

Add a text overlay with AVMutableVideoComposition to a specific timerange

旧街凉风 提交于 2019-11-26 22:23:43
问题 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 video on iOS There were a few others that I referenced as well. My code looks almost identical to that answer and I've been trying to tweak it to get the text overlay to only show up for a second or two at the beginning of the video. Any help on how