在 C# 中的电影视频上应用水印 [英] applying watermark on a movie video in C#

查看:99
本文介绍了在 C# 中的电影视频上应用水印的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 c# 在图像上应用了水印.现在,我想使用 c# 在视频上添加徽标或水印.

任何人都可以提出一些实现这一目标的方法.

任何帮助都将不胜感激.

解决方案

如果您可以使用 ffmpeg,那么您可以使用如下命令添加带有 ffmpeg 的叠加层:

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

有关放置水印的更多示例,请参阅此答案 - 即左上角、右下角等:https://stackoverflow.com/a/10920872/334402

在许多环境中使用 ffmpeg 通常最容易通过支持良好的包装器库来完成 - 这是作为第一次使用自制包装器(在不同的环境中 - 不是 c#)但希望我使用过库的人说的!

但是,c# 似乎没有很好支持的 ffmpeg 包装器,因此您似乎需要使用new Process()"自己执行 ffmpeg 程序.这里的答案中有一个例子:https://stackoverflow.com/a/7350411/334402>

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.

解决方案

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

这篇关于在 C# 中的电影视频上应用水印的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