0

I have one ffmpeg command that merges 2 mp4 videos together side by side and then another command that applies a watermark to the output video of the first command. The commands are:

Merge Side by side

ffmpeg -i left.mp4 -i right.mp4 -filter_complex "[0:v][1:v]hstack,format=yuv420p[v];[0:a][1:a]amerge[a]" -map "[v]" -map "[a]" -c:v libx264 -crf 18 -ac 2 output.mp4

Apply watermark

ffmpeg -i output.mp4 -i watermark.png \ -filter_complex "overlay=x=(main_w-overlay_w)/2:y=(main_h-overlay_h)/2" output-with-watermark.mp4

Is there anyway I can apply the watermark at the same time as merging the mp4's?

1 Answer 1

1

Just combine your filters:

ffmpeg -i left.mp4 -i right.mp4 -i watermark.png -filter_complex "[0:v][1:v]hstack,format=yuv420p[tmpv];[0:a][1:a]amerge[a];[tmpv][2:v]overlay=x=(main_w-overlay_w)/2:y=(main_h-overlay_h)/2[v]" -map "[v]" -map "[a]" -c:v libx264 -crf 18 -ac 2 output-with-watermark.mp4

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .