LoginSignup
14
7

More than 3 years have passed since last update.

研究で使うFFmpegコマンドまとめ

Last updated at Posted at 2018-08-26

連番画像(label_image064.png, label_image065.png, ...)から動画を作成

ffmpeg -r 30 -start_number 64 -i image%03d.png -vcodec libx264 -pix_fmt yuv420p -r 60 out.mp4

動画から連番画像を生成

ffmpeg -i input.mp4 -vcodec jpg %05d.jpg

2つの動画(1.mp4,2.mp4)を上下で結合

 ffmpeg -i 1.mp4 -i 2.mp4 -filter_complex "vstack" out.mp4

2つの動画(1.mp4,2.mp4)を左右で結合

ffmpeg -i 1.mp4 -i 2.mp4 -filter_complex "hstack" out.mp4

640x480(6:4)の左右に107pixelずつ黒帯を付け、854x480(16:9)で出力

ffmpeg -i input.mp4 -vf "pad=854:0:107:0" output.mp4

2つの動画(1.mp4 2.mp4)を時間方向に結合

ffmpeg -f concat -safe 0 -i "video_list.txt" -c copy -movflags +faststart out.mp4
video_list.txt
file '1.mp4'
file '2.mp4'

動画を高品質なGIF画像に書き出し

ffmpeg -i input.mp4 -filter_complex "[0:v] fps=10,split [a][b];[a] palettegen [p];[b][p] paletteuse" output-palette.gif

画質を低下させずに動画をクロップ

input=1920x1080,output=9x16動画
ffmpeg -i input.mp4 -vf crop=w=607:h=1080 -qscale 1 output.mp4

(2018.09.19追記)
上下・左右結合をそれぞれvstackhstackに変更

14
7
2

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
14
7