I know how to use AVAssetReader
and AVAssetWriter
, and have successfully used them to grab a video track from one movie and transcode it into another.
Have you tried using two AVAssetWriterInputs and pushing the samples through a worker queue? Here is a rough sketch.
processing_queue = dispatch_queue_create("com.mydomain.gcdqueue.mediaprocessor", NULL);
[videoAVAssetWriterInput requestMediaDataWhenReadyOnQueue:myInputSerialQueue usingBlock:^{
dispatch_asyc(processing_queue, ^{process video});
}];
[audioAVAssetWriterInput requestMediaDataWhenReadyOnQueue:myInputSerialQueue usingBlock:^{
dispatch_asyc(processing_queue, ^{process audio});
}];