Scaling and hstacking at the same time?

Questions involving a Windows version of FFmpeg.
Post Reply
Posts: 2
Joined: Wed Jun 12, 2019 2:24 pm

Scaling and hstacking at the same time?

Post by donquibeats » Wed Jun 12, 2019 2:25 pm


I've got an hstack operation running fine, which takes two 1024x576 source files and puts them side-by-side into a single output file, using these parameters:
-i "[source 1]" -i "[source 2]" -filter_complex hstack -map 1:a -b:v 6000k -s 2048x576 -y "[output file]"

However a situation has arisen where one or both of the source files might not be 1024x576, and will need to be scaled prior to the hstack.

Is there a way I can apply extra parameters that will cause the source(s) to be scaled to a specific size and then hstacked as part of a single FFmpeg operation? Or do I need to rescale the video to a separate file first, then hstack the result?

I think I know the individual parameters I'm trying to set, but my attempts to get the grammar of it correct have been fruitless, so any help would be appreciated.


Posts: 235
Joined: Mon Feb 24, 2014 1:46 pm

Re: Scaling and hstacking at the same time?

Post by pandy » Mon Jul 01, 2019 7:42 pm

you can do both, just follow general guidelines for filtering within filter_complex - source mapping for example: ... er-complex


Code: Select all

-i source1 -i source2 -filter_complex "[0:v]scale=xxxxxx,pad=xxxxxx[vout1];[1:v]scale=xxxxxx,pad=xxxxxx[vout2];[vout1][vout2]hstack[out]

Post Reply