avassetexportsession

AVFoundation exporting orientation wrong

纵然是瞬间 提交于 2019-12-09 05:28:06
问题 I'm attempting to combine an image and a video. I have them combining and exporting however it's rotated side ways. Sorry for the bulk code paste. I've seen answers about applying a transform to compositionVideoTrack.preferredTransform however that does nothing. Adding to AVMutableVideoCompositionInstruction does nothing also. I feel like this area is where things start to go wrong. here here: // I feel like this loading here is the problem let videoTrack = videoAsset.tracksWithMediaType

AVAssetExportSession not working in ios5

混江龙づ霸主 提交于 2019-12-08 08:43:21
问题 In my application I am combining two audio files using AVAssetExportSession and it works fine in earlier ios versions.But in ios5 device its not working. What i am getting is an error AVAssetExportSessionStatusFailed: Error Domain=AVFoundationErrorDomain Code=-11820 "Cannot Complete Export" UserInfo=0x1df1c0 {NSLocalizedRecoverySuggestion=Try exporting again., NSLocalizedDescription=Cannot Complete Export} The code that I use for exporting is given below Did anyone experience the same issue?

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

Add chapter information to existing video with AVFoundation

左心房为你撑大大i 提交于 2019-12-07 09:15:35
I am trying to add chapter markers (text + images) to an existing video in iOS. Reading them is trivially easy with builtin functions: NSLocale * locale = [chapterLocalications lastObject]; NSLog(@"Locale: %@", [locale localeIdentifier]); NSArray *keys = @[AVMetadataCommonKeyTitle, AVMetadataCommonKeyArtwork]; NSArray *chapters = [asset chapterMetadataGroupsWithTitleLocale:locale containingItemsWithCommonKeys:keys]; for (AVTimedMetadataGroup * metadataGroup in chapters) { NSArray * items = metadataGroup.items; CMTimeRange timeRange = metadataGroup.timeRange; NSLog(@"time: %@",

AVAssetExportSession fails - Merging 2 WAV files (iOS7)

让人想犯罪 __ 提交于 2019-12-06 19:54:24
问题 I am attempting to merge 2 WAV files, using an AVAssetExportSession, under iOS7. I've confirmed the files are there and don't seem to be corrupt or anything. These are WAV files that were taken from recordings done from the device itself, and they are relatively small files. When it calls the exportAsync method, it fails immediately with an "Operation Stopped" error immediately in the completion block (reason description is: "The operation is not supported for this media"). This happens in

How to convert .caf Audio file into .mp4 file in swift

喜夏-厌秋 提交于 2019-12-06 13:32:54
I'm recording audio using device microphone with AVAudioRecorder which return file in .caf format that is playable only in Apple devices but not on Android devices. Since Apple is not supporting .mp3 file so I want to convert it in .mp4 format before uploading to server. Is .mp4 is good for audio only? Can I convert it with AVAssetExportSession ? Following is audio recorder code: func setupAudioRecorder () { let fileMgr = FileManager.default let dirPaths = fileMgr.urls(for:.documentDirectory, in:.userDomainMask) let soundFileURL = dirPaths[0].appendingPathComponent("myaudio.caf") let

iOS - AVAssestExportSession can only export maximum 8 tracks after playing with AVPlayer

这一生的挚爱 提交于 2019-12-06 08:33:53
问题 I'm trying to loop some fragments of a recorded video and merge them into one video. I've successfully merged and exported a composition with up to 16 tracks. But when I try to play the composition using AVPlayer before merging, I can only export a maximum of 8 tracks. First, I create AVComposition and AVVideoComposition +(void)previewUserClipDanceWithAudio:(NSURL*)videoURL audioURL:(NSURL*)audioFile loop:(NSArray*)loopTime slowMotion:(NSArray*)slowFactor showInViewController:

AVAssetExportSession fails - Merging 2 WAV files (iOS7)

我是研究僧i 提交于 2019-12-05 01:40:57
I am attempting to merge 2 WAV files, using an AVAssetExportSession, under iOS7. I've confirmed the files are there and don't seem to be corrupt or anything. These are WAV files that were taken from recordings done from the device itself, and they are relatively small files. When it calls the exportAsync method, it fails immediately with an "Operation Stopped" error immediately in the completion block (reason description is: "The operation is not supported for this media"). This happens in the simulator and the device itself. See below for my exporting code: NSError *avError = nil;

AVPlayer does not play video Instantly on iOS 10, while audio playing only

梦想与她 提交于 2019-12-04 23:07:53
问题 I am creating video with AVAssetExportSession and playing video when it finishes. But Visual Part not showing instantly but only audio is playing instantly. Visual part comes after some delay about of 20 - 30 seconds. Here is my code to play video -(void)playUrl:(NSURL *)vUrl{ [[NSNotificationCenter defaultCenter] removeObserver:self name:AVPlayerItemDidPlayToEndTimeNotification object:nil]; [[NSNotificationCenter defaultCenter] removeObserver:self name

Custom AVVideoCompositing class not working as expected

坚强是说给别人听的谎言 提交于 2019-12-04 17:24:27
问题 I'm attempting to apply a CIFilter to an AVAsset, and then save it with the filter applied. The way that I am doing this is by using an AVAssetExportSession with videoComposition set to an AVMutableVideoComposition object with a custom AVVideoCompositing class. I am also setting the instructions of my AVMutableVideoComposition object to a custom composition instruction class (conforming to AVMutableVideoCompositionInstruction). This class is passed a track ID, along with a few other