FFmpeg与音视频流媒体工程开发相关

[FFMpeg]旋转,transpose旋转,整体视频旋转

2020-09-23  本文已影响0人  _小老虎_

https://stackoverflow.com/questions/3937387/rotating-videos-with-ffmpeg

Rotate 90 clockwise:

ffmpeg -i in.mov -vf "transpose=1" out.mov

For the transpose parameter you can pass:

0 = 90CounterCLockwise and Vertical Flip (default)
1 = 90Clockwise
2 = 90CounterClockwise
3 = 90Clockwise and Vertical Flip

Use -vf "transpose=2,transpose=2" for 180 degrees.

Make sure you use a recent ffmpeg version from here (a static build will work fine).

Note that this will re-encode the audio and video parts. You can usually copy the audio without touching it, by using -c:a copy. To change the video quality, set the bitrate (for example with -b:v 1M) or have a look at the H.264 encoding guide if you want VBR options.

A solution is also to use this convenience script.

上一篇 下一篇

猜你喜欢

热点阅读