avfoundation

iOS AVfoundation overlay video with video

人走茶凉 提交于 2019-12-10 12:24:47
问题 I have main video and I want to overlay it with another animated video with alpha channel like "Action Movie FX" application. How can I do it with AVfoundation, or can you suggest third-party framework? Thanks 回答1: GPUImage by Brad Larson is a great third-party framework for this kind of thing. It has many different blending algorithms you can choose from. This thread has code similar to what you want to do. 回答2: I would suggest that you take a look at my 3rd party framework to do this sort

kAudioFormat for .aif audio file conversion?

不问归期 提交于 2019-12-10 12:23:55
问题 I would like to convert/save audio file to AIFF audio format from AAC format. Default i'm trying with LineraPCM . . But the audio format saving in AAC format. . I would like to save the audio file in AIFF format.Here's my code NSDictionary *outputSettings = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:kAudioFormatLinearPCM], AVFormatIDKey, [NSNumber numberWithFloat:44100.0], AVSampleRateKey, [NSNumber numberWithInt:2], AVNumberOfChannelsKey, [NSData dataWithBytes:

Changing setPreferredIOBufferDuration at Runtime results in Core Audio Error -50

故事扮演 提交于 2019-12-10 12:07:19
问题 I am writing an Audio Unit (remote IO) based app that displays waveforms at a given buffer size. The app initially starts off with a preferred buffer size of 0.0001 which results in very small buffer frame sizes (i think its 14 frames). Than at runtime I have a UI element that allows switching buffer frame sizes via AVAudioSession 's method setPreferredIOBufferDuration:Error: . Here is the code where the first two cases change from a smaller to a larger sized buffer. 3-5 are not specified yet

How to generate images from already recorded video using AVAssetImageGeneratorCompletionHandler block?

◇◆丶佛笑我妖孽 提交于 2019-12-10 11:56:13
问题 This might be a silly question but sorry for that as i am a newbie to iPhone. I want to generate images for every frames of video and display that in UIScrollview inside UIImageView. When i am trying to do that i am getting memory warning and my app crashes. Below is my code. - (IBAction)onCameraButtonPressed:(id)sender { // Initialize UIImagePickerController to select a movie from the camera roll. UIImagePickerController *videoPicker = [[UIImagePickerController alloc] init]; videoPicker

How to capture image with AVFoundation framework?

こ雲淡風輕ζ 提交于 2019-12-10 11:47:17
问题 I have following code to open the camera in UIView ,that is working right now. But i have two buttons like in this screen shot one for capturing photo and another one for upload photo from library. How do i capture photo without going to native camera ? Here is my .h file code #import <UIKit/UIKit.h> #import <AVFoundation/AVFoundation.h> @interface bgCameraController : UIViewController<AVCaptureMetadataOutputObjectsDelegate> @property (weak, nonatomic) IBOutlet UIView *cam; @property (strong,

How to correctly stop and remove an audioTapProcessor in iOS11

送分小仙女□ 提交于 2019-12-10 11:41:56
问题 I'm using an audioTapProcessor similar to the audioTap example from apple. Basically, the audioTapProcessor is created and added to the audioMix: MTAudioProcessingTapRef audioProcessingTap; if (noErr == MTAudioProcessingTapCreate(kCFAllocatorDefault, &callbacks, kMTAudioProcessingTapCreationFlag_PreEffects, &audioProcessingTap)) { audioMixInputParameters.audioTapProcessor = audioProcessingTap; CFRelease(audioProcessingTap); audioMix.inputParameters = @[audioMixInputParameters]; _audioMix =

How to apply reverb filter or any other sound effect to a .wav sound file?

青春壹個敷衍的年華 提交于 2019-12-10 11:27:14
问题 I need to apply the reverb filter to my sound file in my ipad app. I just found a keyword AVMetadataID3MetadataKeyReverb in the apple documentation, but not able to get how to use it. This has been added from iOS 4.0. 回答1: The AVMetadataID3MetadataKeyReverb constant represents the RVRB field of and ID3(V2) tag - which is simply a piece of metadata that's part of an audio container file (like MP3). The constant isn't related to applying an actual reverb effect to a piece of audio data, but to

How to Animate Images while converting to Video

会有一股神秘感。 提交于 2019-12-10 10:24:51
问题 I want to animate images smoothly while converting them to video. Dispite of searching SO, I am unable to understand how to achive it. I tried changing the Rotation angle(CGAffineTransformRotation), Translations and Scaling but didn't found a way to for the smooth animations. Heres how I am converting array of photos to video : - (void)createVideoWithArrayImages:(NSMutableArray*)images size:(CGSize)size time:(float)time output:(NSURL*)output { //getting a random path NSError *error;

Playing wav sound file with AVFoundation

心已入冬 提交于 2019-12-10 10:18:10
问题 I am using AVFoundation to play wav files. But i could not make it play. Also no errors or warnings showed up. XCode is 4.2 and device is iOS 5. - (IBAction) playSelectedAlarm:(id)sender { UIButton *button = (UIButton *)sender; int bTag = button.tag; NSString *fileName = [NSString stringWithFormat:@"%d23333", bTag]; NSLog(@"%@", fileName); NSString *path = [[NSBundle mainBundle] pathForResource:fileName ofType:@"wav"]; NSURL *fileURL = [[NSURL alloc] initFileURLWithPath: path]; AVAudioPlayer

AVPlayer doesn't play more than one time

拜拜、爱过 提交于 2019-12-10 09:43:40
问题 I have some strange problem with playing audio through AVPlayerItem & AVPlayer. I have recorder and iPod item picker, stream from both of them are going through code like this: AVAudioSession *audioSession = [AVAudioSession sharedInstance]; [audioSession setCategory:AVAudioSessionCategoryPlayback error:nil]; [audioSession setActive:YES error:nil]; _playerItem = [[AVPlayerItem alloc] initWithURL:_soundFileURL]; _player = [[AVPlayer alloc] initWithPlayerItem:_playerItem]; [_player play];