avmutablecomposition

Transform not working in AVMutableVideoComposition while exporting

十年热恋 提交于 2019-12-09 14:54:59
问题 My goal is to compose a set of clips recorded from the camera and export them at a certain preferred size. Of course, the video orientation needs to be rotated before exporting. I'm doing this by composing an AVMutableComposition from an array of video clips, stored in avAssets below. I am able to compose them fine, and export it. However, the rotation transform I am setting on the AVMutableVideoComposition is not being honored. If I use the same transform and set it on the preferredTransform

Composing video and audio using AVMutableComposition

我与影子孤独终老i 提交于 2019-12-09 11:39:35
问题 I have a weird problem. In my app I am combining multiple audio and video files using the code below. The resulted video seems to work fine once I downloaded it from the device to the computer and play with Quick Time, but whenever I am trying to play the newly composed video using either UIWebView or AVPLayer I can only see first part of merged video files. Furthermore when I tried to use MPMoviePlayerController to play it hangs on "Loading". I can hear audio for all composition. To make it

AVFoundation - combine videos only one the first is displayed

风格不统一 提交于 2019-12-08 05:44:10
问题 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 segment. It looks like the video is not brought in to the composition because the size of the file is 5 M when it should be about 25M. The 5M size correlates to the size of the first clip and the audio track. All of the AVAssets appear to be valid. The

Avmutable composition , lost orientation when adding audio to a video made with frames

怎甘沉沦 提交于 2019-12-08 04:44:58
问题 I've been working on a project of video processing. Until now I succeeded in filtering live camera feeds, capturing still images, recording video from frames, recording audio, and lately succeeded in adding audio to the video capture. But it seems like the video has lost its orientation - it should be rotated by 90 degrees clockwise. I tried to use the AVmutablevideocomposition, but whatever I do, I keep getting the following error: [__NSArrayM objectAtIndex:]: index 0 beyond bounds for empty

precise timing with AVMutableComposition

你说的曾经没有我的故事 提交于 2019-12-07 03:01:18
问题 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 sounds are, I just want to fire them at exactly 0, 0.25, 0.5 and 0.75 seconds: AVMutableComposition *composition = [[AVMutableComposition alloc] init]; NSDictionary *options = @{AVURLAssetPreferPreciseDurationAndTimingKey : @YES}; for (NSInteger i = 0;

AVfoundation Reverse Video

僤鯓⒐⒋嵵緔 提交于 2019-12-06 00:05:14
问题 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 do this. Below links are refered by me http://www.raywenderlich.com/13418/how-to-play-record-edit-videos-in-ios Reverse video demo - https://github.com/mikaelhellqvist/ReverseClip Above example to no longer works in IOS 8. and even it is not

AVMutableComposition - Exporting wrong video transform

三世轮回 提交于 2019-12-05 07:53:00
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 screen size (by original orientation) some notes: videoAsset's CGRect is opposite from beginning. after export, video transform is wrong tried to rotate with no success for full size layer AVURLAsset*videoAsset = [[AVURLAsset alloc]initWithURL:url options:nil]; AVMutableComposition* mixComposition = [AVMixerBase compositionVideoTrackAssetUrl

precise timing with AVMutableComposition

泄露秘密 提交于 2019-12-05 06:13:47
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 sounds are, I just want to fire them at exactly 0, 0.25, 0.5 and 0.75 seconds: AVMutableComposition *composition = [[AVMutableComposition alloc] init]; NSDictionary *options = @{AVURLAssetPreferPreciseDurationAndTimingKey : @YES}; for (NSInteger i = 0; i < 4; i++) { AVMutableCompositionTrack* track = [composition addMutableTrackWithMediaType

Fixing orientation when stitching (merging) videos using AVMutableComposition

百般思念 提交于 2019-12-04 22:53:59
TLDR - SEE EDIT I am creating a test app in Swift where I want to stitch multiple videos together from my apps documents directory using AVMutableComposition . I have had success in doing this to some degree, all my videos are stitched together and everything is showing the correct size portrait and landscape. My issue is, however, that all the videos are showing in the orientation of the last video in the compilation. I know that to fix this I will need to add layer instructions for each track I add, however I can't seem to get this right, with the answers I have found the entire compilation

Weird behaviour of AVMutableComposition freezing while using AVMutableVideoComposition

喜夏-厌秋 提交于 2019-12-04 07:33:09
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 interesting thing is that it plays fine if I play it in Photos app of iPad after exporting using same videoComposition . So why does it freezes in AVPlayer at 6 seconds? Code: AVMutableComposition *mutableComposition = [AVMutableComposition composition]; AVMutableCompositionTrack *videoCompositionTrack = [mutableComposition addMutableTrackWithMediaType