5

What are some scalable and secure ways to provide a streaming video to a recipient with their name overlayed as a watermark?

Brian Gates
  • 474
  • 5
  • 17
  • You're going to have to define `secure`. – sarnold Jun 07 '11 at 02:13
  • `mencoder(1)`'s `bmovl` video filter looks like it can be useful in adding watermarks. They even provided a `bmovl-test.c` you can crib from. – sarnold Jun 07 '11 at 02:16
  • Please give us some more information... what kind of server OS? What will be the source of the video? – Mike Pennington Jun 07 '11 at 02:16
  • Sorry that my question is vague. I lack some knowledge to truly ask the appropriate questions. So thank you for your feedback. – Brian Gates Jun 07 '11 at 17:48
  • The server is a Debian server. We're running php, but we're certainly open to alternate technologies (I was considering node, for example). The source of the video is another Debian server, if that's what you were asking. – Brian Gates Jun 07 '11 at 18:04
  • As far as "secure", I mean not simply overlaying a png on top of the video in html/css ;) A burn-in on the server side has excellent security but heavy performance implications whereas using flash to overlay an image would be much more performative but significantly less secure. Without an army of servers, is there a reasonably secure means to stream a video with a dynamic watermark? – Brian Gates Jun 07 '11 at 18:18
  • @sarnold, could bmovl be used to watermark a video stream? I.E. upon request, start watermarking, and before it's complete, start streaming the watermarked version? – Brian Gates Jun 07 '11 at 18:21
  • @brian, based entirely on the documentation, I'd say yes. I've never needed to watermark video, but I _have_ watched videos as `mencoder` encodes them, so streaming is well within its abilities. For how many clients handled by how large a server? No idea... – sarnold Jun 07 '11 at 19:50
  • I suspect you want their name on the watermark to deter them from distributing the video, is that right? Do you want to try to prevent the user from removing the watermark? What is the bandwidth of the video stream? How many streams may be open concurrently? What is the acceptable amount of latency? Do you need to have a watermark on every fame or is some fraction acceptable? – this.josh Jun 07 '11 at 21:33
  • Yes, we want the user's name watermarked and for it to be very difficult to remove. It's a web-resolution video ~480p. A minute of latency or less would be ideal (typical buffering time); the user will hit play and expect to see video within a short duration. Watermarking not every frame is an interesting thought; though it would have to be enough frames that cutting them out would make the video unusable. – Brian Gates Jun 08 '11 at 01:01
  • Oh, and the number of streams open simultaneously could be in the hundreds, and it would ideally support thousands, @this.josh – Brian Gates Jun 08 '11 at 01:09

2 Answers2

1

Some of the comments here are very good. Using libavfilter is probably a good place to start. Watermarking every frame is going to be very expensive because it requires decoding and re-encoding the entire video for each viewer.

One idea I'd like to expand upon is watermarking only portions of the video. I will assume you're working with h.264 video, which requires far more CPU cycles to decode and encode than older codecs. I think per cpu core you could mark 1 or 2 stream in real time. If you can reduce your requirements to 10 seconds marked out of 100, then you're talking about 10-20 per core, so about 100 per server. It's probably not the performance you're looking for.

I think some companies sell watermarking hardware for TV operators, but I doubt it's any cheaper than a rack of servers and far less flexible.

vipw
  • 7,593
  • 4
  • 25
  • 48
0

I think you want to use the ffmpeg libavfilter library. Basically it allows you to overlay an image on top of a video. There is an example showing how to insert a transparent PNG logo in the bottom left corner of the input. You can interface with the library from C++ or from a shell on a command line basis.

In older versions of ffmpeg you will need to use a extension library called watermark.so, often located in /usr/lib/vhook/watermark.so

Depending on what your content is, you may want to consider using invisible digital watermarking as well. It embeds a digital sequence into your video which is not visually detectable. Even if someone were to remove the visible watermark, the invisible watermark would still remain. If a user were to redistribute your video, invisible watermarking would indicate the source of the redistribution.

Of course there are also companies which provide video content management, but I get the sense you want to do this yourself. Doing the watermarking real time is going to be very resource intensive, especialy as you scale up. I would look to do some type of predicitive watermarking.

this.josh
  • 663
  • 9
  • 21
  • Thank you for this. I've installed and begun tinkering with ffmpeg to see if it will meet my needs. So far I'm having some codec issues which I'm unaware how to resolve, so I'll need to spend a bit more time with it. – Brian Gates Jun 08 '11 at 18:34