ユーザーが入力または選択した特定の開始点から特定の終了点まで、録画したビデオをトリミングする必要があるタスクに取り組んでいます。どうすればいいですか。以前使用UIVideoEditorController
していたように、デフォルトのビューを使用したくなく、ビデオを直接トリミングしたい。
let FinalUrlTosave = NSURL(string: "\(newURL)")
exportSession!.outputURL=FinalUrlTosave
exportSession!.shouldOptimizeForNetworkUse = true
// exportSession.outputFileType = AVFileTypeQuickTimeMovie
exportSession!.outputFileType = AVFileTypeQuickTimeMovie;
let start:CMTime
let duration:CMTime
var st = starttime.doubleValue
var ed = endTime.doubleValue
start = CMTimeMakeWithSeconds(st, 600)
duration = CMTimeMakeWithSeconds(ed, 600)
// let timeRangeForCurrentSlice = CMTimeRangeMake(start, duration)
let range = CMTimeRangeMake(start, duration);
exportSession!.timeRange = range
exportSession!.exportAsynchronouslyWithCompletionHandler({
switch exportSession!.status{
case AVAssetExportSessionStatus.Failed:
print("failed \(exportSession!.error)")
case AVAssetExportSessionStatus.Cancelled:
print("cancelled \(exportSession!.error)")
default:
print("complete....complete")
// self.SaveVideoToPhotoLibrary(destinationURL1!)
}
})
これを使用して目標を達成しようとしていますが、成功していません。
エラーメッセージ:
失敗しました Optional(Error Domain=NSURLErrorDomain Code=-1100 "要求された URL がこのサーバーで見つかりませんでした。" UserInfo={NSErrorFailingURLStringKey=file:///var/mobile/Containers/Data/Application/E68D3BFD-6923-4EA6-9FB3 -C020CE4AA9D4/Documents/moment/jGq_9AUFa47s2ZiiPP4x.mp4、NSErrorFailingURLKey=file:///var/mobile/Containers/Data/Application/E68D3BFD-6923-4EA6-9FB3-C020CE4AA9D4/Documents/moment/jGq_9AUFa47s2ZiiPP4x.mp4、要求された NSDe Localizedこのサーバーで URL が見つかりませんでした。, NSUnderlyingError=0x1553c220 {エラー ドメイン = N
2 回目に発生したエラー:
失敗したオプション(エラー ドメイン=NSURLErrorDomain コード=-3000 "ファイルを作成できません" UserInfo={NSUnderlyingError=0x14e00000 {エラー ドメイン=NSOSStatusErrorDomain コード=-12124 "(null)"}、NSLocalizedDescription=ファイルを作成できません})