How to convert multiple Images into Video in CentOS/RHEL & Ubuntu/Debian

Share It!

ImageMagick and ffmpeg joined can be utilized to transform still pictures into video. Both ImageMagick and ffmpeg have been around for a considerable length of time, and are promptly accessible as bundles with most Linux distributions. The tips below permit you to change over pictures on the command line, which for a may appear to be time consuming, but once you know how to do it you’ll find it much faster than using a GUI!


Required Packages:

You will need ImageMagick and ffmpeg to convert multiple Images to Video. Also you need to install below packages:

  • Yasm
  • libx264
  • libx265
  • libfdk_aac
  • libmp3lame
  • libopus
  • libogg
  • libvorbis
  • libvpx
  • See Also:
    Install FFmpeg on Centos/RHEL 5/6/7
    Compile FFmpeg on CentOS/RHEL 5/6/7
    Few ffmpeg commands for CentOS/RHEL & Ubuntu
    Install ImageMagick on CentOS/RHEL

    Resizing Images:

    ImageMagick includes “mogrify” which is a fine tool for effortlessly changing picture size and resolution. Great for converting pictures for transferring to the web, or preparing large images for video.

    # mogrify -resize 1000x1000! /root/images/*.jpg

    Morphing Images Together:

    This step is only needed if you want to create a smooth transition between the images.

    # convert /root/images/*.jpg /root/newimages/%01d.morph.jpg

    Creating a Video from Images:

    ffmpeg can be used to add several images together into a video with zoom effect.

    # ffmpeg -r 45 -i /root/newimages/%01d.morph.jpg -vf "zoompan=z='if(lte(zoom,1.0),1.5,max(1.001,zoom-0.0015))':d=335" -acodec aac -strict experimental -ac 2 -ar 44100 -ab 192k -shortest  -pix_fmt yuv420p /home/video1.mp4


    Enjoy it!

    Leave a Reply

    Your email address will not be published.