I'm using ffmpeg to stack two videos vertically. They might be different size so I need to scale them to same size. I have found following commands.
First one works for different sizes (but won't scale to proper size):
ffmpeg -i input1 -i input2 -filter_complex '[0:v]pad=iw:ih*2[int];[int][1:v]overlay=0:H/2[vid]' -map [vid] -c:v libx264 -crf 23 -preset veryfast output
Second one works if videos have same width and same pixel format:
ffmpeg -i input1 -i input2 -filter_complex vstack output
How to get width of first input inside complex filter argument so second input could be scaled to same width? What would be the command to do so? I would prefer vstack filter since it should be faster than combination of pad and overlay.