Kenji Nguyễn
Kenji Nguyễn

Reputation: 33

how to mirror + add logo to video?

how to mirror + add logo to video? How to mirror video, then add logo to video using ffmpeg?

Upvotes: 2

Views: 3161

Answers (1)

TheSHEEEP
TheSHEEEP

Reputation: 3132

To flip a video horizontally, you can use -vf hflip (or vflip for vertical flipping).

To add a watermark of any image to a video is more complex, especially if you want to position it:

-i logo.png -filter_complex "overlay=x=(main_w-overlay_w)/2:y=(main_h-overlay_h)/2"

There are a lot of things you can do with the overlay filter, check the documentation. It gets extremely complex if you also want to scale the overlay, so make sure your logo file is the right size before that.

However, you cannot mix -vf and -filter_complex, so the flipping has to become part of the complex filter. So, for your desired result, you'd have to do this (assuming you want the logo to be at position 10/10):

ffmpeg -i input.mp4 -i logo.png -filter_complex "hflip[flipped];[flipped]overlay=x=10:y=10" out.mp4

Upvotes: 4

Related Questions