在我的應用我記錄和保存使用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