How to remove hardcoded subtitles from a video (without blurring the frame) - DEV Community

DEV Community

Nuco · CleanVideoText
Nuco · CleanVideoText

Posted on AI-assisted

How to remove hardcoded subtitles from a video (without blurring the frame)

You turn subtitles off, and the words are still there. They are not a track you can disable — they are pixels in the frame. Cropping cuts the composition, a blur bar looks like a censor box, and re-encoding the file changes nothing.

This is the decision tree I would give a developer who has one clip and no editor: how to confirm the text is really baked in, the ffmpeg routes that work, and where each one falls apart.

Disclosure: I build CleanVideoText, one of the hosted options in section 3.4. The rest of the post is tool-agnostic, including the cases where that tool is the wrong choice.

1. First, check whether the subtitles are actually burned in

A video can carry subtitles in two very different ways:

  • Soft subtitles are a separate stream. The player draws them on top, so you can turn them off.
  • Hard subtitles / open captions are part of the picture. The encoder wrote them into every frame.

Run ffprobe before touching ffmpeg:

ffprobe -v error -show_entries stream=index,codec_type,codec_name -of csv=p=0 input.mp4
Enter fullscreen mode Exit fullscreen mode

If the output contains a line with subtitle, the file has a subtitle stream. You can drop it without re-encoding the video:

ffmpeg -i input.mp4 -map 0 -map -0:s -c copy output.mp4
Enter fullscreen mode Exit fullscreen mode

-map 0 keeps every stream, -map -0:s removes the subtitle streams, and -c copy copies the video and audio without quality loss. If the container refuses the subtitle codec, this route avoids the problem entirely because the subtitles never get muxed into the output.

If ffprobe shows no subtitle stream and the words are still visible with subtitles off, they are burned in. The rest of this post is about that case.

2. The cleanest fix is usually the source project

If you still have the Premiere, Resolve, or Final Cut project, hide the text layer and export again. The original pixels underneath the text were never destroyed — they were just covered. This is the only method that can honestly call the result "removed" rather than "reconstructed".

If a client or collaborator sent you the finished file, ask whether they can send a clean export first. It takes them two minutes and saves you an afternoon of repair work.

3. If you only have the finished file

There are four practical routes. They differ in what they preserve, not just in quality.

Method Removes the text Keeps framing Keeps background detail Works on moving text
Crop Yes, by deleting the region No No Sometimes
Cover / blur No, hides it Yes No With tracking
delogo Reconstructs from box edges Yes Approximate No
AI inpainting Reconstructs from surrounding frames Yes Best available With a good mask
Re-edit from source Yes Yes Yes Yes

3.1 Crop

The simplest route: cut off the part of the frame that contains the text.

ffmpeg -i input.mp4 -vf "crop=iw:ih-120:0:0" -c:v libx264 -crf 18 -c:a copy output.mp4
Enter fullscreen mode Exit fullscreen mode

This removes 120 pixels from the bottom and keeps the top-left origin. The output frame is shorter than the input. If you need a specific delivery size, you will have to scale the result up (softening it) or pad it (adding bars), so check whether the reframing is acceptable before committing.

Crop works well for social reposts where the composition is flexible. It fails when hands, faces, or important action sit near the caption band.

3.2 Cover or blur the region

A cover is honest about what it is: a shape on top of the video.

ffmpeg -i input.mp4 -vf "drawbox=x=0:y=ih-120:w=iw:h=120:color=black@0.9:t=fill" -c:v libx264 -crf 18 -c:a copy output.mp4
Enter fullscreen mode Exit fullscreen mode

A blur band is slightly less obvious, but it still hides rather than removes:

ffmpeg -i input.mp4 -filter_complex \
  "[0:v]crop=iw:120:0:ih-120,boxblur=20:5[band];[0:v][band]overlay=0:H-120[out]" \
  -map "[out]" -map 0:a? -c:v libx264 -crf 18 -c:a copy output.mp4
Enter fullscreen mode Exit fullscreen mode

H is the height of the main input, so overlay=0:H-120 pins the blurred strip to the bottom. The ? in -map 0:a? makes the audio optional, which matters for silent clips.

Both routes keep the original framing but destroy whatever is behind the bar. On a moving shot, the blur also makes the motion underneath unreadable, which is often more distracting than the caption was.

