How to find the exact x:y:w:h for ffmpeg delogo without guessing
Preview pixels are not source pixels, the box cannot touch the frame edge, and odd numbers leave a coloured rim. The ninety-second measuring procedure.
You drag a selection over the logo in your editor’s preview, read the numbers off the toolbar, paste them into delogo, and the blurred patch lands somewhere else entirely — too small, offset down and left, or half off the frame. The filter did precisely what you asked. The numbers were wrong, and nothing in the output tells you that.
Measuring them properly takes about ninety seconds. Here is the procedure, plus the four things that make hand-written delogo boxes fail.
What the four numbers are
Every value is an integer count of pixels, measured from the top-left corner of the frame, with y increasing downwards.
| Param | Meaning | Hard constraint |
|---|---|---|
| x | Left edge of the box, in pixels from the left of the frame | x >= 1 |
| y | Top edge of the box, in pixels from the top of the frame | y >= 1 |
| w | Box width in pixels | x + w <= width - 1 |
| h | Box height in pixels | y + h <= height - 1 |
They are not percentages, they are not relative to anything, and they are not expressions. delogo does not understand iw or in_w the way crop and overlay do — hand it one and you get Undefined constant from the expression evaluator. If you want a box pinned to the right edge of a 1920-wide frame, you do the subtraction yourself.
Source pixels, not preview pixels
This is the single most common mistake, and it produces a very specific signature: the blur lands up and to the left of the logo and is roughly half the size it should be. That is a 1920×1080 file measured on a 960-wide preview. Every coordinate you read was in preview space and needed doubling.
So start by asking the file what size it actually is, rather than trusting the window you are looking at:
$ ffprobe -v error -select_streams v:0 \
-show_entries stream=width,height -of csv=p=0 input.mp4
1920,1080
Extract one frame and measure that
Do not measure on a video player. Get a still out and measure the still, because the still is in exactly the pixel space the filter works in:
$ ffmpeg -ss 5 -i input.mp4 -frames:v 1 frame.png
Pick a timestamp where the logo is clearly visible. -ss in front of -i is the right choice here — it is a fast keyframe seek and you do not care which exact frame you land on. That casual attitude to -ss is fine for a screenshot and catastrophic when you are cutting a clip; see the keyframe trap for why.
Open frame.png in any image editor with a coordinate readout — GIMP’s pointer position, Photoshop’s Info panel, Preview’s selection dimensions, even a browser with the image at 100% and a screenshot ruler. Draw a rectangle over the logo and read four numbers: the top-left corner is x and y, the selection size is w and h. Confirm the image editor reports the PNG as the same dimensions ffprobe just gave you. If it does not, you are looking at a scaled view and everything after this is wrong.
The extracted PNG is also the ground truth for orientation. Phone footage carries a rotation flag in its metadata, and ffmpeg auto-rotates by default, so the frame your filter sees may be portrait while the stream’s stored width and height are landscape. The PNG went through the same path, so its shape is the shape delogo will see.
Put the box outside the logo’s fringe
delogo does not reconstruct anything. For each pixel inside your box it takes an inverse-distance-weighted average of the pixels immediately outside the box on the same row and column. That ring of sampled pixels is the whole input to the filter, which has two consequences.
First, a tight box is a bad box. Logos are composited with anti-aliased edges and frequently a soft drop shadow, so the pixels one row outside a pixel-perfect bounding box are still partly logo. The filter dutifully averages that tint across the whole patch and you get a coloured haze in the shape of the thing you were trying to delete. Add two to four pixels on every side, and more where there is a shadow.
Second, keep all four values even if your video is 4:2:0 — which it is, if it is H.264 out of almost any camera or encoder. The chroma planes are half resolution, so the filter halves your box for them. An odd x or a w that halves to one pixel short leaves a thin line of the logo’s original colour along one edge: the luma is clean and there is a faint coloured rim where the chroma was not covered.
The box cannot touch the frame edge
Because the filter samples the ring outside your box, that ring has to exist. FFmpeg enforces it, and the check is exactly the one in the table above. Violate it and the run does not warn you, it stops:
$ ffmpeg -i input.mp4 -vf "delogo=x=0:y=0:w=200:h=90" out.mp4
[Parsed_delogo_0] Logo area is outside of the frame.
[vf#0:0] Error reinitializing filters!
Conversion failed!
On a 640×360 frame, x=539:w=100 is accepted and x=540:w=100 is refused, because 640 would leave nothing to sample on the right. The awkward case is a broadcast bug or corner watermark that genuinely runs to the edge of the picture. Clamping your box to x=1 is legal but leaves a one-pixel column of the original logo against the frame border, which reads on playback as a bright or dark hairline band down the side — the artefact people usually describe as “delogo left a line.” The clean fix is to crop the outer pixels away first, or to crop and then pad back to the original dimensions if you need to preserve the frame size.
Verify on one frame, not on the whole file
Never point a new delogo box at a 40-minute source. Render a single frame and look at it. The filter has a show option that draws the box outline, which tells you about placement without you having to judge blur quality at the same time:
$ ffmpeg -ss 5 -i input.mp4 \
-vf "delogo=x=1642:y=52:w=216:h=96:show=1" -frames:v 1 check.png
When the outline sits where you want it, drop show=1, re-render the same single frame, and compare it against frame.png. Only then run the file. Re-encoding is unavoidable with any filter — you are changing pixels — so copy the audio through untouched and pick a quality-targeted encode rather than a bitrate:
$ ffmpeg -i input.mp4 \
-vf "delogo=x=1642:y=52:w=216:h=96" \
-c:v libx264 -crf 18 -preset medium -c:a copy output.mp4
Logos that move, or that are not always there
An intro bug that appears for the first thirty seconds should not blur the rest of the film. delogo supports timeline editing through enable, so gate it on time:
$ ffmpeg -i input.mp4 -vf \
"delogo=x=1642:y=52:w=216:h=96:enable='between(t,5,30)',format=yuv420p" \
-c:v libx264 -crf 18 -c:a copy output.mp4
Note the quoting. between(t,5,30) contains commas, and commas separate filters in a filtergraph, so the expression has to be wrapped in single quotes or every comma escaped with a backslash. Getting this wrong produces a parse error about an unknown filter named 5, which is not an obvious clue.
For a logo that changes position, chain one delogo per position with non-overlapping enable ranges. That works, and it stops being practical somewhere around five or six positions, which is the point at which people go looking for a tool with keyframes. Doing that work in a browser instead of a filtergraph has its own trade-offs — we wrote up why these tools run on WebCodecs rather than ffmpeg.wasm.
Remove a logo
Draw a box over a watermark, then blur, pixelate, fill or interpolate it away for the whole clip.