首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >录制的视频方向问题

录制的视频方向问题
EN

Stack Overflow用户
提问于 2013-07-17 15:49:15
回答 2查看 259关注 0票数 3

在我的应用程序中,我使用AVCapture/AssetsLibrary.录制和保存视频。当我在纵向录制时,录制的视频的方向是可以的,但当我在横向录制时,录制的视频的方向是90度,这是不好的。我需要这个问题的帮助。我的代码是..

在我的appDelegate.m中

代码语言:javascript
复制
- (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中

代码语言:javascript
复制
- (NSUInteger)supportedInterfaceOrientations{

    return UIInterfaceOrientationMaskPortrait;
}

捕获会话方向

代码语言:javascript
复制
AVCaptureConnection *CaptureConnection = [MovieFileOutput connectionWithMediaType:AVMediaTypeVideo];
if ([CaptureConnection isVideoOrientationSupported])
{
    AVCaptureVideoOrientation orientation = AVCaptureVideoOrientationPortrait;

    [CaptureConnection setVideoOrientation:orientation];
}

谢谢,

EN

回答 2

Stack Overflow用户

发布于 2014-04-22 15:07:04

设置CaptureVideoOrientation.i.e:

代码语言:javascript
复制
AVCaptureVideoOrientation orientation =AVCaptureVideoOrientationLandscapeRight
票数 0
EN

Stack Overflow用户

发布于 2015-11-17 19:13:06

移动记录设备将旋转元数据与.mp4或.mov视频一起保存。

它可以有4个值: 0、90、180和270:

图片由Rotation Metadata in Video Files Created by Mobile Devices提供

如果您使用的播放器支持旋转元数据,您将看到纵向视频(90°)显示为纵向。如果不是这样,你就会把它看作风景。

不支持它的播放器(上面的列表形式链接):

  • Firefox 42
  • Opera on Mac
  • 媒体播放器经典
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/17694113

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档