3.3 delogo: ffmpeg's built-in reconstruction

The delogo filter removes a rectangular logo or caption by interpolating from the pixels around the box:

ffmpeg -i input.mp4 -vf "delogo=x=120:y=760:w=840:h=80" -c:v libx264 -crf 18 -c:a copy output.mp4
Enter fullscreen mode Exit fullscreen mode

You can chain multiple boxes:

ffmpeg -i input.mp4 -vf "delogo=x=120:y=760:w=840:h=80,delogo=x=40:y=40:w=180:h=60" ...
Enter fullscreen mode Exit fullscreen mode

How well it works depends entirely on the background. delogo has no temporal model: each frame is repaired independently, using only the border of the box. On a small timestamp over a smooth wall, that is often enough. On a full-width subtitle band over a detailed or moving background, it smears, flickers, and leaves a visible rectangle.

Practical rules:

  • Keep the box as tight as possible, with a pixel or two of margin.
  • Do not let the box touch the frame edge.
  • Test a segment with motion, not a still frame.
  • If the text moves, delogo cannot follow it.

3.4 AI inpainting

AI inpainting takes a mask of the text and fills it using information from nearby frames. The temporal component is the important part: a good model can keep the repair consistent as the camera moves, which frame-by-frame filters cannot.

Open-source options include ProPainter and E2FGVI. Both need a GPU and, more importantly, a mask for every frame. Generating that mask is the hard part: OCR plus a threshold works on high-contrast captions, but fails on stylized text, motion blur, and text over busy backgrounds. If you already have a segmentation pipeline, this is a strong route. If you do not, budget a day for mask cleanup before you judge the model.

A hosted option is CleanVideoText. It handles the mask and the reconstruction in one pass: upload an MP4 or MOV, pick a 5–90 second segment, choose Subtitles, All text, or Select area, and download an MP4 with the original frame size and audio. The limits are worth knowing before you try it: clips are uploaded to their server (the browser sample is local, real cleanups are not), each job covers at most 90 seconds, the free trial is 30 seconds, and paid plans start at $9.90/month. Select area uses a fixed box, so it does not track text that moves.

No method in this section can recover information that was never captured. If a caption sits on top of a face, there is no background to restore; the model invents plausible pixels. Always review the result at the first and last frame of each cue.

4. Decision tree

  • Subtitles turn off in the player → remove the subtitle stream with -map -0:s.
  • You have the project file → hide the text layer and re-export.
  • Small, fixed mark over a simple background → try delogo first. It is free and fast.
  • Composition must stay, background is detailed or moving → AI inpainting is the only route that has a chance.
  • One short clip, no GPU → a hosted trial is cheaper than setting up a local pipeline for a single job.
  • Long footage or a batch → build the local pipeline; per-minute pricing adds up quickly.

5. Test the hardest five seconds first

Do not process the whole clip and then discover that the repair falls apart at the one cue that crosses a face.

Pick the worst five seconds — fast motion, fine detail, text over a person — and run only that segment. Then extract frames at the cue boundaries:

ffmpeg -ss 00:00:12.300 -i output.mp4 -frames:v 1 frame-start.png
ffmpeg -ss 00:00:14.800 -i output.mp4 -frames:v 1 frame-end.png
Enter fullscreen mode Exit fullscreen mode

Check for:

  • ghost letters or a faint outline where the text used to be;
  • a halo or a soft rectangle around the repaired area;
  • smearing that follows the camera movement;
  • a pop at the first or last frame of the cue;
  • audio that drifts out of sync after re-encoding.

A five-second test is also the cheapest way to compare two methods on your own footage. Screenshots of someone else's demo will not tell you how your background holds up.

6. A note on rights

Only edit footage you own or have a license to edit. Removing a watermark or a handle from someone else's video is not a technical problem, it is a rights problem. The tooling above is deliberately general; the responsibility for using it stays with the editor.

The short version

The best removal is the one that never touches pixels: turn off the subtitle track, or re-export from the project. The second best is the method that matches your footage. Crop when the composition is flexible, delogo when the mark is small and the background is forgiving, inpainting when the frame has to stay intact — and test the hardest five seconds before you pay for the whole clip.

Top comments (0)