Remove watermark/logo/text overlays from videos using ffmpeg's delogo filter.
Step 1: Extract sample frames Extract frames at 1-second intervals to locate watermark positions:
bash
for t in 1 2 3 4 5; do
ffmpeg -y -ss 00:00:0$t -i "$INPUT" -frames:v 1 "/tmp/wm_frame_$t.jpg" 2>/dev/null
done
Step 2: Analyze with vision model
Use the image tool to analyze the sample frames. Ask for:
Step 3: Build segmentation strategy
Fixed watermark (same position throughout):
Dynamic watermark (position changes at specific times):
Step 4: Process and verify
bash
# Single segment
ffmpeg -y -i "$INPUT" -vf "delogo=x=$X:y=$Y:w=$W:h=$H" -c:a copy "$OUTPUT"
# Multiple segments
# Process each segment separately with -ss/-t, then concat
Verify each segment's result with the vision model before final delivery.
ParameterDescriptionx, yTop-left corner of watermark regionw, hWidth and height of watermark regionINPUTInput video pathOUTPUTOutput video path
Finding exact coordinates:
actual_x = normalized_x * width / 1000When watermark moves between distinct positions:
Identify transition points — Note which frames have watermarks at which positions
Create segments — Each position change = new segment boundary
Process each segment — Apply correct delogo coordinates to each time range
Concatenate — Use ffmpeg concat with a manifest file: text
file 'seg1.mp4'
file 'seg2.mp4'
bash
ffmpeg -y -f concat -safe 0 -i concat.txt -c copy output.mp4
Example segmentation:
SegmentTime RangeWatermark Position10-3.5sBottom-right (x=540,y=1195,w=165,h=55)23.5-5sLeft edge (x=30,y=480,w=160,h=210)
If multiple watermarks exist simultaneously (e.g., corner logo + username handle):
Identify which the user wants removed vs. preserved
Apply multiple delogo filters in the same vf string:
bash
-vf "delogo=x=540:y=1195:w=165:h=55,delogo=x=30:y=480:w=160:h=210"
/root/.openclaw/workspace/downloads/message tool with media parameterdelogo fills the region with a blurred/averaged patch — works best on simple/static backgrounds