avfoundation

AVAssetResourceLoader backed AVURLAsset playback fails only via AirPlay

萝らか妹 提交于 2019-12-23 12:23:58
问题 For reasons irrelevant to my question I have to implement an AVPlayer playing back AVURLAssets using a custom AVAssetResourceLoader . In general my implementation works well, but when attempting external playback via AirPlay (not mirroring): self.player.allowsExternalPlayback = YES; self.player.usesExternalPlaybackWhileExternalScreenIsActive = YES; The playback fails with an error message on the AppleTV and an error message posted via AVPlayerItemFailedToPlayToEndTimeNotification . I am able

AVAssetResourceLoader backed AVURLAsset playback fails only via AirPlay

余生长醉 提交于 2019-12-23 12:22:50
问题 For reasons irrelevant to my question I have to implement an AVPlayer playing back AVURLAssets using a custom AVAssetResourceLoader . In general my implementation works well, but when attempting external playback via AirPlay (not mirroring): self.player.allowsExternalPlayback = YES; self.player.usesExternalPlaybackWhileExternalScreenIsActive = YES; The playback fails with an error message on the AppleTV and an error message posted via AVPlayerItemFailedToPlayToEndTimeNotification . I am able

AVAudioRecorder in iOS 8 does not handle kAudioFormatMPEG4AAC

旧时模样 提交于 2019-12-23 10:00:53
问题 My code worked fine until iOS 8 kAudioFormatMPEG4AAC but now it creates an empty file. No errors are reported. When I changed it to kAudioFormatLinearPCM it works. This is my code: recordSettings = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:AVAudioQualityMin], AVEncoderAudioQualityKey, [NSNumber numberWithInt: kAudioFormatLinearPCM], AVFormatIDKey, [NSNumber numberWithInt:16], AVEncoderBitRateKey, [NSNumber numberWithInt: 1], AVNumberOfChannelsKey, [NSNumber

Understand if an AVCaptureDeviceFormat suits video recording

久未见 提交于 2019-12-23 08:49:51
问题 In an app that I'm developing I'd like to let the user choose the the resolution of video recording. Due to specification, I can't use AVCaptureSessionPreset constants. Getting format list there are resolutions above 3000px that of course can't work for video grabbing but only for photo shooting. AVCaptureDeviceFormat: 0x17020c830 'vide'/'420f' 3264x2448, { 2- 30 fps}, HRSI:3264x2448, fov:58.040, max zoom:153.00 (upscales @1.00), AF System:2, ISO:29.0-1856.0, SS:0.000013-0.500000 I can't find

iOS - Record the Voice while phone call in Objective c

自古美人都是妖i 提交于 2019-12-23 05:15:10
问题 Is it possible for an app which records the voice of the user while a phone call? I searched for it and the AVFoundation Framework seems to stop recording when a phone call is incoming. I don't want to record the whole call, I am just interested in record what the user of the iPhone is saying. I know that this possibility might be a safety risk, but it would be nice for e.g an interview. In case of no possibility to do it like i want, i have to create my own VoIP connection and then i can

torchLevel KVO - iOS

北慕城南 提交于 2019-12-23 04:32:32
问题 I am using AVFoundation in iOS to manipulate the torch on an iPhone 6. I need to know the current torch level. I've read in AppleDevLib that it's possible to observe the current torch level using KVO, but I've failed to implement that. Can you put down some sample that detect change of torch level and then changes a variable (like label on screen etc.) please? It will help me a lot. 回答1: It took a while for me to figure out how to do this but I believe this KVO code will work for you. I haven

Find assets in library - add to a AVMutableComposition - export = crash

拜拜、爱过 提交于 2019-12-23 04:06:06
问题 I've been struggling with adding assets from the iPhone Photo Library to a AVMutableComposition and then export them. Here is what I got: Finding the assets: (here I grab the AVURLAsset) -(void) findAssets { ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init]; // Enumerate just the photos and videos group by using ALAssetsGroupSavedPhotos. [library enumerateGroupsWithTypes:ALAssetsGroupSavedPhotos usingBlock:^(ALAssetsGroup *group, BOOL *stop) { // Within the group enumeration block,

No audio in video recording (using GPUImage) after initializing The Amazing Audio Engine

本小妞迷上赌 提交于 2019-12-23 03:32:17
问题 I'm using two third party tools in my project. One is "The Amazing Audio Engine". I use this for audio filters. The other is GPUImage, or more specifically, GPUImageMovieWriter. When I record videos, I merge an audio recording with the video. This works fine. However, sometimes I do not use The Amazing Audio Engine and just record a normal video using GPUImageMovieWriter. The problem is, even just after initializing The Amazing Audio Engine, the video has only a fraction of a second of audio

Objective-C How To Add Overlay To Video Using AVFoundation?

心已入冬 提交于 2019-12-23 03:17:07
问题 I've been trying to add overlay to a video for days now, and I just can't figure out why when I save, the video gets rotated ninety degrees to the left. I've been trying to fix it but this is as close to it as I have gotten. At the moment the session preset is at AVCaptureSessionPreset1920x1080. When I rotate the video it shrinks, and I have to translate it to the center. I can't manage to get the video to be full screen after I rotate it. Please someone help I really really need it. I'll do

Screen capture during video preview fails

血红的双手。 提交于 2019-12-23 03:06:41
问题 I'm trying to capture the screen while doing a video preview with AVFoundation (AVCaptureDeviceInput and AVCaptureVideoDataOutput) Initiate preview: func startCamera(){ var screenSize = UIScreen.mainScreen().bounds.size; self.previewView = UIView(frame: CGRectMake(0, 0, UIScreen.mainScreen().bounds.size.width, UIScreen.mainScreen().bounds.size.height)); self.previewView.contentMode = UIViewContentMode.ScaleAspectFit self.view.addSubview(previewView); session.sessionPreset =