FFMPEG An Intermediate Guide/watermarks
From Wikibooks, open books for an open world
FFmpeg offers the overlay filter as a way to overlay images (or even other videos) onto video streams.
To centre overlay/watermark on a video, use this command:
ffmpeg -i inputvideo.avi -i watermarklogo.png -filter_complex \ "overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2" -codec:a copy output.flv
-vfis used for simple filtergraphs (one input, one output), and
-filter_complexis used for complex filtergraphs (one or more inputs, one or more outputs).
-filter_complexwill allow you omit the
moviemultimedia source filter and have a shorter command.
- The audio is simply stream copied (remuxed) in this example with
-codec:a copyinstead of being re-encoded. You may have to re-encode depending on your output container format.
- See the documentation on the
overlayvideo filter for more information and examples. For example, you could use aliases to shorten the command:
- See the FFmpeg H.264 Video Encoding Guide for more information on getting a good quality output.