AVFoundation
과 같이 오디오 만 사용하여 (즉, 비디오가 없음) 여러 개의 AVComposition
을 하나씩 결합하여 하나의 단일 AVComposition
으로 끝내려고합니다.AVMpositionComposition에 AVComposition의 insertTimeRange를 시도 할 때 오류 -11800
예제 예의 경우 : 단지 두 개의 AVComposition
입니다. 그들 각각은, 따라서 AVPlayer를을 작성하여 고급 재생 : comp
이 AVMutableComposition
의 인스턴스
_player = [AVPlayer playerWithPlayerItem:[AVPlayerItem playerItemWithAsset:comp]]
. (덧붙여, 그것은 _player
그것을 재생하기 전에, 그렇지 않으면 ARC가 조기을 출시 바르되어야한다는 지적 가치 -. 아래 하나를 추적하는 동안했다) 좋은
-comp
에서
[_player play]
결과를 실행 성공적으로 재생되고 있습니다. 그러나
, 이것은 실패
가코드가 실행될 때,이 때 오류를 얻을 self.segments
의 요소마다
AVMutableComposition *comp = [AVMutableComposition composition];
NSError *err;
for (AVMutableComposition* c in self.segments) {
[comp insertTimeRange:CMTimeRangeMake(kCMTimeZero, segment.duration)
ofAsset:segment atTime:comp.duration error:&err];
DLog(@"Error was %@", segment, err);
}
(self.segments
가 AVMutableComposition
의 커스텀 서브 클래스이다 NSMutableArray
함유 원소) insertTimeRange::::
메소드 호출 :
Error was Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not
be completed" UserInfo=0x14e8e7f0 {NSLocalizedDescription=The operation could not be
completed, NSUnderlyingError=0x14d7f580 "The operation couldn’t be completed. (OSStatus
error -12780.)", NSLocalizedFailureReason=An unknown error occurred (-12780)}
inf를 찾을 수 없습니다. 이 오류가 나타내는 것에 대한 오마쥬 - 그냥 잡아 먹는 것처럼 보입니다. 그리고 내가 뭘 잘못하고 있는지 알 수 없습니다. 어떤 아이디어?
나는 for 루프와 objectAtIndex를 사용하려고 시도했다 : self.segments NSMutableArray를 통해 빠른 열거 대신에 시도해 본 것은 다르지 않다. –
혹시 알아 냈습니까? 나는 비슷한 문제를 겪고있다. 그러나 비디오와 함께, 오디오 오류 숫자는 AVFoundationErrorDomain Code = -11801'과'(OSStatus 오류 -12786) 약간 다르다. ') – Hugo
대신 fileURLWithPath를 사용해 보라. 의 : urlwithstring – Nik