REFERENCE

Hardcoded subtitles

Two kinds of subtitles look identical on screen and need opposite fixes. One is a stream you can drop in seconds without touching a single frame. The other is part of the picture and has to be rebuilt. This page covers how to tell them apart, the commands for each case, and where every method breaks.

Every command here was run against a real clip before it was published, including the two that fail with an error. Where a command line is the right answer, it is given in full and no account is needed for it.

The distinction

Soft subtitles, also called closed subtitles, are a separate stream inside the container — a SRT, ASS or mov_text track sitting alongside the video. The player draws them at playback time. Because the picture never contained them, removing them costs nothing.

Hardcoded subtitles, also called burned-in or open subtitles, were drawn into the frames when the file was encoded. There is no separate stream, and the pixels the text covers are gone. The only way back is to reconstruct what was behind them.

The test takes five seconds: open the file in any player and turn subtitles off. If the text disappears, it is a track. If it stays, it is hardcoded.

Case 1 — a subtitle track

This is the easy case, it is lossless, and it does not need this site. Two commands.

List the subtitle streams in the file

ffprobe -v error -select_streams s \
  -show_entries stream=index,codec_name:stream_tags=language \
  -of csv=p=0 input.mp4

Output such as 1,mov_text,und means stream 1 is a subtitle track. No output means the file has none — if you can still see text, it is hardcoded.

Drop every subtitle track, keep everything else untouched

ffmpeg -i input.mp4 -map 0 -c copy -sn output.mp4

-c copy re-muxes without re-encoding, so this is lossless and takes seconds regardless of clip length. -sn drops subtitle streams. -map 0 keeps every other stream, including extra audio.

Case 2 — hardcoded subtitles

FFmpeg has no filter that reconstructs a region from its surroundings and from neighbouring frames. What it has are three filters that hide the text, each with a cost. They are worth knowing because they are what most tutorials on this topic actually teach, usually without saying what they give up.

delogo — interpolates the box from its own border

ffmpeg -i input.mp4 -vf "delogo=x=120:y=290:w=400:h=40" output.mp4

Built for faint static logos. On opaque subtitle text it leaves a smear. The rectangle must not touch the frame edge or FFmpeg stops with “Logo area is outside of the frame” — inset it by one pixel.

crop — cuts the band off entirely

ffmpeg -i input.mp4 -vf "crop=iw:ih-80:0:0" output.mp4

Lossless in the sense that nothing is invented, but it changes the frame size — a 640x360 clip becomes 640x280 — and it only works when the subtitles sit in a band you are willing to lose.

boxblur — covers the band rather than clearing it

ffmpeg -i input.mp4 -filter_complex \
  "[0:v]crop=400:40:120:290,boxblur=luma_radius=10:chroma_radius=5[b];\
   [0:v][b]overlay=120:290" output.mp4

A boxblur radius must be under half the smallest dimension of the plane it blurs. In yuv420p the chroma planes are half size, so on a 400x40 region the chroma plane is only 200x20 and its radius must be below 10 — a bare boxblur=10 stops with “Invalid chroma_param radius value”. Set chroma_radius explicitly.

All three leave a mark: a smear, a smaller frame, or a blurred block. None of them is removal. Removal means rebuilding the pixels the text covered, using the picture around the band and the same band in the frames either side — which is what an inpainting model does, and what the subtitle remover on this site does in the browser.

Why subtitles are the easy case for inpainting

Subtitles sit in a fixed band, usually near the bottom of the frame, and that band is usually the least busy part of the shot. The reconstruction therefore has a lot of consistent background to draw on, frame after frame. This is why a cleared subtitle band on an ordinary clip is often indistinguishable from a clean master, while removing an object from the middle of a moving scene is a much harder problem that this site does not attempt.

It also means you should mark the whole band once rather than chase individual lines or words. Subtitles that animate in, pop word by word, or stack two languages are all handled by marking the full region they move through.

Where it fails

Naming these is more useful than claiming everything works.

The background behind the text moves

Inpainting rebuilds a region using the surrounding picture and the frames either side of it. A subtitle band over a static wide shot has plenty to draw on. The same band over a fast pan, a crowd, or falling confetti does not, and the repair will shimmer.

The text sits over a face

Faces are the one thing a viewer inspects closely and the one thing a reconstruction cannot guess. Text across a cheek or a mouth is the most common cause of an obviously wrong result.

The subtitles cover a large share of the frame

The reconstruction is only as good as the picture left around the marked area. Once the marked region is a large fraction of the frame there is not enough left to work from, and no tool will save it.

The text is semi-transparent over fine detail

A translucent caption over text on screen — a document, a UI, a sign — leaves a partial signal that is harder to resolve than an opaque block. Results here are inconsistent.

You do not hold the rights to the file

This is not a technical limit but it is the real one. Removing a subtitle, a caption or a watermark does not grant you a licence to the footage underneath it.

Common questions

What are hardcoded subtitles?

Subtitles rendered into the video image at export time, so they are part of the picture rather than a separate stream. No player setting can switch them off. They are also called burned-in or open subtitles.

How do I know if my subtitles are hardcoded?

Open the file in any player and turn subtitles off. If the text disappears, it is a subtitle track. If the text stays on screen, it is hardcoded. You can also list the streams with ffprobe: a file with no subtitle stream but visible text has hardcoded subtitles.

Can FFmpeg remove hardcoded subtitles?

Not really. FFmpeg can hide them — delogo smears the area, crop cuts it off, boxblur covers it — but it has no filter that reconstructs the picture behind the text. For a subtitle track, FFmpeg removes it perfectly with a stream copy. For hardcoded text you need inpainting.

How do I remove a subtitle track without losing quality?

Copy the streams and drop the subtitles: ffmpeg -i input.mp4 -map 0 -c copy -sn output.mp4. Nothing is re-encoded, so there is no generation loss and it finishes in seconds.

What does the FFmpeg delogo filter actually do?

It interpolates the marked rectangle from the pixels immediately around its border. It was built for faint static station logos. On solid subtitle text it produces a visible smear, because there is no information inside the box to recover and the text is opaque.

Why does delogo say the logo area is outside of the frame?

The rectangle must not touch the frame edge. delogo reads the pixels around the border of the box, so it needs at least one pixel of margin on every side. Move the box in by one pixel and it runs.

Does removing subtitles reduce video quality?

Dropping a subtitle track does not, because nothing is re-encoded. Removing hardcoded subtitles re-encodes the frames it changes, so use a tool that rebuilds only the marked region and passes the rest of the frame through at the original resolution.

When does subtitle inpainting fail?

When the background behind the text moves or is highly detailed, when the text sits over a face, and when the subtitles cover a large share of the frame. In each case there is too little surrounding picture to reconstruct from.

Related