#import "ViewController.h" #import "AVFoundation/AVAssetWriter.h" #import "AVFoundation/AVAssetWriterInput.h" #import "AVFoundation/AVMediaFormat.h" #import "AVFoundation/AVVideoSettings.h" @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; NSArray *documentDirectories = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentDirectory = [documentDirectories objectAtIndex: 0];
I'm new to iOS and I saw code displaying video from images in a stack overflow. I run the code and it did not show any errors, but I did not get the required output. I think the error is the last line of this function
-(void)writeImageAsMovie:(UIImage*)image toPath:(NSString*)path size:(CGSize)size duration:(int)duration) that is [videoWriter finishWriting]
Please help me.
source share