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

查看:36
本文介绍了使用 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 -vf "transpose=1" -i input.mov output.mp4

...或...

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

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

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