avassetwriter

Unable to export AVPlayerItem

为君一笑 提交于 2019-12-11 08:15:41
问题 I'm using AVQueuePlayer to do playback of a list of videos in our app. I'm trying to cache the videos that are played by AVQueuePlayer so that the video doesn't have to be downloaded each time. So, after the video finishes playing, I attempt to save the AVPlayerItem into disk so next time it's initialized with a local URL. I've tried to achieve this through two approaches: Use AVAssetExportSession Use AVAssetReader and AVAssetWriter. 1) AVAssetExportSession approach This approach works like

AVAssetWriter queue guidance Swift 3

耗尽温柔 提交于 2019-12-10 21:50:48
问题 can anyone give me some guidance on using Queues in AVFoundation please? Later on in my app I want to do some processing on individual frames so I need to use AVCaptureVideoDataOutput. To get started I thought I'd capture images and then write them (unprocessed) using AVAssetWriter. I am successfully streaming frames from camera to image preview by setting up an AVCapture session as follows: func initializeCameraAndMicrophone() { // set up the captureSession captureSession = AVCaptureSession(

Why won't AVFoundation accept my planar pixel buffers on an iOS device?

我的未来我决定 提交于 2019-12-10 19:42:51
问题 I've been struggling to figure out what the problem is with my code. I'm creating a planar CVPixelBufferRef to write to an AVAssetWriter . This pixel buffer is created manually through some other process (i.e., I'm not getting these samples from the camera or anything like that). On the iOS Simulator, it has no problem appending the samples and creating a valid output movie. But on the device, it immediately fails at the first sample and provides less than useless error information:

How to change video metadata using AVAssetWriter?

我怕爱的太早我们不能终老 提交于 2019-12-10 17:47:37
问题 How to change a video(.mp4) meta-info using a AVAssetWriter API? I want to not re-encode. only wanted to modify the video meta-info. how to write a next code? AVAssetWriter *writer = [AVAssetWriter assetWriterWithURL:[NSURL URLWithString:myPath] fileType:AVFileTypeQuickTimeMovie error:nil]; if I mistaken, give me some hint. Thanks!! 回答1: refer a following code. AVURLAsset *asset = [[AVURLAsset alloc] initWithURL:[NSURL fileURLWithPath:"your path"] options:nil]; NSMutableArray *metadata =

iOS how to correctly handle orientation when capturing video using AVAssetWriter

半腔热情 提交于 2019-12-10 11:28:42
问题 I am making a sample application that utilizes AVFoundation to record video. The whole point is so I can have more control over how the video is recorded. In my sample project I have the video capturing but am struggling with handling orientation correctly. I have done a lot of searching around the web and found that others are suggesting that I should NOT allow my capture view or capture session to rotate based on orientation, but rather set a transformation to rotate the video during

AVAssetWriter startWriting Problem

一笑奈何 提交于 2019-12-10 11:23:41
问题 AVAssetWriter startWriting is returning BOOL False value when i'm writing movie on 2G device, but for all other devices its returning TRUE value and working fine.Anyone faced this problem or do you have any clue why its happening,help me please 回答1: I am receiving false on startWriting on an iPad, when it works on both my iPhone3 and 4 (all have iOS 4.2). The status of the writer is failed, with the NSError as: "The operation couldn't be completed. (AVFoundationErrorDomain error -11800)."

iOS: How to make a movie with a series of images using AVAssetWriter

家住魔仙堡 提交于 2019-12-10 10:36:18
问题 I have seen this question asked many times in different forms both here and in other forums. Some of the questions get answered, some do not. There are a few where the answerer or author claims to have had success. I have implemented the examples from those that claim success, but have yet to see the same results. I am able to successfully use AVAssetWriter (and AVAssetWriterInputPixelBufferAdaptor) to write image data and audio data simultaneously when the sample buffers are obtained from an

AVAssetWriter Outputting Large File (even when applying compression settings)

孤街浪徒 提交于 2019-12-10 09:45:13
问题 I'm working on a personal iOS project that requires full screen videos (15 seconds in length) to be uploaded to a backend over a 4G connection. While I can take videos just fine, the output size of the file comes out to 30MB which makes me think I'm doing something drastically wrong when it comes to compression. Below is the code I'm using to se up the AssetWriter: -(void)captureOutput:(AVCaptureFileOutput *)captureOutput didStartRecordingToOutputFileAtURL:(NSURL *)fileURL fromConnections:

Iphone SDK,Create a Video from UIImage

无人久伴 提交于 2019-12-09 06:49:41
问题 i needs to create a video from the image selected. i have code it shoudl work but its giving error while appending buffer. This is how both type of images has been saved. -(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)img editingInfo:(NSDictionary *)editInfo { // NSLog(@"Came From Here"); imgv.image = img; AppDelegate *app = (AppDelegate *)[[UIApplication sharedApplication] delegate]; app.imgmain = img; [self dismissModalViewControllerAnimated

Hold multiple Frames in Memory before sending them to AVAssetWriter

好久不见. 提交于 2019-12-09 06:22:27
问题 I need to hold some video frames from a captureSession in memory and write them to a file when 'something' happens. Similar to this solution, i use this code to put a frame into a NSMutableArray: - (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection*)connection { //... CVImageBufferRef imageBuffer = CMSampleBufferGetImageBuffer(sampleBuffer); uint8 *baseAddress = (uint8*)CVPixelBufferGetBaseAddress