如何更改视频方向
我目前有一个iPhone应用程序,可以让用户拍摄视频并将其上传到服务器,并允许其他人从该应用程序观看他们的视频.在我创建一个网站来查看不同的视频之前,视频的方向从来没有问题(以及其他内容).
I currently have an iPhone app that lets the users take video, upload it to the server, and allows others to view their video from the app. Never had an issue with the video's orientation until I went to make a web site to view the different videos (along with other content).
我使用来自Web服务的视频,并使用videojs将它们加载到ajax中,但是每个视频都向左旋转90度.从我所阅读的内容来看,听起来好像可以在iOS中读取方位信息,但不能在网站上读取.在发送到服务器之前,是否可以通过其他方式在iPhone上保存视频的新方向?
I consume the video's from the web service, and load them with ajax using videojs, but every single one of them is rotated left 90 degrees. From what I've read, it sounds like orientation information is able to be read in iOS, but not on a website. Is there any way to save a new orientation for the video on the iphone, before sending to the server?
似乎出现此问题是因为videojs无法读取方向.此处的信息: http://help.videojs.com/discussions/problems/1508-video-orientation-for-iphone-错误
It appears that this issue occurs because videojs has trouble reading the orientation. information here: http://help.videojs.com/discussions/problems/1508-video-orientation-for-iphone-wrong
基于隐式解决方案,您应该检查以确保在保存视频时使用AVFramework设置方向值.有关如何执行此操作的信息,请参见前面的堆栈溢出文章:
Based on the implied solution you should be checking to make sure when you save the video you are using AVFramework to set the orientation value. Information on how to do that is available in this previous stack overflow post: How do I set the orientation for a frame-by-frame-generated video using AVFoundation?