我一直试图找出如何使用FFmpeg旋转视频.我正在处理以纵向模式拍摄的iPhone视频.我知道如何使用MediaInfo(优秀的库,顺便说一句)确定当前的旋转度,但我现在卡在FFmpeg上.
根据我的阅读,您需要使用的是vfilter选项.根据我的看法,它应该是这样的:
ffmpeg -vfilters "rotate=90" -i input.mp4 output.mp4
Run Code Online (Sandbox Code Playgroud)
但是,我不能让这个工作.首先,-vfilters不再存在,它现在只是-vf.其次,我收到此错误:
No such filter: 'rotate'
Error opening filters!
Run Code Online (Sandbox Code Playgroud)
据我所知,我有一个FFmpeg的全选版本.运行ffmpeg -filters显示:
Filters:
anull Pass the source unchanged to the output.
aspect Set the frame aspect ratio.
crop Crop the input video to x:y:width:height.
fifo Buffer input images and send them when they are requested.
format Convert the input video to one of the specified pixel formats.
hflip Horizontally flip the input video.
noformat …
Run Code Online (Sandbox Code Playgroud) 当我ffmpeg
在Ubuntu上运行时,它显示:
$ ffmpeg
ffmpeg version v0.8, Copyright (c) 2000-2011 the Libav developers
built on Feb 28 2012 13:27:36 with gcc 4.6.1
This program is not developed anymore and is only provided for compatibility. Use avconv instead (see Changelog for the list of incompatible changes).
Run Code Online (Sandbox Code Playgroud)
或者它显示(取决于Ubuntu版本):
$ ffmpeg
ffmpeg version 0.8.5-6:0.8.5-0ubuntu0.12.10.1, Copyright (c) 2000-2012 the Libav developers
built on Jan 24 2013 14:49:20 with gcc 4.7.2
*** THIS PROGRAM IS DEPRECATED ***
This program is only provided for compatibility …
Run Code Online (Sandbox Code Playgroud) 我有一个视频文件.我用MediaInfo实用程序打开它,我可以看到该文件中的视频流具有属性Rotation 90(以及其他属性,如CodecID,bitrate等).
现在我有另一个没有该属性Rotation 90的视频文件,它根本没有Rotation属性.
我可以使用ffmpeg.exe,以便生成添加了Rotation 90属性且没有其他更改的输出文件吗?我真的不想做任何变换,只想设置Rotation属性.
我试过这个-metadata
选项无济于事.