public void WaterMark(string text, string fileName, string outputFile)
        {
            var imgFile = SaveWaterMakerImg(text);
            string mingling = "-i " + fileName + " -i " + imgFile + " -filter_complex \"overlay=10:10\" " + outputFile;
            RunProcess(mingling);
        }
        public static string SaveWaterMakerImg(string text)
        {
            var tempBaseDir = Path.Combine(Path.GetTempPath(), "YiDoc");
            //var tempDir = Path.Combine(tempBaseDir, Guid.NewGuid().ToString());
            Directory.CreateDirectory(tempBaseDir);
            var tempWaterMakerPath = Path.Combine(tempBaseDir, "WaterMaker.jpg");
            var path = Path.Combine(tempBaseDir, "VideoWaterMaker.jpg");
            var img = AddText2Image(System.Drawing.Image.FromFile(tempWaterMakerPath), text, new Point(300, 300), new System.Drawing.Font("黑体", 100), Color.Gray, 1);
            img.Save(path);
            return path;
        }
        private static System.Drawing.Image AddText2Image(System.Drawing.Image img, string text, Point p, System.Drawing.Font font, Color fontColor, int angle)
        {
            using (var g = Graphics.FromImage(img))
            using (var brush = new SolidBrush(fontColor))
            {
                g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.High;
                g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
                var sizeF = g.MeasureString(text, font);
                g.ResetTransform();
                g.TranslateTransform(p.X, p.Y);
                g.RotateTransform(angle);
                g.DrawString(text, font, brush, new PointF(-sizeF.Width / 2, -sizeF.Height / 2));
            }
            return img;
        }
        static string PhysicsPath { get { return AppDomain.CurrentDomain.BaseDirectory.TrimEnd('\\') ; } }
        public static string ffmpegFullPath { get { return $@"{PhysicsPath}\ffmpeg\ffmpeg.exe"; } }
        private static string RunProcess(string Parameters)
        {

            string FFmpegPath = ffmpegFullPath;
            //创建一个ProcessStartInfo对象 并设置相关属性
            var oInfo = new ProcessStartInfo(FFmpegPath, Parameters);
            oInfo.UseShellExecute = false;
            oInfo.CreateNoWindow = true;
            oInfo.RedirectStandardOutput = true;
            oInfo.RedirectStandardError = true;
            oInfo.RedirectStandardInput = true;

            //创建一个字符串和StreamReader 用来获取处理结果
            string output = null;
            StreamReader srOutput = null;

            try
            {
                //调用ffmpeg开始处理命令
                var proc = Process.Start(oInfo);

                //proc.WaitForExit


                //获取输出流
                srOutput = proc.StandardError;

                //转换成string
                output = srOutput.ReadToEnd();

                //关闭处理程序
                proc.Close();
            }
            catch (Exception)
            {
                output = string.Empty;
            }
            finally
            {
                //释放资源
                if (srOutput != null)
                {
                    srOutput.Close();
                    srOutput.Dispose();
                }
            }
            return output;
        }
   public static Stream GetVideoWaterMakerStream()
        {
            var tempDir = "D:\\测试文档\\temp";
            Directory.CreateDirectory(tempDir);
            var fm = new ffmpeg();
            //var user = docContext.GetUser(new Guid(UserID));
            fm.WaterMark("水印", "视频测试.mp4", "D:\\测试文档\\测试\\视频测试.mp4");
            var fs = File.Open("D:\\测试文档\\测试\\视频测试.mp4", FileMode.Open, FileAccess.Read, FileShare.Read);
            //DeleteTempFile.Delete(tempDir);//删除临时文件下的文件
            return fs;
        }将此段代码修改为给视频加多行文本水印