2

How I can remove tiktok video logo using FFmpeg? Like most sites are doing e.g https://ssstik.io/en

I tried to remove the logo using delogo filter but it leaves a blur effect in the video while the above site logo removal is clean, with no blurry effect.

ffmpeg -i input.mp4 -vf "delogo=x=10:y=10:w=180:h=75" -c:a copy output.mp4

Any idea how I can remove watermark with clean output? Thanks in advance.

1 Answer 1

2

I'm also looking into this topic of watermark removal. But I'm not specifically knowledgeable about logo removal, so this is just my best guess as a software engineer.

From what I know about ffmpeg, I'd say that it's just using differential mpeg data to fill in the deleted region. Probably works really poorly when the camera doesn't move. Probably just copies pixels on the borders of the missing region until it's been filled completely.

The site you mention only handles TikTok logos specifically, which means it can still use the pixels between the letters. In addition to what ffmpeg does, I'm sure it applies some machine learning algorithms to determine the most likely missing pixels.

So the way I see it, what you need to do proper watermark removal, is 1) Determine exactly which pixels in which frames are part of the logo. This is easier for moving video, where you can use gradient data to identify which pixels show an edge throughout the video, whereas with still video, all background would get marked as logo. 2) Then you need to use the differential mpeg data (hopefully, you can access that from ffmpeg) to do some initial filling in of empty pixels. If not, you're stuck having to do some optical flow algorithm yourself on consecutive video frames. And 3) You need a properly trained ML algorithm, probably a recurrent convolutional neural network to make a good guess from context about the missing pixels. Fortunately, it's easy to generate training data from existing video.

Usually, a company will apply the same logo to every video it produces, which means that once you have successfully delogoed one video, others become easier. Some logos are ever partially transparent, which means you can reverse engineer how the logo changes the pixels underneath, and directly correct them without going through all the hoops of differential mpeg data and ML smart fill.

All in all, that sounds like a massive project. But if you do it well, the possibilities are endless, and you can probably make a career out of what you learned along the way, or from the product directly.

1
  • 1
    Nice to see your comment. The site above I learned and searched about it. They are using some reverse engineering for TikTok servers and they are getting video data directly from TikTok server without logos(original video untouched).
    – royallife
    Commented Sep 9, 2022 at 12:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.