avassetwriter

AVAssetWriter How to create mov video with no compression?

ぃ、小莉子 提交于 2019-12-18 04:23:33
问题 I'am creating a video from an array of images. The purpose of my work is to create a .mov video with no compression. I have see in developer library that it exist a key "AVVideoCompressionPropertiesKey" but I don't know how to specify no compression with this key. Could you help me please? Here is my sample code : NSDictionary *videoCleanApertureSettings = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:320], AVVideoCleanApertureWidthKey, [NSNumber numberWithInt:480],

Video Encoding using AVAssetWriter - CRASHES

孤者浪人 提交于 2019-12-17 15:29:04
问题 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

Make movie file with picture Array and song file, using AVAsset

依然范特西╮ 提交于 2019-12-17 02:25:30
问题 I'm trying to make movie file using a picture array and an audio file. To make movie with a picture array i used the big post by zoul here. All is perfect, I have my movie with my picture. However when I try to add some audio tracks I have lot of problems. To understand I put my code : When I call this method, picture array and song file are ready : -(void) writeImagesToMovieAtPath:(NSString *) path withSize:(CGSize) size { NSString *documentsDirectoryPath =

Record video with AVAssetWriter

让人想犯罪 __ 提交于 2019-12-13 12:42:15
问题 I'm trying to record video with AVAssetwriter but I keep getting NO when checking AVAssetWriterInput property readyForMoreMediaData before appending data. I saw related posts that mentioned similar problem when trying to record audio + video so I took out the audio recording part but the problem still occurs ( readyForMoreMediaData is always NO). My code: - (void)startRecordingWithAssetWriter { NSLog(@"Setting up capture session"); captureSession = [[AVCaptureSession alloc] init]; //----- ADD

Black Video outputted via AVMutableVideoComposition and CAAnimation

∥☆過路亽.° 提交于 2019-12-13 03:45:45
问题 I am building iOS application that is able to record video and add animation overlay over recorded video with AVFoundation and CAAnimation . All sub features are working fine but end of video's background is black while animation is playing. It's not rendering background video that I selected. I've used AVAssetWriter to record video and it's well played on camera roll. But if I use this recorded video to add overlay, end of video's background is black. Interesting thing is if I record video

ios - AVAssetWriter Writes Video but does not record AUDIO

左心房为你撑大大i 提交于 2019-12-13 03:45:03
问题 I have been successfull in making viedo (though Blur) but have been Unsuccessful in recording audio Please Help. I am using the following code Pls go through it ans suggest some solution or a working tutorial. I am Appending the Sample Buffer using [encoder._writerInput appendSampleBuffer:sampleBuffer]; And The App Crashes When the following statement is called [encoder.audioWriterInput appendSampleBuffer:sampleBuffer]; - (void) initPath:(NSString*)path Height:(int) height andWidth:(int)

How to choose the a pixel format type (kCVPixelBufferPixelFormatTypeKey) for use with AVAssetReader?

社会主义新天地 提交于 2019-12-12 10:39:51
问题 We are using AVAssetReader and AVAssetWriter somewhat in the style as noted in Video Encoding using AVAssetWriter - CRASHES basically to read a video what we got from the photo gallery / asset library then writing it at a different bit rate to reduce its size (for eventual network upload). The trick to getting this to work for us was to specify a kCVPixelBufferPixelFormatTypeKey key and value in the outputSettings on AVAssetReaderTrackOutput , something like this: NSDictionary *outputSettings

How to encode video with transparent background

爷,独闯天下 提交于 2019-12-12 09:52:35
问题 I am encoding a video using cocoa for OSX (with AVAssetWriter) in h264. This is the configuration: // Configure video writer AVAssetWriter *m_videoWriter = [[AVAssetWriter alloc] initWithURL:[NSURL fileURLWithPath:@(outputFile)] fileType:AVFileTypeMPEG4 error:NULL]; // configure video input NSDictionary *videoSettings = @{ AVVideoCodecKey : AVVideoCodecH264, AVVideoWidthKey : @(m_width), AVVideoHeightKey : @(m_height) }; AVAssetWriterInput* m_writerInput = [[AVAssetWriterInput alloc]

AVAssetWriter record settings not working like AVAudioRecorder

蹲街弑〆低调 提交于 2019-12-11 18:00:47
问题 I have successfully used these recording settings to create audio formatted into the needed format. However these settings only seemed to work with AVAudioRecorder. When I try them with AVAssetWriter I get an error stating that the AVLinearPCMBitDepthKey needs AVLinearPCMBitFloatKey but when I add that it says its not allowed for 'ulaw'. My question is why does AVLinearPCMBitDepthKey work fine in one recorder but not the other? [recordSettings setObject:[NSNumber numberWithInt:

AVAssetWriter rotate buffer for video orientation

北慕城南 提交于 2019-12-11 15:40:40
问题 I'm working on a live recording app in Swift using AVFoundation and I have an issue with the video orientation. I use AVAssetWriter and not AVCaptureMovieFileOutput because I need to record in square format (correct me if I'm wrong). I tried to use videoInput.transform but I heard that it is not supported in all video player. I can't use avcaptureconnection.videoOrientation based on the device orientation because there is some "Main UI thread stop". I read that the best solution is to rotate