美文网首页FFmpeg与音视频流媒体工程开发相关
[FFmpeg Cmd]旋转,视频整体旋转,非rotate这种底

[FFmpeg Cmd]旋转,视频整体旋转,非rotate这种底

作者: _小老虎_ | 来源:发表于2022-12-06 16:52 被阅读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.

    相关文章

      网友评论

        本文标题:[FFmpeg Cmd]旋转,视频整体旋转,非rotate这种底

        本文链接:https://www.haomeiwen.com/subject/ukxnxdtx.html