Frage

I'm trying to use AVMutableComposition in a nested hierarchy. Therefor I have to put a composition into an other composition. Doing so results into the following error message:

AVCompositionTest[45347:10703] comp2 >>> The operation could not be completed

I used the following code snipped.

AVAsset *audioAsset = [AVAsset assetWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"02 Undefined" ofType:@"mp3"]]];

AVMutableComposition *comp1 = [AVMutableComposition composition];

BOOL success = YES;
NSError *error = nil;

success = [comp1 insertTimeRange:CMTimeRangeMake(kCMTimeZero, audioAsset.duration)
                         ofAsset:audioAsset
                          atTime:kCMTimeZero
                           error:&error];

if (!success) {
    NSLog(@"comp1 >>> %@", [error localizedDescription]);
}

AVMutableComposition *comp2 = [AVMutableComposition composition];

success = [comp2 insertTimeRange:CMTimeRangeMake(kCMTimeZero, audioAsset.duration)
                         ofAsset:comp1
                          atTime:kCMTimeZero
                           error:&error];

if (!success) {
    NSLog(@"comp2 >>> %@", [error localizedDescription]);
}

Is it possible to nest compositions?

War es hilfreich?

Lösung

It is not possible to nest AVMutableComposition assets.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top