如何在上传的视频文件中添加水印图像 [英] How to add watermark image in uploaded videofile

查看:177
本文介绍了如何在上传的视频文件中添加水印图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在上传的视频文件中或已经存在的视频文件中添加水印,为此我尝试了FFMEPEG.exe文件,但它对我不起作用,我也不想使用第三方工具.

i Want to add a watermark in uploaded video file or in already exists video file ,i have tried the FFMEPEG.exe file for this but it didnt work for my and i dont want to use third party tool.

推荐答案

您必须从上传的视频中删除一个帧!
you have to take a frame out of your uploaded video!
Process p;
ProcessStartInfo info = new ProcessStartInfo();
info.FileName = "ffmpeg.exe";
info.WindowStyle = ProcessWindowStyle.Hidden;
info.Arguments = " -i " + your_video_name + " -vframes 1 " + your_extracted_image_name + "%d.jpg";


p = Process.Start(info);


while (!p.HasExited) { Thread.Sleep(10); }



视频的地址应该是这样的:"c:\ inetpub \ wwwroot \ mysite \ videos \ video_to_convert.3gp"
"-vframes 1"占据视频文件的第一帧!
%d.jpg":%d是ffmpeg.exe的参数,可对新图像进行自动编号,
然后保存您的图片,然后使用本文制作水印图片!
检查一下!
在C#中构建简单的水印实用程序 [ ^ ]
希望对您有所帮助!:)



the address of the video should be some thing like this: "c:\inetpub\wwwroot\mysite\videos\video_to_convert.3gp"
"-vframes 1 " take the first frame of your video file!
"%d.jpg": %d is a parameter for ffmpeg.exe that make an auto numbering for new image ,
then it save your image, and then use this article to make a watermark image!
check this out!
Build a Simple Watermarking Utility in C#[^]
I hope this could be helpful!:)


这篇关于如何在上传的视频文件中添加水印图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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