在我的应用我记录和保存使用AVCapture/AssetsLibrary.When我记录在纵向记录的视频的方向是确定的视频,但是当我在风景拍摄录制的视频的定位是90度这是不好,我需要帮助解决这个问题。 我的代码..录制的视频定位问题
在我appDelegate.m
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window{
NSUInteger orientations = UIInterfaceOrientationMaskAllButUpsideDown;
if(self.window.rootViewController){
UIViewController *presentedViewController = [[(UINavigationController *)self.window.rootViewController viewControllers] lastObject];
orientations = [presentedViewController supportedInterfaceOrientations];
}
return orientations;
}
和myViewController.m
- (NSUInteger)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskPortrait;
}
捕获会话方向
AVCaptureConnection *CaptureConnection = [MovieFileOutput connectionWithMediaType:AVMediaTypeVideo];
if ([CaptureConnection isVideoOrientationSupported])
{
AVCaptureVideoOrientation orientation = AVCaptureVideoOrientationPortrait;
[CaptureConnection setVideoOrientation:orientation];
}
感谢,
你是如何配置的方向捕获会话? – Wain
@请看我编辑的代码! – Machete