hector-sab / hectorsabblog

1 stars 0 forks source link

join two videos #12

Closed hector-sab closed 1 year ago

hector-sab commented 1 year ago

From https://stackoverflow.com/questions/42255139/ffmpeg-merge-two-videos-into-one-with-side-by-side-same-quality-output

ffmpeg -i left.avi -i right.avi -filter_complex hstack -c:v ffv1 output.avi

Or from https://stackoverflow.com/questions/11552565/vertically-or-horizontally-stack-mosaic-several-videos-using-ffmpeg

Use the vstack (vertical), hstack (horizontal), or xstack (custom layout) filters. It is easier and faster than other methods.

Combine/stack two videos or images Vertical Using the vstack filter.

image

ffmpeg -i input0 -i input1 -filter_complex vstack=inputs=2 output Videos must have the same width.

Horizontal Using the hstack filter.

image

ffmpeg -i input0 -i input1 -filter_complex hstack=inputs=2 output Videos must have the same height.

With a border Using the pad filter. This examples creates a 5px black border between the two sides.

image

ffmpeg -i input0 -i input1 -filter_complex "[0]pad=iw+5:color=black[left];[left][1]hstack=inputs=2" output