avfoundation

AVPlayer is not playing in iOS 11

三世轮回 提交于 2019-12-06 23:55:45
问题 I am facing an issue with AVPlayer in iOS 11. The same code is working perfectly on iOS 10. I used DRM for playing the video. I am getting below warning : 2017-11-22 20:48:09.237095+0530 AppName[9113:3782887] [] <<<< AVOutputDeviceDiscoverySession (FigRouteDiscoverer) >>>> - [AVFigRouteDiscovererOutputDeviceDiscoverySessionImpl outputDeviceDiscoverySessionDidChangeDiscoveryMode:]: Setting device discovery mode to DiscoveryMode_None (client: AppName) 2017-11-22 20:48:09.266561+0530 AppName

iOS rotate video AVAsset avfoundation

别等时光非礼了梦想. 提交于 2019-12-06 22:36:24
Example Hi, Struggling to rotate this video to show in the proper orientation and fill the entire screen. I cannot get the avasset with videocompisition but cannot get it to work correctly. let videoAsset: AVAsset = AVAsset(URL: outputFileURL) as AVAsset let clipVideoTrack = videoAsset.tracksWithMediaType(AVMediaTypeVideo).first! as AVAssetTrack let newHeight = CGFloat(clipVideoTrack.naturalSize.height/3*4) let composition = AVMutableComposition() composition.addMutableTrackWithMediaType(AVMediaTypeVideo, preferredTrackID: CMPersistentTrackID()) let videoComposition = AVMutableVideoComposition

What's the best way to composite frame-based animated stickers over recorded video?

荒凉一梦 提交于 2019-12-06 20:50:38
We want to allow the user to place animated "stickers" over video that they record in the app and are considering different ways to composite these stickers. Create a video in code from the frame-based animated stickers (which can be rotated, and have translations applied to them) using AVAssetWriter . The problem is that AVAssetWriter only writes to a file and doesn't keep transparency. This would prevent us from being able to overly it over the video using AVMutableComposition . Create .mov files ahead of time for our frame based stickers and composite them using AVMutableComposition and

How to set iOS app to use usb audio for input and output to internal speakers

為{幸葍}努か 提交于 2019-12-06 17:25:47
问题 I have 2 different makes of guitar adapters that connect to my iphone using the lightning connector When adapter 1 is plugged in, the device becomes a usb audio mic and it plays the sound through my iPhone's speakers as the adapter does not contain a headphone socket When adapter 2 is plugged in, the device becomes a usb audio mic but plays the sound through the headphone socket on the adapter. I'm trying to write an app that work with adapter 2, but rather than output the sound to the

iPhone Mic volume

只愿长相守 提交于 2019-12-06 17:21:40
问题 Is there any way to poll the mic input volume with AVFoundation? I have seen the CoreAudio examples like SpeakHere but I really only need the current value. Is CA my only option? 回答1: You should checkout SCListener. It's a simple way just to get the average or peak level of the mic. http://github.com/stephencelis/sc_listener 来源: https://stackoverflow.com/questions/477020/iphone-mic-volume

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

寵の児 提交于 2019-12-06 16:22:10
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, filter to enumerate just videos. [group setAssetsFilter:[ALAssetsFilter allVideos]]; [group

iOS 9 : AVFoundation Export Session is missing audio

情到浓时终转凉″ 提交于 2019-12-06 16:02:21
I'm using the below code snipped while merging videos with original audio. It has been working until I upgraded to iOS9. Anyone faced the same issue and any help to resolve would be greatly appreciated. I couldn't find anything after researching whole day. AVAssetTrack *videoTrack = nil; AVAssetTrack *audioTrack = nil; CMTime insertionPoint = kCMTimeZero; if([[url tracksWithMediaType:AVMediaTypeVideo] count] != 0) { videoTrack = [url tracksWithMediaType:AVMediaTypeVideo][0]; } if([[url tracksWithMediaType:AVMediaTypeAudio] count] != 0) { audioTrack = [url tracksWithMediaType:AVMediaTypeAudio]

is it possible to set GIF image with video?

不问归期 提交于 2019-12-06 15:53:18
问题 I am trying to combine video with GIF image, For this I am using MainCompositionInst.animationTool = [AVVideoCompositionCoreAnimationTool videoCompositionCoreAnimationToolWithPostProcessingAsVideoLayer:videoLayer inLayer:parentLayer]; and in the video layer I was set GIF image but unfortunately it was not animating, So my question is that is it possible to do this ? please suggest me.. Thanks in advance. 回答1: Apple's support for GIF is fairly limited. You could use this code to convert from

Screen capture during video preview fails

耗尽温柔 提交于 2019-12-06 15:37:07
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 = AVCaptureSessionPresetHigh let devices = AVCaptureDevice.devices(); // Loop through all the capture devices on this phone

Apply Core Image Filter to Video on OS X using Swift

﹥>﹥吖頭↗ 提交于 2019-12-06 14:58:43
I am planning to build an NSOpenGLView for an OS X app using SWIFT which can be used to apply Core Image Filter and effects to a video, so far I have worked on the code for the video Controller to add video playback, but I am not sure how to apply the filter to the video: class VideoMediaViewController: NSViewController { weak var mainView : DTMainViewController? @IBOutlet weak var aVPlayerView: AVPlayerView! var url:NSURL?{ didSet{ // this is the setter } } var observer:AnyObject? var player:AVPlayer? var videoOutput:AVPlayerItemVideoOutput? var ciContext:CIContext? var loadStatus:NSNumber?