fmpeg -f image2 -framerate 2 -i %2d.jpg out.gif
ffmpeg -f image2 -framerate 2 -i %2d.jpg -pix_fmt yuv420p -crf 17 -vcodec libx264 out.mp4
Using node.js
const childProcess = spawn(
'ffmpeg',
[
'-hide_banner',
'-framerate',
`${frameRate}`,
'-i',
`"${folder}/%${padCount}d.png"`,
'-vf',
'scale=1080x1080',
'-r',
'30',
'-pix_fmt',
'yuv420p',
'-crf',
'17',
'-vcodec',
'libx264',
`${filename}`,
],
{
stdio: 'inherit',
shell: true,
},
)