avfoundation

I'm trying to use AVQueuePlayer to create a seamless audio loop, however, I don't know why there is a small silent pause between loops?

为君一笑 提交于 2019-12-11 06:49:44
问题 I have a simple audio file in .wav format (the audio file is cut perfectly to loop). I've tried different methods to loop it. My first attempt was simply using AVPlayer and NSNotification to detect when audioItem ended to seek time at zero and play again. However, there was clearly a gap. I've been looking at different solutions online, and found people using AVQueuePlayer to do a switching: Looping AVPlayer seamlessly However, when implemented, this still produces a gap. Here's my current

Why don't the WWDC 2010 video capture samples work in the Simulator?

强颜欢笑 提交于 2019-12-11 06:38:26
问题 I downloaded the latest video capture samples from WWDC 2010 and am trying to run them in my simulator. Samples in general are supposed to run without any tinkering so I just unzipped a bunch of them and tried to run them in Xcode. None of the ones I tried runs. For example when I unzip and try to build findMyiCone I get 45 errors. Here are the first few lines In file included from /Users/aw/Desktop/Sample code/WWDC10-SampleCode/FindMyiCone/Classes/ProcessViewController.h:49, from /Users/aw

Recording locations in time domain with AVFoundation

喜夏-厌秋 提交于 2019-12-11 06:14:18
问题 I followed a lot of tutorials and every tutorials about recording in AVFoundation covers only recording Video or Audio or both of this things. I would like to record some location in the same time domain like Video/Audio on separate track. This location waypoints is described with 5 properties only - latitude, longitude, altitude, startTime, duration and it'll be changing no often that 5 seconds of the recording. This recording is for presentation purposes and I need functionality such as

Why AVAssetImageGenerator generateCGImagesAsynchronouslyForTimes crashes the app

[亡魂溺海] 提交于 2019-12-11 05:36:42
问题 I am trying to extract 2 frames per second from a video using generateCGImagesAsynchronouslyForTimes . But my app crashes. I am monitoring the memory usage but its not going any way up than 14 mb. Here is the code: - (void) createImagesFromVideoURL:(NSURL *) videoUrl atFPS: (int) reqiuredFPS completionBlock: (void(^) (NSMutableArray *frames, CGSize frameSize)) block { NSMutableArray *requiredFrames = [[NSMutableArray alloc] init]; AVURLAsset *asset = [[AVURLAsset alloc] initWithURL:videoUrl

Detecting end of the playback in AVAudioPlayer

天大地大妈咪最大 提交于 2019-12-11 05:32:21
问题 I've got couple of short .mp3 sounds which I'm storing in the array and would like to play them consecutively. Is there any way to detect when AVAudioPlayer stopped playing so that I could call a completion handler and play next sound? I know that there is a delegate for that but I'm using Playground and SKScene. 回答1: Hellp @codddeer123, AVAudioPlayer contains AVAudioPlayerDelegte method which is called on audio playing completed. I have implemented it as extension of my class, you can do as

AVQueuePlayer sometimes moves to the next AVPlayerItem in its items queue without sending AVPlayerItemDidPlayToEndTimeNotification

雨燕双飞 提交于 2019-12-11 05:30:57
问题 I'm using AVQueuePlayer to play a couple of streams in order. But often the AVQueuePlayer decides to skip to the next song without sending AVPlayerItemDidPlayToEndTimeNotification . Also no error is logged in the player. The streaming protocol used is Http Live Streaming. Could this behavoir be due to a problem with the streams? Has anyone else encountered it? 回答1: Have you checked the status of the item that didn't play? It may have failed, for some reason. 来源: https://stackoverflow.com

How to set scanning bound using AVFoundation

与世无争的帅哥 提交于 2019-12-11 05:28:09
问题 I am trying barcode scanner in one of my iOS application. I had successfully implemented the barcode scanner. But currently barcode scanning is displayed in full screen only. But what I want is that, the video should be viewed in full screen and the barcode should be scanned in particular portion only. That is, if the barcode is placed in that portion then only it should be displayed. Below is my current code: session=[[AVCaptureSession alloc]init]; device=[AVCaptureDevice

AVAssetExportSession with and without break points

给你一囗甜甜゛ 提交于 2019-12-11 05:27:16
问题 I have simple video compression code in low quality conversion.I am testing my code in iphone 4 with IOS-4.2.1.The problem is when I test my code on device without break points the code failed to create video(it just a zero kb file or empty file created) but when I use breakpoint checking line by line this code slowly it will make a perfect compressed video which also runs on quicktime player in mac.After compression I make zip of this video file. NSURL *videoURL=[[self.videourlarray

Skip over frames while processing video on iOS

烂漫一生 提交于 2019-12-11 04:54:06
问题 I'm trying to process a local video file and simply do some analysis on the pixel data. Nothing is being output. My current code iterates through each frame of the video but I'd actually like to skip ~15 frames at a time to speed things up. Is there a way to skip over frames without decoding them? In Ffmpeg, I could simply call av_read_frame without calling avcodec_decode_video2. Thanks in advance! Here's my current code: - (void) readMovie:(NSURL *)url { [self performSelectorOnMainThread:

Disable gesture recognizer in AVPlayerViewController

帅比萌擦擦* 提交于 2019-12-11 04:47:55
问题 In AVPlayerViewController there is a feature for stopping the playback of a video and closing the AVPlayerViewController by swiping its view. I want to disable this feature. I guess I need to disable a gesture recognizer!? But I don’t know how to do this for the player. 回答1: I recently stumbled upon a similar problem. You can access the gesture recognizers from the contentView of AVPlayerViewController . If you wanted to keep only the tap gesture recognizer, you might want to use a function