video filter

The FFmpeg hstack filter

Places two or more inputs side by side in a single frame.

3 of 3 variants measured Measured 2026-08-20

The part that catches people

hstack requires every input to have the SAME height, and vstack the same width. Mismatched inputs fail rather than being scaled for you, so a scale on each branch is nearly always required first.

Measured, not described

Every row below is a real job. The same 1280x720 five-second H.264 source went through each variant, so the numbers are comparable to each other and to every other filter page on this site. Encode time is the FFmpeg step on its own, separated from the download and the upload.

VariantEncodeOutputCost
Side by side816 ms440.3 KB · 1280x360$0.0024
Stacked vertically713 ms411.8 KB · 640x720$0.0022
Quad grid884 ms486.1 KB · 960x540$0.0023

The exact commands

Side by side

job_c961b9896d0c4904

Split one source into two branches, equal heights, then stack.

ffmpeg -i https://cdn.rendobar.com/assets/examples/sample.mp4 -filter_complex "split[a][b];[a]scale=640:-2[l];[b]scale=640:-2,hflip[r];[l][r]hstack=inputs=2" -t 5 out.mp4

Stacked vertically

job_d269edb758054ba1

The vstack equivalent, equal widths.

ffmpeg -i https://cdn.rendobar.com/assets/examples/sample.mp4 -filter_complex "split[a][b];[a]scale=640:-2[t];[b]scale=640:-2,hflip[bt];[t][bt]vstack=inputs=2" -t 5 out.mp4

Quad grid

job_64a5c73999d64e8c

Two hstacks feeding a vstack.

ffmpeg -i https://cdn.rendobar.com/assets/examples/sample.mp4 -filter_complex "split=4[a][b][c][d];[a]scale=480:-2[1];[b]scale=480:-2[2];[c]scale=480:-2[3];[d]scale=480:-2[4];[1][2]hstack[top];[3][4]hstack[bot];[top][bot]vstack" -t 5 out.mp4

How these numbers were produced

Each variant was submitted to the Rendobar API as an ffmpeg job against the same public source file, and the response was recorded verbatim. Encode time is the API's own per-step timing for the FFmpeg step. Output size is the byte count of the file the job produced. Cost is what the job was actually billed.

Nothing here was estimated, and the whole set is re-runnable, so if a figure looks wrong it can be checked rather than argued about. The 72 variants behind this filter reference cost $0.193082 in total to measure.

Frequently asked questions

What does the FFmpeg hstack filter do?

Places two or more inputs side by side in a single frame.

What is the most common mistake with hstack?

hstack requires every input to have the SAME height, and vstack the same width. Mismatched inputs fail rather than being scaled for you, so a scale on each branch is nearly always required first.

How long does hstack take to run?

On a 1280x720 five-second H.264 source, the fastest variant on this page (Stacked vertically) spent 713 ms inside FFmpeg. That figure is the encode step alone, measured separately from the download and the upload, so it is the filter's own cost rather than the round trip.

Do I need FFmpeg installed to use hstack?

Not with Rendobar. Every command on this page ran through the Rendobar API against a URL, with no local FFmpeg install and no server. The job id next to each row is the real job that produced the numbers.

Run hstack without installing FFmpeg

Every command on this page ran through the API against a URL. No binary, no server.