FFMPEG An Intermediate Guide/watermarks
< FFMPEG An Intermediate GuideFFmpeg 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[1]:
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
-
-vf
is used for simple filtergraphs (one input, one output), and-filter_complex
is used for complex filtergraphs (one or more inputs, one or more outputs). - Using
-filter_complex
will allow you omit themovie
multimedia source filter and have a shorter command. - The audio is simply stream copied (remuxed) in this example with
-codec:a copy
instead of being re-encoded. You may have to re-encode depending on your output container format. - See the documentation on the
overlay
video filter for more information and examples. For example, you could use aliases to shorten the command:overlay=(W-w)/2:(H-h)/2
- See the FFmpeg H.264 Video Encoding Guide for more information on getting a good quality output.
- ↑ http://stackoverflow.com/questions/10918907/how-to-add-transparent-watermark-in-center-of-a-video-with-ffmpeg
This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.