[FFmpeg-user] Question about ffmpeg

Moritz Barsnick barsnick at gmx.net
Wed Jan 21 10:49:50 CET 2015

On Wed, Jan 21, 2015 at 03:42:36 -0500, Marcus Johnson wrote:
> Your question interested me, so I googled around and found that FFmpeg can
> in fact do this with Tile=1x2, although I'm having trouble getting FFmpeg
> to work with the file names properly.

The tile filter takes one input stream and overlays subsequents images.
Using it, you would do something like this:

$ ffmpeg -i in1.jpg -i in2.jpg -filter_complex "[0:v][1:v]concat,tile=1x2[tiled]" -map "[tiled]" tiled.jpg

I.e. concatenate two images as two streams into subsequent images in
one stream, and then tile them.

(Sorry if this works with "-vf". I only managed with "-filter_complex.)
(Sorry 2 if this has issues with images of changing size. I can't take
 all corner cases into account. ;-))

You can also use the overlay filter: Pad one image (stream) to double its
size, and lay the other over the empty space.

$ ffmpeg -i in1.jpg -i in2.jpg -filter_complex "[0:v]pad=h=2*ih:w=iw:x=0:y=0[pad]; [pad][1:v]overlay=x=0:y=h[tiled]" -map "[tiled]" tiled2.jpg

(You need to solve some colorspace issues though, ffmpeg warns and the result
looks shifted.)


More information about the ffmpeg-user mailing list