gpt4 book ai didi

cocoa - 嵌套 AVMutableComposition

转载 作者:行者123 更新时间:2023-12-03 16:04:11 26 4
gpt4 key购买 nike

我正在尝试在嵌套层次结构中使用 AVMutableComposition。因此我必须将一个作品放入另一个作品中。这样做会导致以下错误消息:

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

我使用了以下代码片段。

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]);
}

是否可以嵌套组合?

最佳答案

无法嵌套 AVMutableComposition 资源。

关于cocoa - 嵌套 AVMutableComposition,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10350813/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com