AVFoundation + AssetWriter: Generate Movie With Images and Audio

I ended up exporting the video separately using the above code and added the audio files separately using AVComposition & AVExportSession. Here is the code -(void) addAudioToFileAtPath:(NSString *) filePath toPath:(NSString *)outFilePath { NSError * error = nil; AVMutableComposition * composition = [AVMutableComposition composition]; AVURLAsset * videoAsset = [AVURLAsset URLAssetWithURL:[NSURL fileURLWithPath:filePath] options:nil]; AVAssetTrack * videoAssetTrack = … Read more

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

I finally found how make movie with a picture array and an audio file. So if you want do the same thing I put my code here (be careful to memory): First make a movie file with your picture array use zoul’s post here: -(void) writeImagesToMovieAtPath:(NSString *) path withSize:(CGSize) size { NSString *documentsDirectoryPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, … Read more

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

In startVideoRecording I call (I assume you are calling this at some point) [_capSession startRunning] ; In stopVideoRecording I do not call [_videoWriterInput markAsFinished]; [_videoWriter endSessionAtSourceTime:lastSampleTime]; The markAsFinished is more for use with the block style pull method. See requestMediaDataWhenReadyOnQueue:usingBlock in AVAssetWriterInput for an explanation. The library should calculate the proper timing for interleaving the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)