convert from jpg to mp4 by ffmpeg

Sam picture Sam · Apr 9, 2014 · Viewed 48.5k times · Source

I have 320 jpg(320x574) images which I have recorded them with 2004 fps. I want to make a .mp4 video of them. I have run below codes in cmd (win7) and it just make a video of jpg number 320 and if I go for this ('*.jpg') insted of 320 it does not work. I really appreciate any help.

ffmpeg -r 1/5 -i C:\data-Sam\320.jpg -c:v libx264 -r 30 -pix_fmt yuv420p C:\data-Sam\out.mp4

Answer

Richy321 picture Richy321 · Apr 9, 2014

Depending on your file names you'll want:

ffmpeg -f image2 -i Path/To/File/filename%3d.jpg test.avi

The filename%3d would be for files named: filename000.jpg, filename001.jpg, filename002.jpg, etc.

See FFmpeg image2 demuxer examples