MEDIA GUIDES / Video effects

Using FFmpeg to Add Watermarks to Your Videos

Adding watermarks to video is a common way to protect content and reinforce brand identity. Watermarks help prevent unauthorized reuse, support licensing requirements, and keep ownership clear when content is shared across platforms. They’re also useful for preview files, rough cuts, and early review versions.

FFmpeg is a well-known command-line tool to add a watermark to your videos. It’s lightweight, scriptable, and perfect for automation at scale. By understanding FFmpeg and watermarks, teams can create dependable workflows for securing and managing their video assets.

In this article, we will cover instructions on how to add watermarks to your video using the FFmpeg watermark command-line approach.

Key takeaways:

  • FFmpeg is a powerful open-source tool used to process and edit video and audio, supporting nearly all media formats. It can convert files, trim clips, add filters or watermarks, and is widely used for its flexibility and automation features.
  • Watermarks are visible marks like logos or text added to videos to show ownership and prevent misuse. They help protect content during sharing, support licensing, and make sure creators stay credited throughout the video’s lifecycle.

In this article:

What is FFmpeg, and What Can It Do?

FFmpeg is a leading open-source multimedia framework popular among developers. It can convert formats, adjust quality, extract frames, and apply overlays, which makes it a trusted utility for developers and editors who need precise control over media.It supports almost all video formats for media processing operations such as decode, encode, transcode, mux, demux, stream, filter, and play.

Some of the things that FFmpeg can do:

  • Format conversion for common audio and video types
  • Trimming, merging, and splitting clips
  • Extracting still images from video
  • Applying filters for quality and color adjustments
  • Add watermarks and overlays to videos

FFmpeg’s powerful filtering capabilities, cross-platform compatibility, and automation scope make it a highly capable and popular choice for adding watermarks to videos.

Why Do We Put Watermarks on Videos?

Watermarks are visual markers placed on top of a video to show ownership or protect the content from misuse. They can appear as logos, text, or subtle graphics that stay visible during playback. Many teams add watermarks to help safeguard their media when it is shared outside their organization or used in early review cycles.

These markers play a key role in preventing unauthorized distribution and help viewers identify the source of the content. They also support licensing terms by keeping ownership clear across different platforms and file versions. Watermarks give creators confidence that their work remains credited and protected, even as videos move through editing, collaboration, and publishing stages.

Text and Image Watermarks with FFmpeg

When you add a watermark in a video, FFmpeg simply merges two video streams: your video and the watermark.

Let’s walk through a simple way to add both text and an image as a watermark with an FFmpeg command.

How to Add an Image Watermark with FFmpeg

To add an image as a watermark, use this FFmpeg watermark command:

ffmpeg -i input.mp4 -i logo.png -filter_complex "overlay=10:10" output.mp4

The above command includes:

  • -i input.mp4 – your source video file.
  • -i logo.png – the watermark image (PNG format recommended for transparency).
  • overlay=10:10 – tells FFmpeg to place the watermark 10 pixels from the top and left edges of the frame.
  • output.mp4 – your final watermarked video.

How to Add a Text Watermark with FFmpeg

FFmpeg’s drawtext filter allows for a quick overlay of text directly onto the video. This comes in handy when you don’t have an image for your watermark, or just want a more unobtrusive watermark. Usually, a text-based watermark includes a copyright notice, tagline, creator name, or a combination of all for branding.

In this example, we’ll be using “© Cloudinary 2025” as our text for the watermark. The FFmpeg watermark command to add text as a watermark is as follows:

ffmpeg -i input.mp4 -vf "drawtext=text='© Cloudinary 2025':fontcolor=white:fontsize=24:x=10:y=H-th-10" output.mp4

Here‘s a quick breakdown of the command:

  • drawtext=text='© Cloudinary 2025' sets the watermark text.
  • fontcolor=white defines the color of the text.
  • fontsize=24 controls the text size.
  • x=10:y=H-th-10 positions the text 10 pixels from the left and bottom edges.

We can change these parameters to match our visual style. For instance, fontcolor=gray@0.7 makes the text semi-transparent in a grey shade, while the fontsize lets users increase or decrease the text’s size as per requirements.

Additionally, we can also customize the font by referencing a system font file:

ffmpeg -i input.mp4 -vf "drawtext=text='© MyBrand':fontfile=/path/to/font.ttf:fontcolor=white:fontsize=28:x=(w-text_w)-20:y=20" output.mp4

This gives a polished, branded appearance associated with your company’s brand identity.

How to Position Your Watermark Correctly in Your Video

FFmpeg gives developers full control over positioning, size, transparency, and even motion.

To position your watermark correctly in your video, you have to use the FFmpeg position variable in the overlay filter. The command involves dynamic variables, including W (video width), H (video height), w (watermark width), and h (watermark height) for adjusting the watermark’s position.

FFmpeg uses "overlay=x:y", where x & y are horizontal and vertical positions of the video. With this, you can position a watermark anywhere on the video using precise pixel coordinates.

