convert from jpg to mp4 by ffmpeg

Depending on your file names you'll want:

ffmpeg -f image2 -i /path/to/file/image%3d.jpg test.avi

The image%3d would be for files named: image000.jpg, image001.jpg, image002.jpg, etc.

If your files are named image0.jpg, image1.jpg, image2.jpg, etc. then you'd use /path/to/file/image%d.jpg.

See FFmpeg image2 demuxer examples


I can show you an example here,

ffmpeg -f image2 -r 60 -i path/filename%03d.jpg -vcodec libx264 -crf 18  -pix_fmt yuv420p test.mp4
  • f: force format
  • r: frame rate
  • i: input files assuming your files are filename001.jpg, filename002.jpg, ...
  • vcodec: video codec
  • crf: constant rate factor (0-51). 17-18 is (nearly) visually lossless. See Encode/H.264
  • pix_fmt: pixel format

Tags:

Ffmpeg

Jpeg

Mp4