views:

189

answers:

1

Been trying to figure this out with zero success.

I can write video output no problem ... but once I try to introduce a second AVAssetWriterInput to include audio the final quicktime movie is jumpy with frames being loss left and right and audio constantly going in and out.

Thanks - wg

+1  A: 

If you include source we might be able to help you more, but this is a method with which I have had success in writing many audio and video tracks to a quicktime movie – I use a single AVMutableComposition with AVMutableVideoComposition and AVAudioMix. I then write it like so:

AVAssetExportSession *session = [[[AVAssetExportSession alloc] initWithAsset:[project.composition copy] presetName:presetName] retain];
    session.outputFileType = [session.supportedFileTypes objectAtIndex:0];
    session.outputURL = [NSURL fileURLWithPath:[VeporterAppDelegate createMoviePath]];
    session.videoComposition = project.videoComposition;
    session.audioMix = project.audioMix;

    session.metadata = project.metadata;

    [session exportAsynchronouslyWithCompletionHandler:^{}];
Peter DeWeese