avassetwriter

Video Encoding using AVAssetWriter - CRASHES

霸气de小男生 提交于 2019-11-27 18:24:00
I have a function that is supposed to re-encode a video to a manageable bitrate on iphone/ipad. Here it is: * UPDATED WORKING CODE, NOW WITH AUDIO! :) * -(void)resizeVideo:(NSString*)pathy{ NSString *newName = [pathy stringByAppendingString:@".down.mov"]; NSURL *fullPath = [NSURL fileURLWithPath:newName]; NSURL *path = [NSURL fileURLWithPath:pathy]; NSLog(@"Write Started"); NSError *error = nil; AVAssetWriter *videoWriter = [[AVAssetWriter alloc] initWithURL:fullPath fileType:AVFileTypeQuickTimeMovie error:&error]; NSParameterAssert(videoWriter); AVAsset *avAsset = [[[AVURLAsset alloc]

How to trim the video file and convert to 15 seconds video with iOS SDK?

那年仲夏 提交于 2019-11-27 15:13:34
问题 I want to trim a video file. I want to just pick the video from a gallery and convert it to a 15-second video. If I use normal trimming with picker view controller, it does not specify a time and just shows the frames, but I need to be fixed for 15 seconds. How can I achieve this? 回答1: Objective-C -(void)cropVideo:(NSURL*)videoToTrimURL{ AVURLAsset *asset = [AVURLAsset URLAssetWithURL:videoToTrimURL options:nil]; AVAssetExportSession *exportSession = [[AVAssetExportSession alloc]

Screen capture video in iOS programmatically

雨燕双飞 提交于 2019-11-27 11:23:00
问题 I'm trying to create a UIView that allows a user to tap a button in i and record the screen (not make a video from the camera), then save it to the document folder. I've seen a couple of SO articles here that talk about AVAssetWriter and make references to this link: http://codethink.no-ip.org/wordpress/archives/673 , but that link appears to be dead. But no one has actually shown a solution or provided any examples on how to accomplish. Anyone have any ideas or can point me in the right

This code to write video+audio through AVAssetWriter and AVAssetWriterInputs is not working. Why?

痞子三分冷 提交于 2019-11-27 09:04:07
问题 I've been trying to write a video+audio using AVAssetWriter and AVAssetWriterInputs. I read multiple posts in this forum of people saying they were able to accomplish that, but it is not working for me. If I just write video then the code is doing its job very well. When I add audio the output file is corrupted and cannot be reproduced. Here is part of my code: Setting up AVCaptureVideoDataOutput and AVCaptureAudioDataOutput: NSError *error = nil; // Setup the video input AVCaptureDevice

AVAssetWriter AVVideoExpectedSourceFrameRateKey (frame rate) ignored

可紊 提交于 2019-11-27 07:18:42
问题 Me and my team are trying to re-encode a video file to a more "gify" feeling by changing the video frame rate. We are using the following properties for the AVAssetWriterInput : let videoSettings:[String:Any] = [ AVVideoCodecKey: AVVideoCodecH264, AVVideoHeightKey: videoTrack.naturalSize.height, AVVideoWidthKey: videoTrack.naturalSize.width, AVVideoCompressionPropertiesKey: [AVVideoExpectedSourceFrameRateKey: NSNumber(value: 12)] ] But the output video keep playing in the normal frame rate

AVFoundation + AssetWriter: Generate Movie With Images and Audio

為{幸葍}努か 提交于 2019-11-27 06:02:19
I have to export a movie from my iPhone application which contains UIImage from an NSArray and add some audio files in .caf format that have to start at pre-specified times. Now I have been able to use the AVAssetWriter (after going through many questions and answers on this and other sites) to export the video portion containing the images but cant seem to find a way to add the audio files to complete the movie. Here is what I have gotten so far -(void) writeImagesToMovieAtPath:(NSString *) path withSize:(CGSize) size { NSLog(@"Write Started"); NSError *error = nil; AVAssetWriter *videoWriter

OpenGL ES 2.0 to Video on iPad/iPhone

你离开我真会死。 提交于 2019-11-26 19:38:48
问题 I am at my wits end here despite the good information here on StackOverflow... I am trying to write an OpenGL renderbuffer to a video on the iPad 2 (using iOS 4.3). This is more exactly what I am attempting: A) set up an AVAssetWriterInputPixelBufferAdaptor create an AVAssetWriter that points to a video file set up an AVAssetWriterInput with appropriate settings set up an AVAssetWriterInputPixelBufferAdaptor to add data to the video file B) write data to a video file using that

AVFoundation + AssetWriter: Generate Movie With Images and Audio

孤街浪徒 提交于 2019-11-26 11:49:53
问题 I have to export a movie from my iPhone application which contains UIImage from an NSArray and add some audio files in .caf format that have to start at pre-specified times. Now I have been able to use the AVAssetWriter (after going through many questions and answers on this and other sites) to export the video portion containing the images but cant seem to find a way to add the audio files to complete the movie. Here is what I have gotten so far -(void) writeImagesToMovieAtPath:(NSString *)