avfoundation

Swift, AVAudioRecorder: Error 317: ca_debug_string: inPropertyData == NULL

断了今生、忘了曾经 提交于 2020-05-25 01:09:06
问题 I know that there are threads where this error message appears but they do not really supply an answer to the problem, this is why I decided open up another thread and ask again... hoping someone else has come across the same problem, solving it. import UIKit import AVFoundation class RecordSoundsViewController: UIViewController, AVAudioRecorderDelegate { // MARK: IBOutlets for Buttons @IBOutlet weak var recordingLable: UILabel! @IBOutlet weak var recordButton: UIButton! @IBOutlet weak var

How to create a anAudioSampleBuffer for CMSampleBufferGetFormatDescription in iOS Swift

心已入冬 提交于 2020-05-15 08:39:11
问题 I have been working on video compression in iOS Swift, and following this SO's answer. It is working fine until I change this piece of code's file format to .mp4 let videoWriter = try! AVAssetWriter(outputURL: outputURL as URL, fileType: AVFileType.mov) There are reasons that I need the output in .mp4 file format. So when I do that it crashes the app. And gives me this error, 2020-04-27 18:20:52.573614+0500 BrightCaster[7847:1513728] *** Terminating app due to uncaught exception

Adding watermark to currently recording video and save with watermark

▼魔方 西西 提交于 2020-05-14 07:38:26
问题 I would like to know if there is any way to add a watermark to a video which is currently recording and save it with the watermark. (I know about adding watermarks to video files that are already available in app bundle and exporting it with watermark). iPhone Watermark on recorded Video. I checked this link. Accepted answer is not good one. The most voted answer is applicable only if there is already a video file in your bundle. (Please read the answer before suggesting that.) Thanks in

Draw button on top of AVPlayer

做~自己de王妃 提交于 2020-04-29 06:21:51
问题 I have to draw a label or button on top of video relay next previous , leave comment . List of video have it, once user select one item from the table,it need to play, Once player play finished, those buttons or label should come on top of video Here is my code : comPlayerControl = AVPlayerViewController() if let player = comPlayerControl { let videoURL: String = "http://cdnapi.kaltura.com/p/11/sp/11/playManifest/entryId/"+selectedSubmission.transcodeRefId+"/format/applehttp/protocol/http/a

Crash when using front camera ONLY on pre-iPhone 7 devices

混江龙づ霸主 提交于 2020-04-18 04:02:38
问题 I've recently started running beta on my camera-based app. Everything is working as expected except on iPhone 6 devices. The session starts on the back camera, and each time an iPhone 6 user switches to the front camera the app crashes. (And just to be really clear: no one on any other iPhone model is experiencing the issue.) I've gotten my hands on a 6 to test and can consistently reproduce the error, resulting in libc++abi.dylib: terminating with uncaught exception of type NSException . I

Adding a structure to a NSDictionary

情到浓时终转凉″ 提交于 2020-03-27 18:24:13
问题 I am creating a CMVideoFormatDescriptionRef out of thin air using this code: CMVideoDimensions dimensions = { .width = width, .height = height }; CMVideoFormatDescriptionRef videoInfo = NULL; NSDictionary *options2 = [NSDictionary dictionaryWithObjectsAndKeys: @(YES), kCVPixelBufferCGImageCompatibilityKey, @(YES), kCVPixelBufferCGBitmapContextCompatibilityKey, dimensions, kCVImageBufferDisplayDimensionsKey, nil]; CFDictionaryRef dictOptionsRef = (__bridge CFDictionaryRef)options2;

iOS + AVFoundation. Different photo brightness with the same manual exposure settings

China☆狼群 提交于 2020-03-22 09:48:08
问题 I use AVFoundation to take photos. Trouble is that even with constant settings of exposure duration, ISO and white balance I get photos with different brightness. Torch, flash and all possible stabilizations are disabled. This issue is also presented in standard Apple app introducing working with camera: https://developer.apple.com/library/ios/samplecode/AVCam/Introduction/Intro.html#//apple_ref/doc/uid/DTS40010112 This is the video I filmed via this app containing no changes except setting

Generate images from AVAssetImageGenerator gives same image duplicates for different times

≡放荡痞女 提交于 2020-03-22 07:43:29
问题 I am trying to generate thumbnail images from a video using the following code. It does generate UIImages but the images are all the same at different time. For example, for a video which lasts 3 seconds, it will generate 6 images but all the images are the same image for the very beginning of the video. Any ideas on what I did wrong? let asset = AVAsset(url: videoURL) let imageGenerator = AVAssetImageGenerator(asset: asset) let scale = 2 let step = 1 let duration = Int(CMTimeGetSeconds(asset

AudioUnit inputCallback with AudioUnitRender -> mismatch between audioBufferList.mBuffers[0].mDataByteSize != inNumberFrames

一个人想着一个人 提交于 2020-03-05 04:11:25
问题 We are using the AudioUnits input callback to process the incoming buffer. The audio unit setup is taken mostly from https://github.com/robovm/apple-ios-samples/blob/master/aurioTouch/Classes/AudioController.mm I have added some sanity check in the audio callback. It looks like this /// The audio input callback static OSStatus audioInputCallback(void __unused *inRefCon, AudioUnitRenderActionFlags *ioActionFlags, const AudioTimeStamp *inTimeStamp, UInt32 __unused inBusNumber, UInt32

Decode AAC to PCM format using AVAudioConverter Swift

泪湿孤枕 提交于 2020-02-18 05:20:26
问题 How convert AAC to PCM using AVAudioConverter, AVAudioCompressedBuffer and AVAudioPCMBuffer on Swift? On WWDC 2015, 507 Session was said, that AVAudioConverter can encode and decode PCM buffer, was showed encode example, but wasn't showed examples with decoding. I tried decode, and something doesn't work. I don't know what:( Calls: //buffer - it's AVAudioPCMBuffer from AVAudioInputNode(AVAudioEngine) let aacBuffer = AudioBufferConverter.convertToAAC(from: buffer, error: nil) //has data let