For example, overlay=50:50 places the watermark 50 pixels from the left and 50 pixels from the top.

Note: These FFmpeg position-formulas are also resolution-independent. Meaning, for any resolution (whether it’s 720p, 1080p, or 4K) the watermark always lands in the correct location because the expressions calculate the placement at runtime.

Now, once you have added the watermark in your video, make changes to the “overlay” function as per the following FFmpeg watermark command:

ffmpeg -i input.mp4 -i logo.png -filter_complex "overlay=10:10" output.mp4 

Here, "overlay=10:10" tells FFmpeg to place the watermark 10 pixels from the top and left edges of the frame.

Here are some commonly used and recommended positions for watermarks used in professional videos:

Position FFmpeg snippet When to use
Top-Left Corner overlay=10:10 Recommended position when the video has lower-third graphics or captions (i.e., the watermark stays tucked away but clearly visible)
Top-Right Corner overlay=W-w-10:10 This simply aligns the watermark to the right with a 10-pixel margin (i.e., commonly used in professional videos for clean logo placement)
Bottom-Left Corner overlay=10:H-h-10 Perfect when the top corners are busy or when the bottom-left area has more empty space in the frame.
Bottom-Right Corner (Most Used) overlay=W-w-10:H-h-10 Industry-standard placement. Avoids subtitles, UI overlays, and important visual elements while staying subtle and consistent.
Centered Watermark overlay=(W-w)/2:(H-h)/2 Places the watermark directly in the center. Ideal for demo videos, previews, or “sample” overlays that must stay highly visible.

Making Your Watermark Stand Out: Size, Visibility, and Motion

A watermark must be embedded subtly to stand out, but at the same time, it should not distract or overshadow the actual video. To create a polished and branded watermark, consider resizing it, modifying its opacity, and adding animation. FFmpeg gives developers full freedom to adjust all of these aspects.

Change the Size of your Watermark using FFmpeg

To resize a watermark in FFmpeg, we use the scale filter, which lets you make your watermark larger, smaller, or responsive to the video’s resolution.

With [1]scale=W:H, FFmpeg takes the watermark image and resizes it to the specified width W and height H. We have three methods to resize the watermark, which are:

  • Fixed Size Scaling: In fixed scaling, we simply mention the width and height of the watermark in pixels. For example, if we are using [1]scale=120:120, it means 120 px wide and 120 px tall.
  • Percentage Scaling: With the percentage scaling method, we use a percentage of its original dimension to modify the watermark’s size. For example, [1]scale=iw*0.2:ih*0.2 scales the watermark to 20% of its original size.
    • Here, iw equals to input watermark width and ih equals the input watermark height. Thus, if your watermark is originally 1000×1000 px, the new width will be 1000 × 0.2 = 200px, and the new height will be 1000 × 0.2 = 200px.
  • Aspect Ratio Scaling (Recommended): With this method, the watermark always stays proportional, irrespective of resolutions such as 720p, 1080p, or 4K. For instance, if we use the [1]scale=W*0.1:-1 command, FFmpeg reads the command as W ( i.e., width of the main video), 0.1 (i.e., 10% of the video width), and -1 (i.e., auto-calculate the height to keep aspect ratio). If the video is 1920px wide, the new watermark width will be 192px, and the height will adjust automatically

Tweak the Visibility of Your Watermark using FFmpeg

FFmpeg supports control over watermark’s transparency using alpha channels or blending filters.

Some recommended FFmpeg’s alpha values for reference:

Alpha Value Visibility Level Description
1.0 Fully opaque No transparency; watermark is solid and clearly visible.
0.5 Semi-transparent 50% transparent; blends with the video without losing clarity.
0.2 Very light Soft, subtle watermark; minimally noticeable on screen.
0.0 Invisible Fully transparent; watermark does not appear at all.

To change the opacity, we have two ways to control it:

  • Adjust Transparency (Before Overlay): With the colorchannelmixer filter, we change the watermark’s alpha channel directly. For example, to make the watermark semi-transparent, we use the following command:
ffmpeg -i input.mp4 -i logo.png -filter_complex "[1]format=rgba,colorchannelmixer=aa=0.6[wm];[0][wm]overlay=W-w-20:H-h-20" output.mp4
  • Set Opacity (During Overlay): This method applies transparency at the moment the watermark is placed on the video. Here, alpha=0.6 means the watermark is 60% visible.
ffmpeg -i input.mp4 -i logo.png -filter_complex "[0][1]overlay=10:10:alpha=0.6" output.mp4

Make Your Watermark Move with FFmpeg

To add motion to your watermark, use this filter in your FFmpeg watermark command:

overlay=x=EXPRESSION:y=EXPRESSION”

A new command with a motion expression will be modified as follows:

ffmpeg -i input.mp4 -i logo.png -filter_complex "[0][1]overlay=x='t*50':y=10" output.mp4

