avmutablecomposition

Weird behaviour of AVMutableComposition freezing while using AVMutableVideoComposition

馋奶兔 提交于 2019-12-21 13:14:06
问题 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

AVAssetExportSession giving me a green border on right and bottom of output video

血红的双手。 提交于 2019-12-20 12:15:24
问题 Here's the code: AVAssetExportSession *exporter = [[AVAssetExportSession alloc] initWithAsset:mixComposition presetName:AVAssetExportPresetHighestQuality]; exporter.outputURL = outputUrl; exporter.outputFileType = AVFileTypeQuickTimeMovie; exporter.videoComposition = mainComposition; exporter.shouldOptimizeForNetworkUse = YES; [exporter exportAsynchronouslyWithCompletionHandler:^{ //completion }]; I've tried different quality settings. I always get a 1-2 pixel border running down the right

Create video with AVVideoCompositionCoreAnimationTool and AVAssetExportSession SLOW

ぃ、小莉子 提交于 2019-12-20 05:53:50
问题 I create an animation with layers and I want to export a video with that animations. So I use AVAssetExportSession, but it take a long time to export. Maybe I can use another thing? I really need help! let videoURL = NSURL.init(fileURLWithPath: "/Users/Downloads/img_2040.mp4") let audioURL = NSURL.init(fileURLWithPath: "/Users/Downloads/music_10sm.m4a") let videoAsset = AVURLAsset.init(url: videoURL as URL) let audioAsset = AVURLAsset.init(url: audioURL as URL) let mixComposition =

Composing Video and Audio - Video's audio is gone

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-20 03:14:35
问题 My question is, I am using the function below, to compose a video and audio. I want to keep video's original sound but it goes away somehow, I do not have any clue. I got this function from this answer I tried to change volumes right after appending AVMutableCompositionTrack s but it did not work For instance; mutableVideoCompositionTrack.prefferedVolume = 1.0 mutableAudioCompositionTrack.prefferedVolume = 0.05 But still, all you can hear is only the audio file. The function; private func

Issue while merging Video & Audio iOS swift4

余生颓废 提交于 2019-12-14 03:25:44
问题 2019-04-10 10:49:51.590008+0500 VTKaraokeView[869:1039603] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArray0 objectAtIndex:]: index 0 beyond bounds for empty NSArray' Hi iOS Gurus! I'm merging Video & Audio files(.mp4 & .mp3 file)... BACKGROUND & PROBLEM STATEMENT:- As I'm working on an App like karaoke... I'm recording Video with Background Music and then AFTER MERGING this recorded video & background music into new newVideo.mp4 file and then Playing

Black Video outputted via AVMutableVideoComposition and CAAnimation

∥☆過路亽.° 提交于 2019-12-13 03:45:45
问题 I am building iOS application that is able to record video and add animation overlay over recorded video with AVFoundation and CAAnimation . All sub features are working fine but end of video's background is black while animation is playing. It's not rendering background video that I selected. I've used AVAssetWriter to record video and it's well played on camera roll. But if I use this recorded video to add overlay, end of video's background is black. Interesting thing is if I record video

AVAssetTrack with alpha channel?

一世执手 提交于 2019-12-11 14:56:37
问题 I am trying to layer AVAssetTracks in an AVMutableComposition where the AVAssetTracks have an alpha channel in the video. I have successfully exported an video AVAsset with pixel buffers than have an alpha channel and transparency, but when I try to add that into an AVMutableCompositionTrack and layer it, it doesnt display correctly. Is this possible? Is the magic performed when the AVAsset is created or in a the AVMutableComposition or AVVideoComposition? Any clues would be a huge help. 回答1:

AVMutableComposition - Only Playing First Track (Swift)

情到浓时终转凉″ 提交于 2019-12-11 13:43:05
问题 I have an array of [AVAsset], and I am trying to combine all of those Assets into a single Asset so that I can play back the video seamlessly (I tried using an AVQueuePlayer, but that does not play back the assets seamlessly). Below is what I have so far, but when I try to play the final composition, it only plays the first track, even though it shows that it has all tracks and the total duration equals all of the tracks together. Am I missing a step, even though it appears that all the

AVAssetExportSession is greatly reducing video quality

ぐ巨炮叔叔 提交于 2019-12-11 06:35:48
问题 I have a local video url that I am trying to put an overlay on. It all works properly, but the quality of the video is being drastically reduced upon export. I have narrowed it down to find that it happens when I set the AVAssetExportSession.videoComposition (which I need to do for the overlay). If I set the export preset quality to Passthrough, then the video doesn't lose quality but the overlays don't appear. func merge3(url: URL) { activityMonitor.startAnimating() let firstAsset = AVAsset

AVPlayer with one video tracks and multiples audio tracks

老子叫甜甜 提交于 2019-12-10 20:27:54
问题 I'm trying to make a player in my App capable to have one video tracks and multiples audio tracks (for differents languages). I've done this but the player won't launch : AVMutableComposition *composition = [AVMutableComposition composition]; AVURLAsset* videoAsset = [[AVURLAsset alloc]initWithURL:urlVideo options:nil]; AVMutableCompositionTrack *compositionVideoTrack = [composition addMutableTrackWithMediaType:AVMediaTypeVideo preferredTrackID:kCMPersistentTrackID_Invalid]; NSError* error =