私は同じことをするために以下のコードを使用しています。
ffmpeg -framerate 30 -i img%03d.png -c:v libx264 -pix_fmt yuv420p -crf 23 output.mp4
コマンドの内訳:
ffmpeg <- call ffmpeg
-framerate 30 <- set the input framerate to 30
-i img%03d.png <- read PNG images with filename img001, img002, img003, etc..
img can be changed to another prefix
%03d can be changed to %04d for 0001, %05d for 00001 formats, etc...
-c:v libx264 <- Set the codec to libx264
-pix_fmt yuv420p <- Set the pixel format to planar YUV 4:2:0, 12bpp
-crf 23 <- set the Constant Rate Factor to 23 (default value)
-output.mp4 <- the output filename
これは、30 fps(-framerate 30オプション)で入力を読み取り、23(オプション)の一定のレート係数をlibx264持つコーデックを使用してエンコードします。-crf 23