Configure FFmpeg Delogo Filter Coordinates and Band
This article explains how to accurately set the bounding box
coordinates and border band thickness using FFmpeg's delogo
filter. By configuring parameters such as horizontal offset, vertical
offset, width, height, and band edge thickness, you can cleanly suppress
or interpolate watermarks and logos from your video footage.
Delogo Filter Syntax and Core Parameters
The basic syntax for the delogo video filter requires
targeting the rectangular area of the logo using specific parameters
within the -vf (video filter) flag:
ffmpeg -i input.mp4 -vf "delogo=x=X:y=Y:w=W:h=H:band=B" -c:a copy output.mp4The filter relies on five primary parameters to define the target area:
x: The horizontal position of the top-left corner of the logo box, measured in pixels from the left edge of the video frame.y: The vertical position of the top-left corner of the logo box, measured in pixels from the top edge of the video frame.w: The total width of the logo bounding box in pixels.h: The total height of the logo bounding box in pixels.band(ort): The thickness of the surrounding interpolation band in pixels. The default value is1.
Determining Exact Coordinates
To locate the exact pixel values:
Extract a single representative frame from your video:
ffmpeg -ss 00:00:10 -i input.mp4 -frames:v 1 frame.pngOpen
frame.pngin an image editor (such as GIMP or Photoshop).Select the logo using the rectangular marquee tool.
Note the selection's top-left coordinates (
XandY) and its dimensions (WidthandHeight).
Configuring the Band Thickness
The band parameter defines the thickness of the
blur/interpolation margin around the specified rectangle. The filter
samples pixels from this outer band to calculate the visual replacement
for the content inside the w by h area.
- Low Band Values (
band=1orband=2): Best for logos placed over busy or detailed backgrounds, as this limits how far outward the filter samples neighboring pixels. - Higher Band Values (
band=4or higher): Useful when removing logos against smooth gradients or uniform solid colors to create a softer, more gradual blend. - Sizing Constraints: The
bandvalue must not exceed half of the width (w / 2) or half of the height (h / 2). Additionally, the bounding box plus the band cannot extend beyond the frame boundaries.
Previewing the Bounding Box
Before running a full encode, verify that your coordinates and band
size cover the logo correctly by enabling the visual overlay mode with
show=1:
ffplay -i input.mp4 -vf "delogo=x=1600:y=50:w=260:h=80:band=2:show=1"This draws a green rectangle showing the target area and the band margin without permanently applying the interpolation.
Final Production Command
Once the green outline aligns with the target logo, remove
show=1 and encode the output:
ffmpeg -i input.mp4 -vf "delogo=x=1600:y=50:w=260:h=80:band=2" -c:v libx264 -crf 18 -c:a copy output.mp4