delogo filter to remove target elements.
delogo filter.
delogo works by blending/repairing pixels
inside the rectangle using the surrounding area, which
can “paint over” a static logo (results vary by content,
motion, and background).
-c copy?
Splitting and concatenating are faster when streams are
copied (no re-encode) for those steps.
delogo filter modifies pixels, so the video
must be re-encoded (audio is still stream-copied here).
-c copy), ffmpeg
often can only cut cleanly on keyframes (full
“reference” frames). If your chosen time falls between
keyframes, the actual cut may snap to the nearest
keyframe, so boundaries can be slightly early/late.
SEGMENT*.mp4,
SEGMENT*_logo_removed.mp4, and
CONCAT_SEGMENTS.txt.
MyVideo.mp40:01:30 (1:30)0:02:30 (2:30)delogo=740:962:416:44
This produces three segments:
SEGMENT00.mp4 = before startSEGMENT01.mp4 = the middle range (start →
stop) to be logo-removed
SEGMENT02.mp4 = after stopGenerated command shape:
ffmpeg -i "MyVideo.mp4" -map 0 -c copy -f segment -segment_times 0:01:30,0:02:30 SEGMENT%02d.mp4 \ && ffmpeg -i "SEGMENT01.mp4" -map 0 -c copy -c:v libx264 -crf 20 -vf delogo=740:962:416:44 "SEGMENT01_logo_removed.mp4" \ && echo "file 'SEGMENT00.mp4'" > CONCAT_SEGMENTS.txt \ && echo "file 'SEGMENT01_logo_removed.mp4'" >> CONCAT_SEGMENTS.txt \ && echo "file 'SEGMENT02.mp4'" >> CONCAT_SEGMENTS.txt \ && ffmpeg -f concat -i CONCAT_SEGMENTS.txt -c copy -map 0 "MyVideo_logo_removed.mp4"
-i ...: input file.-map 0: include all streams from input
(video, audio, subtitles, etc.).
-c copy: stream copy (no re-encode) for
fast split/concat; still overridden for video re-encode
in the delogo step.
-f segment -segment_times A,B: split into
numbered outputs at the given timestamps.
-c:v libx264 -crf 20: encode video with
H.264 at a constant quality target (lower CRF = higher
quality).
-vf delogo=X:Y:W:H: apply the logo removal
filter using the drawn rectangle.
-f concat -i CONCAT_SEGMENTS.txt:
concatenate the listed files back together.