avfoundation

Fetch All Audio & Video files in ios

こ雲淡風輕ζ 提交于 2019-12-09 03:26:31
问题 I want to fetch all audio files and also video files from device into the app. so that i can listed their names into the different UITableViews. Is there any way in ios, so that i can fetch them. 回答1: Have a look at this,specially on the section " Getting Media Items Programmatically ". If the media item picker doesn’t provide the control you want, you can use the database access classes from this API. These classes are designed to let you create arbitrarily complex queries. You could, for

Swift 3 : issue with AVVideoCompositionCoreAnimationTool to add watermark on video

左心房为你撑大大i 提交于 2019-12-09 01:34:24
问题 The following code was working perfectly to add a logo and a text to a video with AVVideoCompositionCoreAnimationTool. Then Swift 3 came! Now sometimes the video shows with the logo and text sometimes the video does not show when it is exported. let videoComposition: AVMutableVideoComposition = AVMutableVideoComposition() videoComposition.frameDuration = CMTimeMake(1, 60) videoComposition.renderSize = CGSize(width: clipVideoTrack.naturalSize.height, height: clipVideoTrack.naturalSize.height)

How to encode picture to H264 use AVFoundation on Mac, not use x264

旧街凉风 提交于 2019-12-09 01:31:47
问题 I'm trying to make a Mac broadcast client to encode into H264 using FFmpeg but not x264 library. So basically, I am able to get raw frames out from AVFoundation in either CMSampleBufferRef or AVPicture . So is there a way to encode a series of those pictures into H264 frames using Apple framework, like AVVideoCodecH264 . I know the way to encode it use AVAssetWriter, but that only saves the video into file, but I don't want the file, instead, I'd want to have AVPacket so I can send out using

Add custom metadata to video using AVFoundation

浪尽此生 提交于 2019-12-09 00:42:39
问题 I want to add some info (metadata) to a video. I have found a way to retrieve metadata, but did not find any solution to set or modify metadata. I am using AVURLAsset , AVAssetWritter also AVMutableComposition for creating the video. 回答1: Use -[AVAssetWriter setMetadata:]. This is set to an NSArray of AVMutableMetadataItem s. Note that you cannot set the value after writing has started. Metadata keys and keyspaces are listed in AVMetadataFormat.h . 回答2: When using AVMutableComposition , you

Square video using AVFoundation

淺唱寂寞╮ 提交于 2019-12-09 00:17:58
问题 I followed the given tutorial to create a custom square video recording camera. http://www.netwalk.be/article/record-square-video-ios I am able to export a square video from this, but when i try to play the newly exported file using the url it does not play. For the original url ,i tried was working fine and playing properly. I opened the documents directory of the phone and found that the video was getting cropped and a file was created but playing the video on quicktimeplayer it was

AVCaptureSession stopRunning method creates terrible hang

走远了吗. 提交于 2019-12-08 23:09:56
问题 Using Ray Wenderlich's QRCode reader from Chapter 22 of iOS7 Tutorials, I am successfully reading QRCodes for my current app. I am now extending it that upon successfully reading a QRCode, I want to store the stringValue of the AVMetadataMachineReadableCodeObject that was read, segue to a new view, and use that data on the new view, more or less exactly how most QRCode reader apps (like RedLaser, etc...) process barcodes and QRCodes. However, I call [captureSession stopRunning] (so that it

iOS. Record at 96kHz with USB microphone

♀尐吖头ヾ 提交于 2019-12-08 19:21:20
问题 I am trying to record at full 96kHz with my RØDE iXY USB microphone. Recording goes without error and when I launch the app with the mic connected, I see that AVAudioSession is running successfully at 96kHz sample rate. But if I look at the spectrum it is clear that there is nothing but resample noise above 20kHz: For comparison this is a spectrum of the same recording using the app bundled with the USB mic (RØDE Rec): Is there anything else I must do to record at native 96kHz? Or maybe the

Proper Volume Envelopes for AVAudioUnitSampler with AVFoundation

蹲街弑〆低调 提交于 2019-12-08 13:26:43
问题 How to properly create Volume Envelopes for the AVAudioUnitSampler? Basically I want to add a Attack Phase where the volume fades in over a couple of milliseconds to avoid clicks. Additionally I want to add a release phase so that the sound volume fades out after stoping to play the note. What I did so far: I set up a global Timer that represents my sample rate. For this I used a NSTimer with a interval length of 1 sample (for a sample rate of 44100 one sample duration is 1/44100). That way

Determine if a video file is NDF or DF (Drop Frame or Non-Drop Frame)

一笑奈何 提交于 2019-12-08 13:25:01
问题 I need to find whether a movie is Drop Frame or Non-Drop Frame. I'm trying to find it in the attributes for a video file in one of the xcode video frameworks (either QTMovie or something from AVFoundation). Not having much luck. I'm doing this to fill in necessary information in an FCP-X XML file. Does anyone have any experience with this? Important note, I am working in a 64 bit environment, and must stay there. 回答1: You can use CMTimeCodeFormatDescriptionGetTimeCodeFlags() to get the time

Recommended way of updating timeRange property on AVPlayerLooper

雨燕双飞 提交于 2019-12-08 12:48:26
问题 I am building off of the AVPlayerLooper example code Apple provides, specifically utilizing the example AVPlayerLooper setup they've given you in PlayerLooper.swift , LooperViewController.swift , and the Looper.swift protocol. What I would like to do is be able to update the timeRange property on the AVPlayerLooper that is instantiated inside of the PlayerLooper.swift file. To this end, I have slightly modified the following function which instantiates and starts the player looper: func start