1

I have used ffmpeg to decompose the mp4 video into number of frames, and used OpenCV to add a invisible watermark into those frames, but the extracted watermark cannot resist the lossy compression way. Hence, I found it is not possible to embed an invisible watermark into mp4 video directly, as the distortion is too much, which I used DCT-based watermarking method.

And I have tried to convert mp4 video to yuv using ffmpeg in order to watermark the Y component, but it seems the produced YUV file cannot play properly.

Is there any way to embed an invisible watermark into the mp4 file?

What I mean is not to embed a transparent watermark (The watermark is not needed to adjust its transparency), but to embed a visible watermark to make the watermarked image seem that it does not contain any watermark, in other words, which is called invisible watermarking.

md612
  • 300
  • 2
  • 5
  • 20
  • The watermark added in the answer is not transparent. – md612 Aug 30 '17 at 09:29
  • Possible duplicate of [How to add transparent watermark in center of a video with ffmpeg?](https://stackoverflow.com/questions/10918907/how-to-add-transparent-watermark-in-center-of-a-video-with-ffmpeg) – Matteo Ragni Aug 30 '17 at 09:44

1 Answers1

0

The watermark is supposed to be a PNG image with an ALPHA channel (transparency). You must create the logo with the desired amount of alpha channel. The lower the value, the lower the opacity.

The watermark can be added with a simple ffmpeg command that is in the answer

 ffmpeg -i input.mp4 -i logo.png -filter_complex \
 "overlay=(W-w)/2:(H-h)/2" \
 -codec:a copy output.mp4

where W, H refer to the size of the video and w, h refer to the size of the logo. If the logo has an alpha channel, it is maintained in the result.

Matteo Ragni
  • 2,837
  • 1
  • 20
  • 34