Posts

Post marked as solved
7 Replies
Just Now. I donwload the AVCompositionDebugVieweriOS sample code form https://developer.apple.com/library/archive , and modify the sample code , export the demo's compositon videoComposition audioMix , after export to loacl file, also has no transitions animation. iOS13 beat5.
Post marked as solved
7 Replies
Today I continue check the question. find zhat only call[transformLayerInstruction setTransform:startTransform atTime:kCMTimeZero];after export also has no transform effect.More simple code.- (void)testTransformEffectExport { NSString *moviePath = [[NSBundle mainBundle] pathForResource:@"111" ofType:@"MP4"]; AVAsset *asset = [AVURLAsset assetWithURL:[NSURL fileURLWithPath:moviePath]]; AVAssetTrack *origAssetTrack = [asset tracksWithMediaType:AVMediaTypeVideo].firstObject; AVMutableComposition *composition = [AVMutableComposition composition]; composition.naturalSize = CGSizeMake(KVideoPixelsWidth, kVideoPixelsHeight); AVMutableVideoComposition *videoComposition = [AVMutableVideoComposition videoComposition]; videoComposition.frameDuration = CMTimeMake(1, 30); videoComposition.renderSize = CGSizeMake(KVideoPixelsWidth, kVideoPixelsHeight);; ////////////////////////// AVMutableVideoCompositionInstruction *transformInstruction = [AVMutableVideoCompositionInstruction videoCompositionInstruction]; transformInstruction.timeRange = origAssetTrack.timeRange; AVMutableVideoCompositionLayerInstruction *transformLayerInstruction = [AVMutableVideoCompositionLayerInstruction videoCompositionLayerInstructionWithAssetTrack:origAssetTrack]; CGAffineTransform startTransform = CGAffineTransformIdentity; startTransform = CGAffineTransformTranslate(startTransform, 100, 200); [transformLayerInstruction setTransform:startTransform atTime:kCMTimeZero]; transformInstruction.layerInstructions = [NSArray arrayWithObject:transformLayerInstruction]; videoComposition.instructions = @[transformInstruction]; NSString *outputPath = [NSTemporaryDirectory() stringByAppendingPathComponent:@"828.mp4"]; AVAssetExportSession *exportSession = [[AVAssetExportSession alloc] initWithAsset:asset presetName:AVAssetExportPreset1280x720]; exportSession.outputURL = [NSURL fileURLWithPath:outputPath]; exportSession.outputFileType = AVFileTypeQuickTimeMovie; exportSession.videoComposition = videoComposition; [exportSession exportAsynchronouslyWithCompletionHandler:^{ dispatch_async(dispatch_get_main_queue(), ^{ AVAsset *outputAsset = [AVURLAsset assetWithURL:[NSURL fileURLWithPath:outputPath]]; combineResultTestViewController *vc = [[combineResultTestViewController alloc] initWithAsset:outputAsset]; [self.navigationController pushViewController:vc animated:YES]; }); }]; }
Post not yet marked as solved
3 Replies
eskimo : thanks reply ! Now, I want know how to avoid this mediaserverd crash, I could not find the same situation in developer forums. bug url : https://feedbackassistant.apple.com/feedback/6201450