Here, t represents time in seconds, and t*50 means the watermark moves 50 pixels per second. You can slow it down or speed it up by changing the number. Additionally, to give the watermark a smooth side-to-side wave motion effect, we use “sin(t*2)” filter in the command.

For example, in the following command, the sin(t*2) makes the watermark move back and forth from its position, giving a smooth motion effect.

ffmpeg -i input.mp4 -i logo.png -filter_complex "[0][1]overlay=x='10 + sin(t*2)*20':y=10" output.mp4

Here are some professional motion effects for watermarks classified based on their purpose:

Motion Type Overlay Snippet (motion part only) When to Use It
Horizontal Slide overlay=x='t*50':y=10 For intros, transitions, or attention-grabbing watermark movement.
Vertical Slide overlay=x=10:y='t*40' When the watermark should appear from the top or bottom.
Smooth Wave Motion overlay=x='10 + sin(t*2)*20':y=10 For a gentle, modern-looking movement.
Bounce Effect overlay=y='abs(sin(t)*120)' For previews or demo watermarks that need to be very visible.
Fade-In (Text) alpha='t/2' When the watermark should appear gradually.
Pulse / Glow (Text) alpha='0.3 + 0.2*sin(t*2)' When you want a subtle breathing effect to highlight the watermark.

Wrapping Up: The Art of Watermarking with FFmpeg

Adding watermarks with FFmpeg gives you full control over placement, opacity, and timing. By using the overlay filter and a few targeted commands, you can protect your content and maintain consistent branding across your videos. It is a reliable method for hands-on users who want to fine-tune each detail in their workflow.

As your library grows, handling these steps manually can become harder to manage. Cloudinary streamlines this work by applying transformations on demand and delivering watermarked videos at scale. You can set rules once, automate variations, and ensure every asset follows the same branding standards.

Transform your videos instantly with Cloudinary’s powerful API tools. Sign up for a Cloudinary account today and see how easy video transformation can be.

Frequently Asked Questions

Can FFmpeg add text to video?

Yes, FFmpeg’s drawtext filter allows you to quickly overlay text directly onto the video

How to add watermark in video using FFmpeg?

To add an image as a watermark, use FFmpeg’s overlay filter in the command. The command ffmpeg -i input.mp4 -i logo.png -filter_complex "overlay=10:10" output.mp4 tells FFmpeg to place the watermark 10px from the top-left corner.

What file type should I use for watermark images?

It’s recommended to use a high-quality and transparent PNG image, as it supports alpha channels that blends in cleanly with the video.

QUICK TIPS
Matthew Noyes
Cloudinary Logo Matthew Noyes

In my experience, here are tips that can help you better master FFmpeg-based watermarking for high-performance, scalable video workflows:

  1. Pre-render multi-resolution watermark assets
    Create versions of your logo optimized for SD, HD, and 4K resolutions in advance. Then script FFmpeg to dynamically select the correct asset size per video resolution, preserving clarity without scaling artifacts.
  2. Use animated PNG (APNG) for motion branding
    If your branding includes motion (e.g., shimmering logo), consider using APNGs with FFmpeg’s support via libavcodec. This preserves lightweight animation and doesn’t require heavyweight video overlays.
  3. Avoid burn-in artifacts with color-aware blending
    Instead of static alpha values, blend your watermark dynamically based on background contrast using FFmpeg’s lut or blend filters—especially for videos with highly variable lighting or scenes.
  4. Watermark only keyframes for efficiency
    For review or draft versions, insert watermarks only on I-frames (keyframes) using select=eq(pict_type\,I). This reduces encode time and preserves quality on P- and B-frames in previews.
  5. Watermark as a separate alpha channel layer
    When building master files for distribution, embed watermark layers into separate alpha channels or streams. This allows on-the-fly toggling of watermarks in downstream platforms like Cloudinary or Adobe tools.
  6. Add viewer-specific forensic watermarks
    Combine FFmpeg with custom scripts to inject dynamic watermarks (e.g., username, timestamp) into each video copy. This creates traceable, individualized content ideal for review or licensing workflows.
  7. Use hardware-accelerated filters for batch processing
    If you’re watermarking thousands of videos, offload to GPU using FFmpeg’s -hwaccel and -filter_hw_device flags. This speeds up filter-heavy operations like scale, overlay, and alpha blending.
  8. Preview overlay alignment without re-encoding
    Use ffplay with identical filter chains to visualize watermark positions before running expensive encode jobs. This dramatically speeds up iteration when aligning UI-safe regions.
  9. Integrate time-based watermarking in long videos
    Fade in/out watermarks periodically (e.g., every 5 minutes) using expressions like enable='between(t,300,330)'. This keeps the content protected without persistent distraction during playback.
  10. Apply watermark logic conditionally in scripts
    Use shell conditions or metadata tags to apply watermarks only to external-facing or flagged videos. Avoid blanket processing to save time and resources, especially in large asset pipelines.
Last updated: Nov 26, 2025