Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nested AVMutableComposition

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?

like image 860
Tobias Kräntzer Avatar asked Apr 27 '12 12:04

Tobias Kräntzer


1 Answers

It is not possible to nest AVMutableComposition assets.

like image 169
Tobias Kräntzer Avatar answered Oct 18 '22 18:10

Tobias Kräntzer