Dhvani Shah
Dhvani Shah

Reputation: 371

applying watermark on a movie video in C#

I have applied watermark on an image using c#. Now, I wanted to add a logo or watermark on the video using c#.

Can anybody suggest some ways to achieve this.

Any help would be greatly appreciable.

Upvotes: 0

Views: 3919

Answers (1)

Mick
Mick

Reputation: 25481

If you are ok to use ffmpeg then you can add the overlay with ffmpeg using a command like this:

ffmpeg -i inputVideo.mp4 -i yourwatermark.png -filter_complex "overlay=5:5" -codec:a copy outputVideo.mp4

See this answer for more examples of placing the watermark - i.e. top left, bottom right etc: https://stackoverflow.com/a/10920872/334402

Using ffmpeg from many environments is often easiest done via a well supported wrapper library - this is speaking as someone who first used a homemade wrapper (in a different environment - not c#) but wished I had used a library!

However, c# does not seem to have a well supported ffmpeg wrapper, so it looks like you would need to execute the ffmpeg program yourself using a 'new Process()'. There is an example of this in this answer here: https://stackoverflow.com/a/7350411/334402

Upvotes: 2

Related Questions