You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to export the recorded video and then create an AVAsset from the exportSession.outputUrl so that i can use this asset for mixing other audios to the video as per the requirement of my app.
But i am not able to create an AVAsset from the exportSession.outputUrl .
If I save it to camera roll , then i am able to create an AVAsset. But without saving to camera roll, just after the completion of exporting, if i try to create an AVAsset from the exportSession.outputUrl, then it says the duration of the asset is zero seconds(when i print the duration of asset).
I am trying to export the recorded video and then create an AVAsset from the exportSession.outputUrl so that i can use this asset for mixing other audios to the video as per the requirement of my app.
But i am not able to create an AVAsset from the exportSession.outputUrl .
If I save it to camera roll , then i am able to create an AVAsset. But without saving to camera roll, just after the completion of exporting, if i try to create an AVAsset from the exportSession.outputUrl, then it says the duration of the asset is zero seconds(when i print the duration of asset).
Please help me out.
Thanks.
code is as below,
(void)saveToCameraRoll {
self.navigationItem.rightBarButtonItem.enabled = NO;
SCFilter *currentFilter = [self.filterSwitcherView.selectedFilter copy];
[_player pause];
SCAssetExportSession *exportSession = [[SCAssetExportSession alloc] initWithAsset:self.recordSession.assetRepresentingSegments];
exportSession.videoConfiguration.filter = currentFilter;
exportSession.videoConfiguration.preset = SCPresetHighestQuality;
exportSession.audioConfiguration.preset = SCPresetHighestQuality;
exportSession.videoConfiguration.maxFrameRate = 35;
exportSession.outputUrl = self.recordSession.outputUrl;
exportSession.outputFileType = AVFileTypeQuickTimeMovie;//AVFileTypeMPEG4;
exportSession.delegate = self;
exportSession.contextType = SCContextTypeAuto;
self.exportSession = exportSession;
self.exportView.hidden = NO;
self.exportView.alpha = 0;
CGRect frame = self.progressView.frame;
frame.size.width = 0;
self.progressView.frame = frame;
[UIView animateWithDuration:0.3 animations:^{
self.exportView.alpha = 1;
}];
//SCWatermarkOverlayView *overlay = [SCWatermarkOverlayView new];
//overlay.date = self.recordSession.date;
//exportSession.videoConfiguration.overlay = overlay;
//exportSession.videoConfiguration.watermarkFrame = CGRectMake([UIScreen mainScreen].bounds.size.width-210, [UIScreen mainScreen].bounds.size.height-210, 200, 200);
//exportSession.videoConfiguration.watermarkFrame = CGRectMake(0, 0, 200, 200);
//exportSession.videoConfiguration.watermarkImage = [UIImage imageNamed:@"watermark"];
NSLog(@"Starting exporting");
CFTimeInterval time = CACurrentMediaTime();
__weak typeof(self) wSelf = self;
[exportSession exportAsynchronouslyWithCompletionHandler:^{
__strong typeof(self) strongSelf = wSelf;
}];
}
The text was updated successfully, but these errors were encountered: