Make video from still images - bryanch/random GitHub Wiki
Note in below example commands, the 10367
is the index number of the first image which is used in feeding the pattern G%07d.JPG
.
simple AVI
ffmpeg -f image2 -framerate 30 -start_number 10367 -i G%07d.JPG foo.avi
x264
ffmpeg -r 30 -start_number 10367 -i G%07d.JPG -vcodec libx264 -preset veryslow -crf 15 -pix_fmt yuv420p foo2.mp4
with GPU acceleration
ffmpeg -f image2 -framerate 15 -start_number 10367 -i G%07d.JPG -frames:v 500 -vcodec h264_nvenc -pix_fmt yuv420p foo3.mp4
However, the video quality from CUDA x264 encoder is much worse than the libx264, I ended up using the libx64 :( My final configuration:
ffmpeg -f image2 -framerate 15 -start_number 10367 -i G%07d.JPG -vf scale=1920:-1 -vcodec libx264 -preset veryslow -crf 25 -pix_fmt yuv420p foo.mp4