视频方向UIImagePickerController [英] video orientation UIImagePickerController

查看:97
本文介绍了视频方向UIImagePickerController的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用UIImagePickerController选择视频,然后使用ASIHTTPRequest将视频上传到Web服务器。但是,使用iPhone拍摄的视频在横向或纵向中颠倒倒置在Web服务器上。当这些上传的视频在iPhone上观看时,它们也会在75%左右垂直缩放,以便它们看起来被压扁。

I am choosing videos using UIImagePickerController, then uploading the video to a web server using ASIHTTPRequest. However, videos that were shot with the iPhone held upside-down in landscape or portrait are inverted on the web server. When those uploaded videos are viewed on an iPhone, they are also scaled thy 75% or so vertically so that they appear squished.

有没有办法确定视频方向使用UIImagePickerController选择的视频(包括它是否被颠倒)?

Is there a way to determine the video orientation (including whether it was shot upside-down) of a video chosen using UIImagePickerController?

另外,有没有办法在上传之前更改视频的方向?

Also, is there a way to change the orientation of the video before uploading?

我也是喜欢不允许上传以纵向拍摄的视频。

I'd also like to not allow uploads of video shot in portrait orientation.

谢谢

推荐答案

在另一篇文章中找到答案。 AVAsset为您提供了两个属性,[avAsset naturalSize]和[avAsset preferredTransform],可让您确定视频方向。

Found the answer in anther post. AVAsset gives you two properties, [avAsset naturalSize] and [avAsset preferredTransform], that allow you to determine the video orientation.

以下是相关帖子:

如果以纵向或横向录制视频文件,如何检测(iPhone SDK)。

这篇关于视频方向UIImagePickerController的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