How can I convert many images into a movie?

I have about 12000 images, and I want to create a movie based on the timestamps of the images. The timestamp is also the filename. I tried using convert but it crashes my PC when I try to do it. What is a good command-line way to solve this problem?

  • 1
    you want to make a slide show? you need a movie editor/creater not convert
    – ravery
    Jun 16, 2017 at 20:42
  • 2
    When you say 'timestamp' can you give an example of the exact image filenames?
    – andrew.46
    Jun 17, 2017 at 0:02
  • 1
    I have used Openshot to do it. You can install it from the repositories. (I think it is easy to use Openshot in order to create a video clip from a series of pictures, but it is a GUI program, and you are asking for a command line way.)
    – sudodus
    Jun 17, 2017 at 10:34

1 Answer 1


Using ffmpeg, from here:

cd /path/to/images
ffmpeg -f image2  -r 1/5 -pattern_type glob -i './*.png' -c:v libx264 -pix_fmt yuv420p out.mp4

The other option is mencoder. I didn't test it, but you can find some instructions here on SuperUser.

And it looks like this SuperUser answer works fine for a huge number of images:

ls -1v | grep JPG > files.txt
mencoder -nosound -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=21600000 -o windowsill_flowers_7.avi -mf type=jpeg:fps=24 mf://@files.txt -vf scale=1920:1080 
  • I tried this, but it fails with: Unknown encoder 'libx264' I also tried:#apt-get install libav-tools libavcodec-extra libx264-dev updating, upgrading, and rebooting. unknown encoders is still coming up.
    – j0h
    Jun 17, 2017 at 16:57
  • I'm not sure what the cause could be, it worked fine without installing anything in my Ubuntu 16.04, however you can try installing libx264-148 package ... it might help.
    – Ravexina
    Jun 17, 2017 at 17:02

Not the answer you're looking for? Browse other questions tagged or ask your own question.