14

I wish to combine multiple images into a single strip of images, using FFMPEG.

I have been trying to search this thing on google, but unable to find anything useful. All links take me to places where multiple images are combined to give a video output.

Assuming that all the files are of the same width and height, how can I join them to get a single strip of images. Can anybody help me?

Robotnik
  • 2,645
Manu
  • 1,203
  • 2
  • 9
  • 9

2 Answers2

24

Use the tile filter

tile

Using the scale and tile video filters with input files 001.png to 005.png:

ffmpeg -i %03d.png -filter_complex "scale=120:-1,tile=5x1" output.png

If you have file names that are in a non-numbered sequential order you can use the glob pattern type (not supported by Windows):

ffmpeg -pattern_type glob -i "*.png" -filter_complex tile=5x1 output.png

Margin / border

You can also add a margin (outer border space) and padding (space between frames):

tile with margin and padding

ffmpeg -i %03d.png -filter_complex "scale=120:-1,tile=5x1:margin=10:padding=4" output.png

Default color is black. Add the color option if you want to change the border/margin color:

ffmpeg -i %03d.png -filter_complex "scale=120:-1,tile=5x1:margin=10:padding=4:color=white" output.png

A vertical orientation is possible. tile=1x5 for this example:

vertical tile

More info

See the tile filter documentation.

llogan
  • 63,280
7

If you've got do it with ffmpeg then I don't know. If you want to get the job done and are willing to use another program suitable for the task then convert is part of ImageMagick.

convert sepimage-0.png sepimage-1.png sepimage-2.png -channel RGB \
-combine imagecopy.png
slhck
  • 235,242
cybernard
  • 14,924