LoginSignup
93
60

More than 3 years have passed since last update.

【ffmpeg】動画の解像度を指定してリサイズ、アスペクト比を維持したまま解像度を変更する、回転する

Last updated at Posted at 2019-09-06

概要

  • ffmpegで動画のアスペクト比を維持したまま縮小(拡大)する方法
  • ffmpegで動画の解像度を指定しリサイズ(サイズを変更)する方法

アスペクト比を維持したままリサイズ

自動で設定したいほうに -1 をセットする


動画の横幅(width)を 1280 にする。高さ(height)はアスペクト比を維持して自動で設定する

ffmpeg -i in.mp4 -vf scale=1280:-1 out.mp4


動画の高さ(height)を 720 にする。横幅(width)はアスペクト比を維持して自動で設定する

ffmpeg -i in.mp4 -vf scale=-1:720 out.mp4

解像度(width x height)を指定する


動画のサイズを 1280x720 にする

ffmpeg -i in.mp4 -s 1280x720 out.mp4

16:9の代表的解像度

通称 width(px) height(px) ffmpegオプション
8K 7680 4320 -s 7680x4320
4K 3840 2160 -s 3840x2160
WQHD 2560 1440 -s 2560x1440
FHD 1920 1080 -s 1920x1080
WXGA++ 1600 900 -s 1600x900
HD 1280 720 -s 1280x720
1024 576 -s 1024x576
768 432 -s 768x432
640 360 -s 640x360
480 270 -s 480x270
320 180 -s 320x180
160 90 -s 160x90

4:3の代表的解像度

通称 width(px) height(px) オプション
QUXGA 3200 2400 -s 3200x2400
QXGA 2048 1536 -s 2048x1536
UXGA 1600 1200 -s 1600x1200
QVGA 1280 960 -s 1280x960
XGA 1024 768 -s 1024x768
SVGA 800 600 -s 800x600
VGA 640 480 -s 640x480
QVGA 320 240 -s 320x240
QQVGA 160 120 -s 160x120

映像を回転角度を指定して回転する

・180度回転する

ffmpeg -i in.mp4 -vf "rotate=180*PI/180" out.mp4

・90度右回転(時計回り)する

ffmpeg -i in.mp4 -vf "rotate=90*PI/180" out.mp4

・90度左回転(反時計回り)する

ffmpeg -i in.mp4 -vf "rotate=-90*PI/180" out.mp4
93
60
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
93
60