applying watermark on a movie video in C#

戏子无情 提交于 2020-06-29 03:59:47

问题


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.


回答1:


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



来源:https://stackoverflow.com/questions/49105004/applying-watermark-on-a-movie-video-in-c-sharp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!