Add Watermark to Video using FFmpeg

Add Watermark to Video using FFmpeg

FFmpeg includes powerful filtering options for modifying video content, including placing an image watermark over a video. Adding a watermark can help identify the source of a video, display branding, or add other visual elements. This tutorial demonstrates how to add a watermark to a video using FFmpeg.

FFmpeg overlay filter can combine an image with a video stream and position the image at a specified location.

Download a sample watermark image and video for testing:

curl -sSo watermark.png https://raw.githubusercontent.com/lunapaint/pngsuite/main/png/z09n2c08.png
curl -sSo test.mp4 https://raw.githubusercontent.com/mediaelement/mediaelement-files/master/big_buck_bunny.mp4

The watermark can be added to the video with the following command:

ffmpeg -i test.mp4 -i watermark.png -filter_complex "overlay=10:10" result.mp4

Command breakdown:

  • ffmpeg - the command-line tool used to process multimedia files.
  • -i test.mp4 - loads the video that will receive the watermark.
  • -i watermark.png - specifies the image used as the watermark.
  • -filter_complex "overlay=10:10" - places the watermark 10 pixels from the left edge and 10 pixels from the top edge of the video.
  • result.mp4 - specifies the filename for the processed video.

Leave a Comment

Cancel reply

Your email address will not be published.