使用ffmpeg转换为.mp4时,从iphone捕获的视频会旋转 [英] video captured from iphone gets rotated when converted to .mp4 using ffmpeg

查看:404
本文介绍了使用ffmpeg转换为.mp4时,从iphone捕获的视频会旋转的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试在我的应用程序中上传从iPhone捕获的视频时,服务器执行从.mov到.mp4的转换,以便可以在其他平台上播放。但是问题是当我拍摄视频(以纵向方向)并且被转换(使用ffmpeg),然后从服务器播放时,它似乎被旋转。任何想法?

When I try to upload videos captured from my iPhone in my app, the server performs a conversion from .mov to .mp4 so that it can be played in other platforms. However the problem is that when I shoot the video (in portrait orientation) and it is converted (using ffmpeg) and then played back from the server, it appears to be rotated. Any idea?

推荐答案

根据您有哪些版本的ffmpeg及其编译方式,以下其中一个应该可以正常工作?

Depending on which version of ffmpeg you have and how it's compiled, one of the following should work...

ffmpeg -vfilters "rotate=90" -i input.mov output.mp4

...或...

ffmpeg -vf "transpose=1" -i input.mov output.mp4

这篇关于使用ffmpeg转换为.mp4时,从iphone捕获的视频会旋转的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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